From 6bcf1d9d7aaf1fa6847f48f09f4a00f94bee9bdf Mon Sep 17 00:00:00 2001 From: Henrik Nygren Date: Fri, 6 Nov 2026 12:44:45 +0200 Subject: [PATCH 01/25] Add a Nix dev shell --- .envrc | 1 + .gitignore | 3 ++ flake.lock | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 49 ++++++++++++++++++++ 4 files changed, 186 insertions(+) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 000000000..3550a30f2 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index e21f73f37..1f1a6f24a 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,6 @@ # Ignore default active_storage storage/ + +# Nix / direnv +/.direnv diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..97a6bfbac --- /dev/null +++ b/flake.lock @@ -0,0 +1,133 @@ +{ + "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1791914995, + "narHash": "sha256-Zf/xfQEAasnwnmEfHqW/4hjDE/s44yn2hD4RuVIZRjA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b7a79d3fea1e214f6d668d521cecec0c01e26544", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1791914995, + "narHash": "sha256-Zf/xfQEAasnwnmEfHqW/4hjDE/s44yn2hD4RuVIZRjA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b7a79d3fea1e214f6d668d521cecec0c01e26544", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1793826729, + "narHash": "sha256-D5H7H+qMoTGI/jJtxKP4u7BdjkFnUyhOovTrf3pTOr0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6dadaf4375be35033e1c84395adbd53ff5fded96", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-ruby": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1793886739, + "narHash": "sha256-Z5AS8oDoTM0CHE7DqmGslEGVQwhBbKoAlCOGNxXw4gA=", + "owner": "bobvanderlinden", + "repo": "nixpkgs-ruby", + "rev": "8c825b94f9e207ea414e3a5da37c369d768c320f", + "type": "github" + }, + "original": { + "owner": "bobvanderlinden", + "repo": "nixpkgs-ruby", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "nixpkgs-ruby": "nixpkgs-ruby" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..9db1a5c21 --- /dev/null +++ b/flake.nix @@ -0,0 +1,49 @@ +{ + description = "Development shell for tmc-server"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + nixpkgs-ruby = { + url = "github:bobvanderlinden/nixpkgs-ruby"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + { nixpkgs, flake-utils, nixpkgs-ruby, ... }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { inherit system; }; + # Keep in step with the image in DockerfileBase; nixpkgs only carries the newest Rubies. + ruby = nixpkgs-ruby.packages.${system}."ruby-3.3"; + in + { + devShells.default = pkgs.mkShell { + packages = [ + ruby + pkgs.nodejs + pkgs.postgresql + # Without it the pg gem finds the host pg_config and links against the host glibc. + pkgs.postgresql.pg_config + pkgs.libyaml + pkgs.openssl + pkgs.zlib + pkgs.libffi + pkgs.pkg-config + pkgs.gnumake + pkgs.vips + pkgs.git + ]; + + shellHook = '' + # Gems go into the project rather than the Nix store or another Ruby's GEM_HOME. + export BUNDLE_PATH="$PWD/vendor/bundle" + export GEM_HOME="$PWD/vendor/bundle/ruby/${ruby.version.libDir}" + export PATH="$GEM_HOME/bin:$PWD/bin:$PATH" + ''; + }; + } + ); +} From 81254913f80ff42ce75d7f8cd001c93c26d181bd Mon Sep 17 00:00:00 2001 From: Henrik Nygren Date: Fri, 6 Nov 2026 12:54:14 +0200 Subject: [PATCH 02/25] Add Sorbet and Tapioca and type the app as strict --- .github/workflows/ci.yml | 34 + Gemfile | 4 + Gemfile.lock | 49 + .../kafka_batch_update_points_task.rb | 16 +- .../kafka_realtime_update_points_task.rb | 16 +- app/background_tasks/refresh_course_task.rb | 32 +- .../rust_langs_downloader_task.rb | 7 +- .../sandbox_status_fetcher_task.rb | 14 +- app/background_tasks/stats_fetcher_task.rb | 5 + .../submission_long_queue_processor_task.rb | 7 +- .../submission_processor_task.rb | 7 +- .../uncomputed_unlock_computor_task.rb | 9 +- .../uncomputed_unlock_computor_task_backup.rb | 9 +- app/channels/application_cable/channel.rb | 1 + app/channels/application_cable/connection.rb | 7 +- .../course_template_refresh_channel.rb | 5 + app/controllers/api.rb | 1 + app/controllers/api/beta.rb | 1 + app/controllers/api/beta/base_controller.rb | 15 +- .../beta/course_id_information_controller.rb | 2 + .../api/beta/participant_controller.rb | 7 +- app/controllers/api/beta/stats_controller.rb | 19 +- app/controllers/api/v8.rb | 1 + app/controllers/api/v8/apidocs_controller.rb | 7 +- .../v8/application/credentials_controller.rb | 2 + app/controllers/api/v8/base_controller.rb | 30 +- app/controllers/api/v8/core.rb | 1 + .../api/v8/core/courses/reviews_controller.rb | 70 +- .../api/v8/core/courses/unlocks_controller.rb | 2 + .../api/v8/core/courses_controller.rb | 2 + .../v8/core/exercises/details_controller.rb | 6 +- .../v8/core/exercises/solutions_controller.rb | 2 + .../core/exercises/submissions_controller.rb | 34 +- .../api/v8/core/exercises_controller.rb | 5 +- .../core/organizations/courses_controller.rb | 2 + .../core/submissions/feedback_controller.rb | 2 + .../v8/core/submissions/reviews_controller.rb | 36 +- .../api/v8/core/submissions_controller.rb | 88 +- ...l_courses_with_this_template_controller.rb | 2 + .../v8/courses/exercises/points_controller.rb | 4 +- .../exercises/users/points_controller.rb | 4 +- .../api/v8/courses/exercises_controller.rb | 4 +- .../api/v8/courses/points_controller.rb | 4 +- .../submissions/last_hour_controller.rb | 2 + .../api/v8/courses/submissions_controller.rb | 2 + .../api/v8/courses/users/points_controller.rb | 4 +- .../courses/users/submissions_controller.rb | 2 + app/controllers/api/v8/courses_controller.rb | 2 + .../exercises/model_solutions_controller.rb | 4 +- .../exercises/users/submissions_controller.rb | 2 + .../courses/exercises/points_controller.rb | 4 +- .../exercises/users/points_controller.rb | 4 +- .../courses/exercises_controller.rb | 4 + .../courses/points_controller.rb | 4 +- .../studyright_eligibility_controller.rb | 6 +- .../courses/submissions_controller.rb | 2 + .../courses/users/points_controller.rb | 4 +- .../courses/users/progress_controller.rb | 4 +- .../courses/users/submissions_controller.rb | 2 + .../v8/organizations/courses_controller.rb | 2 + .../organizations/memberships_controller.rb | 3 + .../api/v8/organizations_controller.rb | 3 + .../api/v8/user_app_datum_controller.rb | 2 + .../api/v8/user_field_value_controller.rb | 2 + .../api/v8/users/assistantships_controller.rb | 4 +- .../users/basic_info_by_emails_controller.rb | 2 + .../v8/users/basic_info_by_ids_controller.rb | 2 + .../basic_info_by_usernames_controller.rb | 2 + .../api/v8/users/password_reset_controller.rb | 10 +- ...ecently_changed_user_details_controller.rb | 4 +- .../v8/users/request_deletion_controller.rb | 2 + .../api/v8/users/teacherships_controller.rb | 4 +- app/controllers/api/v8/users_controller.rb | 148 +- app/controllers/application_controller.rb | 94 +- app/controllers/auths_controller.rb | 4 + app/controllers/breadcrumb_helpers.rb | 32 - app/controllers/certificates_controller.rb | 33 +- .../course_notifications_controller.rb | 11 +- .../course_templates_controller.rb | 41 +- app/controllers/courses_controller.rb | 135 +- app/controllers/emails_controller.rb | 17 +- app/controllers/exercise_status_controller.rb | 10 +- app/controllers/exercises_controller.rb | 17 +- .../feedback_answers_charts_controller.rb | 8 +- .../feedback_answers_controller.rb | 34 +- .../feedback_questions_controller.rb | 22 +- .../feedback_replies_controller.rb | 2 + app/controllers/files_controller.rb | 2 + app/controllers/full_zip_controller.rb | 6 +- .../migrate_to_other_course_controller.rb | 34 +- .../model_solution_token_useds_controller.rb | 10 +- app/controllers/organizations_controller.rb | 128 +- app/controllers/participants_controller.rb | 162 +- .../password_reset_keys_controller.rb | 47 +- app/controllers/points_controller.rb | 53 +- app/controllers/positions_controller.rb | 4 +- app/controllers/results_controller.rb | 4 +- .../reviewed_submissions_controller.rb | 13 +- app/controllers/reviews_controller.rb | 121 +- app/controllers/sessions_controller.rb | 9 +- app/controllers/settings_controller.rb | 39 +- .../setup/course_assistants_controller.rb | 27 +- .../setup/course_chooser_controller.rb | 8 +- .../setup/course_details_controller.rb | 41 +- .../setup/course_finisher_controller.rb | 14 +- .../setup/course_timings_controller.rb | 39 +- .../setup/organizations_controller.rb | 13 +- app/controllers/setup/setup_controller.rb | 35 +- app/controllers/setup/start_controller.rb | 8 +- app/controllers/solutions_controller.rb | 6 +- app/controllers/stats_controller.rb | 61 +- app/controllers/status_controller.rb | 10 +- app/controllers/submissions_controller.rb | 159 +- app/controllers/teachers_controller.rb | 17 +- app/controllers/unlocks_controller.rb | 6 +- app/controllers/users_controller.rb | 47 +- app/helpers/application_helper.rb | 28 +- app/helpers/authorize_collection_helper.rb | 6 +- app/helpers/bad_utf8_helper.rb | 4 + app/helpers/bootstrap_flash_helper.rb | 3 + app/helpers/course_timings_helper.rb | 15 +- app/helpers/courses_helper.rb | 6 +- app/helpers/embeddable_helper.rb | 7 - app/helpers/exercises_helper.rb | 6 + app/helpers/extra_field_helper.rb | 14 +- app/helpers/feedback_answers_helper.rb | 10 +- app/helpers/flash_block_helper.rb | 6 + app/helpers/paste_helper.rb | 1 + app/helpers/points_helper.rb | 4 + app/helpers/sessions_helper.rb | 14 +- app/helpers/submissions_helper.rb | 24 +- app/helpers/twitter_breadcrumbs_helper.rb | 4 + app/mailers/course_notification_mailer.rb | 10 +- app/mailers/feedback_reply_mailer.rb | 5 +- .../new_organization_request_mailer.rb | 7 +- app/mailers/password_reset_key_mailer.rb | 9 +- app/mailers/review_mailer.rb | 13 +- app/mailers/user_mailer.rb | 21 +- app/models/ability.rb | 3 + app/models/action_token.rb | 7 +- app/models/api_version.rb | 1 + app/models/application_record.rb | 1 + app/models/assistantship.rb | 1 + app/models/available_point.rb | 14 +- app/models/awarded_point.rb | 48 +- app/models/banned_email.rb | 3 + app/models/certificate.rb | 17 +- app/models/course.rb | 89 +- app/models/course_notification.rb | 11 +- app/models/course_template.rb | 16 +- app/models/course_template_refresh.rb | 4 + app/models/course_template_refresh_phase.rb | 1 + app/models/course_template_refresh_report.rb | 10 +- app/models/deadline_spec.rb | 43 +- app/models/exercise.rb | 149 +- app/models/exercise_group.rb | 35 +- app/models/extra_field.rb | 135 +- app/models/extra_field_value.rb | 16 +- app/models/feedback_answer.rb | 15 +- app/models/feedback_question.rb | 11 +- app/models/file_store.rb | 11 +- app/models/guest.rb | 7 +- app/models/kafka_batch_update_points.rb | 6 + app/models/migrated_submissions.rb | 1 + app/models/model_solution_access_log.rb | 1 + app/models/model_solution_token_used.rb | 1 + app/models/orderable.rb | 28 +- app/models/organization.rb | 17 +- app/models/organization_membership.rb | 1 + app/models/recently_changed_user_detail.rb | 1 + app/models/remote_sandbox.rb | 43 +- app/models/reply_to_feedback_answer.rb | 1 + app/models/review.rb | 14 +- app/models/session.rb | 8 +- app/models/site_setting.rb | 12 +- app/models/solution.rb | 28 +- app/models/source_file_list.rb | 50 +- app/models/stats.rb | 19 +- app/models/submission.rb | 106 +- app/models/submission_data.rb | 54 +- app/models/teachership.rb | 1 + app/models/test_case_run.rb | 1 + app/models/tmc_project_file.rb | 13 +- app/models/uncomputed_unlock.rb | 5 + app/models/unlock.rb | 15 +- app/models/unlock_spec.rb | 74 +- app/models/user.rb | 80 +- app/models/user_app_datum.rb | 1 + app/models/user_field.rb | 5 + app/models/user_field_value.rb | 1 + .../feedback_answer_format_validator.rb | 6 +- app/models/verification_token.rb | 3 + .../courses_mooc_fi_authentication.rb | 4 + .../courses_mooc_fi_rate_limit_bypass.rb | 3 + .../courses_mooc_fi_token_introspector.rb | 12 +- app/views/emails/index.html.erb | 4 +- bin/tapioca | 9 + config/application.rb | 4 + config/boot.rb | 1 + config/environment.rb | 1 + config/environments/development.rb | 1 + config/environments/production.rb | 1 + config/environments/test.rb | 1 + config/initializers/admin.rb | 4 + config/initializers/assets.rb | 1 + config/initializers/backtrace_silencers.rb | 1 + config/initializers/cookies_serializer.rb | 1 + config/initializers/doorkeeper.rb | 1 + .../initializers/doorkeeper_openid_connect.rb | 1 + config/initializers/env_lang.rb | 1 + .../initializers/filter_parameter_logging.rb | 1 + config/initializers/inflections.rb | 1 + config/initializers/logstasher.rb | 5 +- config/initializers/mime_types.rb | 1 + config/initializers/mini_profiler.rb | 6 +- config/initializers/rack_attack.rb | 7 +- config/initializers/rack_initializer.rb | 1 + config/initializers/rack_timeout.rb | 1 + config/initializers/session_store.rb | 1 + config/initializers/wrap_parameters.rb | 2 + config/routes.rb | 1 + config/site_tailoring.example.rb | 1 + config/sorbet_runtime.rb | 81 + db/seeds.rb | 1 + lib/app_secrets.rb | 16 +- lib/background_task_registry.rb | 11 +- lib/course_info.rb | 44 +- lib/course_list.rb | 34 +- lib/course_refresh_database_updater.rb | 128 +- lib/date_and_time_utils.rb | 12 + lib/doc_gen.rb | 19 +- lib/doc_gen/shell_session.rb | 27 +- lib/exercise_completion_status_generator.rb | 9 +- lib/file_tree_hasher.rb | 3 + lib/kafka_updater.rb | 35 +- lib/natsort.rb | 12 +- lib/point_comparison.rb | 6 + lib/ruby_init_script.rb | 41 +- lib/rust_langs_cli_executor.rb | 37 +- lib/safe_unzipper.rb | 4 + lib/sandbox_results_saver.rb | 12 +- lib/student_submission_migrator.rb | 17 +- lib/submission_list.rb | 10 +- lib/submission_packager.rb | 3 + lib/submission_processor.rb | 9 +- lib/system_commands.rb | 10 + lib/tailoring.rb | 9 +- lib/test_run_grader.rb | 67 +- lib/tmc_dir_utils.rb | 6 + lib/twitter_bootstrap_breadcrumbs.rb | 36 +- lib/version.rb | 13 +- script/passenger_worker_cleaner.rb | 1 + sorbet/config | 18 + sorbet/rbi/annotations/.gitattributes | 1 + sorbet/rbi/annotations/actionmailer.rbi | 15 + sorbet/rbi/annotations/actionpack.rbi | 452 + sorbet/rbi/annotations/actionview.rbi | 75 + sorbet/rbi/annotations/activejob.rbi | 62 + sorbet/rbi/annotations/activemodel.rbi | 119 + sorbet/rbi/annotations/activerecord.rbi | 151 + sorbet/rbi/annotations/activesupport.rbi | 558 + sorbet/rbi/annotations/faraday.rbi | 45 + sorbet/rbi/annotations/globalid.rbi | 30 + sorbet/rbi/annotations/i18n.rbi | 40 + sorbet/rbi/annotations/minitest.rbi | 120 + sorbet/rbi/annotations/railties.rbi | 100 + sorbet/rbi/annotations/rainbow.rbi | 269 + sorbet/rbi/dsl/.gitattributes | 1 + .../rbi/dsl/abstract_controller/caching.rbi | 31 + .../abstract_controller/caching/fragments.rbi | 24 + .../rbi/dsl/abstract_controller/callbacks.rbi | 24 + .../rbi/dsl/abstract_controller/helpers.rbi | 24 + .../rbi/dsl/abstract_controller/rendering.rbi | 10 + .../rbi/dsl/abstract_controller/url_for.rbi | 24 + .../dsl/action_cable/channel/callbacks.rbi | 24 + .../action_cable/channel/periodic_timers.rbi | 22 + .../dsl/action_cable/connection/callbacks.rbi | 24 + .../connection/identification.rbi | 24 + sorbet/rbi/dsl/action_controller/caching.rbi | 30 + .../dsl/action_controller/conditional_get.rbi | 24 + .../content_security_policy.rbi | 32 + .../dsl/action_controller/data_streaming.rbi | 10 + .../dsl/action_controller/etag_with_flash.rbi | 25 + .../etag_with_template_digest.rbi | 31 + sorbet/rbi/dsl/action_controller/flash.rbi | 20 + .../dsl/action_controller/form_builder.rbi | 20 + sorbet/rbi/dsl/action_controller/helpers.rbi | 37 + .../dsl/action_controller/params_wrapper.rbi | 24 + .../rbi/dsl/action_controller/redirecting.rbi | 25 + .../rbi/dsl/action_controller/renderers.rbi | 24 + .../dsl/action_controller/renderers/all.rbi | 25 + .../request_forgery_protection.rbi | 32 + sorbet/rbi/dsl/action_controller/rescue.rbi | 25 + .../dsl/action_controller/respond_with.rbi | 30 + .../action_controller/test_case/behavior.rbi | 25 + sorbet/rbi/dsl/action_controller/url_for.rbi | 25 + sorbet/rbi/dsl/action_dispatch/assertions.rbi | 10 + .../dsl/action_dispatch/integration_test.rbi | 12 + .../routing/route_set/mounted_helpers.rbi | 24 + .../dsl/action_dispatch/routing/url_for.rbi | 24 + .../rbi/dsl/action_mailbox/inbound_email.rbi | 1088 + .../dsl/action_mailbox/incineration_job.rbi | 21 + sorbet/rbi/dsl/action_mailbox/routing_job.rbi | 21 + sorbet/rbi/dsl/action_mailer/callbacks.rbi | 23 + .../dsl/action_mailer/delivery_methods.rbi | 54 + sorbet/rbi/dsl/action_mailer/form_builder.rbi | 20 + .../dsl/action_mailer/mail_delivery_job.rbi | 35 + .../rbi/dsl/action_mailer/queued_delivery.rbi | 30 + sorbet/rbi/dsl/action_mailer/rescuable.rbi | 25 + .../dsl/action_mailer/test_case/behavior.rbi | 25 + .../dsl/action_text/encrypted_rich_text.rbi | 990 + sorbet/rbi/dsl/action_text/rich_text.rbi | 991 + sorbet/rbi/dsl/action_token.rbi | 1434 + sorbet/rbi/dsl/action_view/helpers.rbi | 15 + .../dsl/action_view/helpers/form_helper.rbi | 11 + .../action_view/helpers/form_tag_helper.rbi | 11 + .../dsl/action_view/helpers/text_helper.rbi | 10 + sorbet/rbi/dsl/action_view/layouts.rbi | 25 + sorbet/rbi/dsl/action_view/rendering.rbi | 10 + sorbet/rbi/dsl/active_job/callbacks.rbi | 24 + sorbet/rbi/dsl/active_job/exceptions.rbi | 26 + sorbet/rbi/dsl/active_job/execution.rbi | 25 + sorbet/rbi/dsl/active_job/logging.rbi | 20 + sorbet/rbi/dsl/active_job/queue_adapter.rbi | 21 + sorbet/rbi/dsl/active_job/queue_name.rbi | 30 + sorbet/rbi/dsl/active_job/queue_priority.rbi | 20 + .../test_helper/test_queue_adapter.rbi | 19 + .../dsl/active_model/attribute_methods.rbi | 28 + sorbet/rbi/dsl/active_model/attributes.rbi | 30 + sorbet/rbi/dsl/active_model/conversion.rbi | 22 + sorbet/rbi/dsl/active_model/dirty.rbi | 29 + .../rbi/dsl/active_model/serializers/json.rbi | 23 + sorbet/rbi/dsl/active_model/validations.rbi | 28 + .../active_model/validations/callbacks.rbi | 23 + .../dsl/active_record/attribute_methods.rbi | 57 + .../active_record/attribute_methods/dirty.rbi | 39 + .../attribute_methods/serialization.rbi | 20 + .../time_zone_conversion.rbi | 33 + sorbet/rbi/dsl/active_record/attributes.rbi | 20 + sorbet/rbi/dsl/active_record/callbacks.rbi | 23 + sorbet/rbi/dsl/active_record/core.rbi | 62 + .../rbi/dsl/active_record/counter_cache.rbi | 20 + .../encryption/encryptable_record.rbi | 24 + sorbet/rbi/dsl/active_record/inheritance.rbi | 28 + sorbet/rbi/dsl/active_record/integration.rbi | 33 + .../dsl/active_record/locking/optimistic.rbi | 23 + sorbet/rbi/dsl/active_record/model_schema.rbi | 53 + .../dsl/active_record/nested_attributes.rbi | 23 + .../rbi/dsl/active_record/normalization.rbi | 24 + .../dsl/active_record/readonly_attributes.rbi | 20 + sorbet/rbi/dsl/active_record/reflection.rbi | 33 + sorbet/rbi/dsl/active_record/scoping.rbi | 24 + .../rbi/dsl/active_record/scoping/default.rbi | 24 + .../rbi/dsl/active_record/secure_password.rbi | 10 + .../rbi/dsl/active_record/serialization.rbi | 23 + .../active_record/session_store/session.rbi | 1280 + sorbet/rbi/dsl/active_record/signed_id.rbi | 23 + sorbet/rbi/dsl/active_record/timestamp.rbi | 24 + sorbet/rbi/dsl/active_record/token_for.rbi | 21 + sorbet/rbi/dsl/active_record/validations.rbi | 29 + sorbet/rbi/dsl/active_storage/analyze_job.rbi | 21 + sorbet/rbi/dsl/active_storage/attachment.rbi | 1391 + sorbet/rbi/dsl/active_storage/blob.rbi | 1659 + sorbet/rbi/dsl/active_storage/current.rbi | 26 + sorbet/rbi/dsl/active_storage/mirror_job.rbi | 22 + sorbet/rbi/dsl/active_storage/purge_job.rbi | 21 + .../reflection/active_record_extensions.rbi | 23 + sorbet/rbi/dsl/active_storage/streaming.rbi | 11 + .../rbi/dsl/active_storage/transform_job.rbi | 22 + .../rbi/dsl/active_storage/variant_record.rbi | 1250 + .../dsl/active_support/actionable_error.rbi | 24 + sorbet/rbi/dsl/active_support/callbacks.rbi | 23 + sorbet/rbi/dsl/active_support/rescuable.rbi | 24 + sorbet/rbi/dsl/active_support/test_case.rbi | 10 + .../active_support/testing/file_fixtures.rbi | 23 + sorbet/rbi/dsl/api/v8/apidocs_controller.rbi | 42 + sorbet/rbi/dsl/application_controller.rbi | 42 + sorbet/rbi/dsl/assistantship.rbi | 1292 + sorbet/rbi/dsl/available_point.rbi | 1237 + sorbet/rbi/dsl/awarded_point.rbi | 1433 + sorbet/rbi/dsl/banned_email.rbi | 1173 + .../rbi/dsl/can_can/controller_additions.rbi | 24 + sorbet/rbi/dsl/certificate.rbi | 1401 + sorbet/rbi/dsl/course.rbi | 3188 + sorbet/rbi/dsl/course_notification.rbi | 1430 + sorbet/rbi/dsl/course_notification_mailer.rbi | 34 + sorbet/rbi/dsl/course_template.rbi | 1817 + sorbet/rbi/dsl/course_template_refresh.rbi | 1616 + .../rbi/dsl/course_template_refresh_phase.rbi | 1253 + .../dsl/course_template_refresh_report.rbi | 1367 + sorbet/rbi/dsl/doorkeeper/access_grant.rbi | 1559 + .../rbi/dsl/doorkeeper/access_grant_mixin.rbi | 12 + sorbet/rbi/dsl/doorkeeper/access_token.rbi | 1538 + .../rbi/dsl/doorkeeper/access_token_mixin.rbi | 13 + .../dsl/doorkeeper/application_controller.rbi | 42 + .../application_metal_controller.rbi | 12 + sorbet/rbi/dsl/exercise.rbi | 2555 + sorbet/rbi/dsl/feedback_answer.rbi | 1539 + sorbet/rbi/dsl/feedback_question.rbi | 1458 + sorbet/rbi/dsl/feedback_reply_mailer.rbi | 23 + sorbet/rbi/dsl/generated_mounted_helpers.rbi | 24 + .../rbi/dsl/generated_path_helpers_module.rbi | 779 + .../rbi/dsl/generated_url_helpers_module.rbi | 779 + sorbet/rbi/dsl/guest.rbi | 1917 + sorbet/rbi/dsl/kafka_batch_update_points.rbi | 1476 + sorbet/rbi/dsl/migrated_submissions.rbi | 1316 + sorbet/rbi/dsl/model_solution_access_log.rbi | 1389 + sorbet/rbi/dsl/model_solution_token_used.rbi | 1446 + .../dsl/new_organization_request_mailer.rbi | 16 + sorbet/rbi/dsl/organization.rbi | 2451 + sorbet/rbi/dsl/organization_membership.rbi | 1332 + sorbet/rbi/dsl/password_reset_key_mailer.rbi | 22 + .../engine/generated_path_helpers_module.rbi | 83 + .../engine/generated_url_helpers_module.rbi | 83 + sorbet/rbi/dsl/pg_hero/home_controller.rbi | 26 + .../dsl/rails/conductor/base_controller.rbi | 42 + .../rbi/dsl/recently_changed_user_detail.rbi | 1550 + sorbet/rbi/dsl/reply_to_feedback_answer.rbi | 1362 + sorbet/rbi/dsl/review.rbi | 1408 + sorbet/rbi/dsl/review_mailer.rbi | 16 + sorbet/rbi/dsl/session.rbi | 1180 + sorbet/rbi/dsl/sprockets/rails/context.rbi | 36 + sorbet/rbi/dsl/sprockets/rails/helper.rbi | 78 + sorbet/rbi/dsl/submission.rbi | 2873 + sorbet/rbi/dsl/submission_data.rbi | 1387 + sorbet/rbi/dsl/teachership.rbi | 1287 + sorbet/rbi/dsl/test_case_run.rbi | 1488 + sorbet/rbi/dsl/time.rbi | 13 + sorbet/rbi/dsl/uncomputed_unlock.rbi | 1300 + sorbet/rbi/dsl/unlock.rbi | 1321 + sorbet/rbi/dsl/user.rbi | 1917 + sorbet/rbi/dsl/user_app_datum.rbi | 1379 + sorbet/rbi/dsl/user_field_value.rbi | 1330 + sorbet/rbi/dsl/user_mailer.rbi | 25 + sorbet/rbi/dsl/verification_token.rbi | 1372 + sorbet/rbi/gems/.gitattributes | 1 + sorbet/rbi/gems/actioncable@7.1.3.4.rbi | 2913 + sorbet/rbi/gems/actionmailbox@7.1.3.4.rbi | 891 + sorbet/rbi/gems/actionmailer@7.1.3.4.rbi | 2618 + sorbet/rbi/gems/actionpack@7.1.3.4.rbi | 19203 ++++++ sorbet/rbi/gems/actiontext@7.1.3.4.rbi | 1343 + sorbet/rbi/gems/actionview@7.1.3.4.rbi | 14493 ++++ sorbet/rbi/gems/activejob@7.1.3.4.rbi | 2641 + sorbet/rbi/gems/activemodel@7.1.3.4.rbi | 6144 ++ sorbet/rbi/gems/activerecord-import@1.7.0.rbi | 619 + .../gems/activerecord-session_store@2.1.0.rbi | 459 + sorbet/rbi/gems/activerecord@7.1.3.4.rbi | 37987 +++++++++++ sorbet/rbi/gems/activestorage@7.1.3.4.rbi | 2364 + sorbet/rbi/gems/activesupport@7.1.3.4.rbi | 19202 ++++++ sorbet/rbi/gems/addressable@2.8.7.rbi | 1384 + sorbet/rbi/gems/argon2@2.3.0.rbi | 231 + sorbet/rbi/gems/ast@2.4.2.rbi | 550 + .../rbi/gems/autoprefixer-rails@10.4.16.0.rbi | 177 + sorbet/rbi/gems/base64@0.2.0.rbi | 509 + sorbet/rbi/gems/benchmark@0.5.0.rbi | 495 + sorbet/rbi/gems/bigdecimal@3.1.8.rbi | 233 + sorbet/rbi/gems/bootstrap@4.6.2.rbi | 64 + sorbet/rbi/gems/brakeman@6.1.2.rbi | 219 + sorbet/rbi/gems/builder@3.3.0.rbi | 493 + sorbet/rbi/gems/bundler-audit@0.9.1.rbi | 394 + sorbet/rbi/gems/byebug@11.1.3.rbi | 3620 + sorbet/rbi/gems/cancancan@3.6.1.rbi | 1822 + sorbet/rbi/gems/capybara@3.40.0.rbi | 8285 +++ sorbet/rbi/gems/cgi@0.3.6.rbi | 2808 + sorbet/rbi/gems/childprocess@5.0.0.rbi | 336 + sorbet/rbi/gems/cliver@0.3.2.rbi | 386 + sorbet/rbi/gems/coderay@1.1.3.rbi | 3342 + sorbet/rbi/gems/concurrent-ruby@1.3.3.rbi | 10501 +++ sorbet/rbi/gems/connection_pool@2.4.1.rbi | 256 + sorbet/rbi/gems/crass@1.0.6.rbi | 601 + sorbet/rbi/gems/daemons@1.4.1.rbi | 903 + .../database_cleaner-active_record@2.2.0.rbi | 256 + .../rbi/gems/database_cleaner-core@2.0.1.rbi | 298 + sorbet/rbi/gems/database_cleaner@2.0.2.rbi | 9 + sorbet/rbi/gems/date@3.3.4.rbi | 63 + sorbet/rbi/gems/diff-lcs@1.5.1.rbi | 1066 + sorbet/rbi/gems/docile@1.4.1.rbi | 264 + sorbet/rbi/gems/domain_name@0.6.20240107.rbi | 303 + .../gems/doorkeeper-openid_connect@1.8.9.rbi | 933 + sorbet/rbi/gems/doorkeeper@5.7.1.rbi | 4280 ++ sorbet/rbi/gems/drb@2.2.1.rbi | 1453 + sorbet/rbi/gems/erubi@1.13.0.rbi | 150 + sorbet/rbi/gems/eventmachine@1.2.7.rbi | 5636 ++ sorbet/rbi/gems/execjs@2.9.1.rbi | 399 + sorbet/rbi/gems/factory_bot@6.4.6.rbi | 1816 + sorbet/rbi/gems/factory_bot_rails@6.4.3.rbi | 139 + sorbet/rbi/gems/faraday-net_http@3.4.2.rbi | 68 + sorbet/rbi/gems/faraday@2.14.0.rbi | 3045 + sorbet/rbi/gems/ffi-compiler@1.3.2.rbi | 55 + sorbet/rbi/gems/ffi@1.17.0.rbi | 3097 + sorbet/rbi/gems/file_validators@3.0.0.rbi | 224 + .../rbi/gems/font-awesome-rails@4.7.0.8.rbi | 36 + sorbet/rbi/gems/globalid@1.2.1.rbi | 635 + sorbet/rbi/gems/gravtastic@3.2.6.rbi | 119 + sorbet/rbi/gems/hiredis@0.6.3.rbi | 65 + sorbet/rbi/gems/http-accept@1.7.0.rbi | 377 + sorbet/rbi/gems/http-cookie@1.0.6.rbi | 934 + sorbet/rbi/gems/i18n@1.14.5.rbi | 2255 + sorbet/rbi/gems/image_processing@1.13.0.rbi | 387 + sorbet/rbi/gems/io-console@0.7.2.rbi | 9 + sorbet/rbi/gems/jquery-rails@4.6.0.rbi | 30 + sorbet/rbi/gems/json-schema@4.3.1.rbi | 1243 + sorbet/rbi/gems/json@2.7.2.rbi | 1593 + sorbet/rbi/gems/jwt@2.8.2.rbi | 1253 + .../language_server-protocol@3.17.0.3.rbi | 12986 ++++ sorbet/rbi/gems/launchy@3.0.1.rbi | 585 + sorbet/rbi/gems/letter_opener@1.10.0.rbi | 138 + sorbet/rbi/gems/libv8-node@24.12.0.1.rbi | 9 + sorbet/rbi/gems/logger@1.6.0.rbi | 845 + sorbet/rbi/gems/logstasher@2.1.5.rbi | 446 + sorbet/rbi/gems/loofah@2.22.0.rbi | 1051 + sorbet/rbi/gems/mail@2.8.1.rbi | 8381 +++ sorbet/rbi/gems/marcel@1.0.4.rbi | 211 + sorbet/rbi/gems/matrix@0.4.2.rbi | 1522 + sorbet/rbi/gems/method_source@1.1.0.rbi | 293 + .../rbi/gems/mime-types-data@3.2024.0702.rbi | 34 + sorbet/rbi/gems/mime-types@3.5.2.rbi | 1188 + sorbet/rbi/gems/mimic@0.4.4.rbi | 262 + sorbet/rbi/gems/mini_magick@4.13.2.rbi | 1175 + sorbet/rbi/gems/mini_mime@1.1.5.rbi | 133 + sorbet/rbi/gems/mini_racer@0.19.2.rbi | 151 + sorbet/rbi/gems/minitest@5.24.1.rbi | 1496 + sorbet/rbi/gems/multi_json@1.15.0.rbi | 278 + sorbet/rbi/gems/mustermann@3.0.0.rbi | 2629 + sorbet/rbi/gems/mutex_m@0.2.0.rbi | 92 + sorbet/rbi/gems/natcmp@1.4.3.rbi | 56 + sorbet/rbi/gems/net-http@0.8.0.rbi | 4023 ++ sorbet/rbi/gems/net-imap@0.4.14.rbi | 10099 +++ sorbet/rbi/gems/net-pop@0.1.2.rbi | 779 + sorbet/rbi/gems/net-protocol@0.2.2.rbi | 244 + sorbet/rbi/gems/net-smtp@0.5.0.rbi | 1030 + sorbet/rbi/gems/netrc@0.11.0.rbi | 147 + sorbet/rbi/gems/newrelic_rpm@9.12.0.rbi | 14607 +++++ sorbet/rbi/gems/nio4r@2.7.3.rbi | 357 + sorbet/rbi/gems/nokogiri@1.16.7.rbi | 7192 ++ sorbet/rbi/gems/parallel@1.25.1.rbi | 253 + sorbet/rbi/gems/parser@3.3.4.0.rbi | 5127 ++ sorbet/rbi/gems/pdfkit@0.8.7.3.rbi | 300 + sorbet/rbi/gems/pg@1.5.7.rbi | 2868 + sorbet/rbi/gems/pghero@3.5.0.rbi | 1193 + sorbet/rbi/gems/plist@3.1.0.rbi | 293 + sorbet/rbi/gems/poltergeist@1.18.1.rbi | 1233 + sorbet/rbi/gems/popper_js@1.16.1.rbi | 15 + sorbet/rbi/gems/prism@1.9.0.rbi | 42172 ++++++++++++ sorbet/rbi/gems/pry-byebug@3.10.1.rbi | 501 + sorbet/rbi/gems/pry-rails@0.3.11.rbi | 176 + sorbet/rbi/gems/pry@0.14.2.rbi | 8942 +++ sorbet/rbi/gems/psych@5.1.2.rbi | 2250 + sorbet/rbi/gems/public_suffix@6.0.1.rbi | 946 + sorbet/rbi/gems/puma@6.4.2.rbi | 4223 ++ sorbet/rbi/gems/racc@1.8.0.rbi | 168 + sorbet/rbi/gems/rack-attack@6.7.0.rbi | 605 + sorbet/rbi/gems/rack-cors@2.0.2.rbi | 284 + sorbet/rbi/gems/rack-mini-profiler@3.3.1.rbi | 1538 + sorbet/rbi/gems/rack-protection@3.2.0.rbi | 846 + sorbet/rbi/gems/rack-session@1.0.2.rbi | 9 + sorbet/rbi/gems/rack-test@2.1.0.rbi | 694 + sorbet/rbi/gems/rack-timeout@0.7.0.rbi | 448 + sorbet/rbi/gems/rack@2.2.9.rbi | 5058 ++ sorbet/rbi/gems/rackup@1.0.0.rbi | 9 + sorbet/rbi/gems/railroady@1.6.0.rbi | 282 + .../gems/rails-controller-testing@1.0.5.rbi | 112 + sorbet/rbi/gems/rails-dom-testing@2.2.0.rbi | 483 + .../rbi/gems/rails-html-sanitizer@1.6.0.rbi | 617 + sorbet/rbi/gems/rails@7.1.3.4.rbi | 9 + sorbet/rbi/gems/railties@7.1.3.4.rbi | 3396 + sorbet/rbi/gems/rainbow@3.1.1.rbi | 362 + sorbet/rbi/gems/rake@13.2.1.rbi | 3031 + sorbet/rbi/gems/rbi@0.5.0.rbi | 5875 ++ sorbet/rbi/gems/rbs@4.2.0.rbi | 7094 ++ sorbet/rbi/gems/rdoc@6.7.0.rbi | 12946 ++++ sorbet/rbi/gems/readthis@2.2.0.rbi | 799 + sorbet/rbi/gems/redis@4.8.1.rbi | 5205 ++ sorbet/rbi/gems/regexp_parser@2.9.2.rbi | 3294 + sorbet/rbi/gems/reline@0.5.9.rbi | 2427 + sorbet/rbi/gems/request_store@1.7.0.rbi | 72 + sorbet/rbi/gems/require-hooks@0.5.1.rbi | 152 + sorbet/rbi/gems/responders@3.1.1.rbi | 766 + sorbet/rbi/gems/rest-client@2.1.0.rbi | 1834 + sorbet/rbi/gems/rexml@3.3.2.rbi | 4847 ++ .../gems/rspec-activemodel-mocks@1.2.0.rbi | 193 + sorbet/rbi/gems/rspec-core@3.13.0.rbi | 9715 +++ sorbet/rbi/gems/rspec-expectations@3.13.1.rbi | 6029 ++ sorbet/rbi/gems/rspec-mocks@3.13.1.rbi | 4774 ++ sorbet/rbi/gems/rspec-rails@6.1.3.rbi | 115 + sorbet/rbi/gems/rspec-support@3.13.1.rbi | 1301 + sorbet/rbi/gems/rspec@3.13.0.rbi | 15 + sorbet/rbi/gems/rubocop-ast@1.31.3.rbi | 6765 ++ sorbet/rbi/gems/rubocop-md@1.2.2.rbi | 9 + sorbet/rbi/gems/rubocop-minitest@0.35.1.rbi | 9 + sorbet/rbi/gems/rubocop-packaging@0.5.2.rbi | 9 + .../rbi/gems/rubocop-performance@1.21.1.rbi | 9 + sorbet/rbi/gems/rubocop-rails@2.25.1.rbi | 9 + .../rbi/gems/rubocop-rails_config@1.16.0.rbi | 9 + sorbet/rbi/gems/rubocop@1.65.0.rbi | 54611 ++++++++++++++++ sorbet/rbi/gems/ruby-prof@1.7.0.rbi | 1164 + sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi | 988 + sorbet/rbi/gems/ruby-vips@2.2.2.rbi | 444 + sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi | 9 + sorbet/rbi/gems/rubydex@0.4.4.rbi | 1585 + sorbet/rbi/gems/sassc-rails@2.1.2.rbi | 185 + sorbet/rbi/gems/sassc@2.4.0.rbi | 2122 + sorbet/rbi/gems/simplecov-html@0.12.3.rbi | 82 + sorbet/rbi/gems/simplecov@0.22.0.rbi | 1992 + .../gems/simplecov_json_formatter@0.1.4.rbi | 9 + sorbet/rbi/gems/sinatra@3.2.0.rbi | 1791 + sorbet/rbi/gems/spoom@1.8.13.rbi | 7380 +++ sorbet/rbi/gems/sprockets-rails@3.5.1.rbi | 486 + sorbet/rbi/gems/sprockets@4.2.1.rbi | 5456 ++ sorbet/rbi/gems/stringio@3.1.1.rbi | 9 + sorbet/rbi/gems/strscan@3.1.0.rbi | 9 + sorbet/rbi/gems/swagger-blocks@3.0.0.rbi | 509 + sorbet/rbi/gems/tapioca@0.20.0.rbi | 3756 ++ sorbet/rbi/gems/thin@1.8.2.rbi | 1874 + sorbet/rbi/gems/thor@1.3.1.rbi | 3788 ++ sorbet/rbi/gems/tilt@2.4.0.rbi | 901 + sorbet/rbi/gems/timeout@0.4.1.rbi | 138 + sorbet/rbi/gems/tsort@0.2.0.rbi | 389 + sorbet/rbi/gems/tzinfo@2.0.6.rbi | 5474 ++ sorbet/rbi/gems/uglifier@4.2.0.rbi | 219 + .../rbi/gems/unicode-display_width@2.5.0.rbi | 64 + sorbet/rbi/gems/uri@1.1.1.rbi | 2392 + sorbet/rbi/gems/webrick@1.8.1.rbi | 2703 + sorbet/rbi/gems/websocket-driver@0.7.6.rbi | 886 + .../rbi/gems/websocket-extensions@0.1.5.rbi | 109 + sorbet/rbi/gems/xml-simple@1.1.9.rbi | 459 + sorbet/rbi/gems/xpath@3.2.0.rbi | 448 + sorbet/rbi/gems/zeitwerk@2.6.16.rbi | 1229 + sorbet/rbi/shims/application_cable.rbi | 10 + sorbet/rbi/shims/gems/doorkeeper.rbi | 33 + sorbet/rbi/shims/gems/logstasher.rbi | 7 + sorbet/rbi/shims/gems/rack-cors.rbi | 6 + sorbet/rbi/shims/gems/swagger-blocks.rbi | 270 + sorbet/rbi/shims/lib_natsort.rbi | 20 + sorbet/rbi/shims/view_helpers.rbi | 181 + .../active_record_singleton_method_added.rb | 18 + .../site_setting_distribution_defaults.rb | 14 + sorbet/tapioca/require.rb | 10 + .../course_template_refresh_channel_spec.rb | 1 + .../api/v8/apidocs_controller_spec.rb | 1 + .../api/v8/base_controller_spec.rb | 1 + .../core/courses/reviews_controller_spec.rb | 11 +- .../core/courses/unlocks_controller_spec.rb | 1 + .../api/v8/core/courses_controller_spec.rb | 1 + .../exercises/solutions_controller_spec.rb | 1 + .../exercises/submissions_controller_spec.rb | 1 + .../api/v8/core/exercises_controller_spec.rb | 1 + .../organizations/courses_controller_spec.rb | 1 + .../submissions/feedback_controller_spec.rb | 1 + .../submissions/reviews_controller_spec.rb | 1 + .../v8/core/submissions_controller_spec.rb | 1 + .../all_courses_with_this_template_spec.rb | 1 + .../exercises/points_controller_spec.rb | 1 + .../exercises/users/points_controller_spec.rb | 1 + .../v8/courses/exercises_controller_spec.rb | 1 + .../api/v8/courses/points_controller_spec.rb | 1 + .../submissions/last_hour_controller_spec.rb | 1 + .../v8/courses/submissions_controller_spec.rb | 1 + .../courses/users/points_controller_spec.rb | 1 + .../users/submissions_controller_spec.rb | 1 + .../api/v8/courses_controller_spec.rb | 1 + .../api/v8/courses_mooc_fi_token_auth_spec.rb | 1 + .../exercises/points_controller_spec.rb | 1 + .../exercises/users/points_controller_spec.rb | 1 + .../courses/exercises_controller_spec.rb | 1 + .../courses/points_controller_spec.rb | 1 + .../courses/submissions_controller_spec.rb | 1 + .../courses/users/points_controller_spec.rb | 1 + .../users/submissions_controller_spec.rb | 1 + .../organizations/courses_controller_spec.rb | 1 + .../api/v8/organizations_controller_spec.rb | 1 + .../users/request_deletion_controller_spec.rb | 1 + .../api/v8/users_controller_spec.rb | 1 + spec/controllers/auths_controller_spec.rb | 1 + .../certificates_controller_spec.rb | 1 + .../course_notifications_controller_spec.rb | 1 + .../course_templates_controller_spec.rb | 1 + spec/controllers/courses_controller_spec.rb | 1 + spec/controllers/emails_controller_spec.rb | 14 + .../exercise_status_controller_spec.rb | 1 + spec/controllers/exercises_controller_spec.rb | 1 + .../feedback_answers_controller_spec.rb | 1 + .../feedback_replies_controller_spec.rb | 1 + .../organizations_controller_spec.rb | 1 + .../participants_controller_spec.rb | 1 + .../password_reset_keys_controller_spec.rb | 1 + spec/controllers/points_controller_spec.rb | 1 + spec/controllers/reviews_controller_spec.rb | 1 + spec/controllers/sessions_controller_spec.rb | 1 + .../setup/course_assistans_controller_spec.rb | 1 + .../setup/course_chooser_controller_spec.rb | 1 + .../setup/course_details_controller_spec.rb | 1 + .../setup/course_finisher_controller_spec.rb | 1 + .../setup/course_timings_controller_spec.rb | 1 + .../setup/organizations_controller_spec.rb | 1 + .../setup/start_controller_spec.rb | 1 + .../controllers/submission_controller_spec.rb | 1 + spec/controllers/teachers_controller_spec.rb | 1 + spec/controllers/users_controller_spec.rb | 1 + spec/factories.rb | 1 + ...ntrols_course_templates_visibility_spec.rb | 1 + .../admin_creates_course_templates_spec.rb | 1 + .../admin_edits_course_templates_spec.rb | 1 + ...agates_template_changes_to_courses_spec.rb | 1 + .../teacher_adds_assistants_to_course_spec.rb | 1 + .../features/teacher_adds_new_teacher_spec.rb | 1 + ...acher_creates_course_from_template_spec.rb | 1 + .../teacher_creates_organization_spec.rb | 1 + .../features/teacher_disables_courses_spec.rb | 1 + .../teacher_disables_exercises_spec.rb | 1 + .../teacher_edits_course_parameters_spec.rb | 1 + .../teacher_edits_unlock_dates_spec.rb | 1 + ..._has_admin_abilities_to_own_course_spec.rb | 1 + .../teacher_hides_submission_results_spec.rb | 1 + ...r_lists_available_course_templates_spec.rb | 1 + .../teacher_lists_json_courses_spec.rb | 1 + ...her_lists_own_organization_courses_spec.rb | 1 + spec/features/teacher_sets_deadlines_spec.rb | 1 + .../features/teacher_show_course_json_spec.rb | 1 + ...ser_lists_own_organization_courses_spec.rb | 1 + spec/features/user_views_course_list_spec.rb | 1 + .../user_views_organization_list_spec.rb | 1 + spec/helpers/course_timings_helper_spec.rb | 1 + spec/helpers/sessions_helper_spec.rb | 1 + spec/integration/admin_usecases_spec.rb | 1 + spec/integration/broken_utf8_spec.rb | 1 + spec/integration/destroying_user_spec.rb | 1 + .../feedback_question_management_spec.rb | 1 + .../feedback/viewing_feedback_spec.rb | 1 + spec/integration/paste_usecases_spec.rb | 1 + spec/integration/personal_deadlines_spec.rb | 1 + spec/integration/requests/client_spec.rb | 1 + spec/integration/requests/pastes_spec.rb | 1 + spec/integration/reset_password_spec.rb | 1 + .../dependent_source_files_spec.rb | 1 + .../integration/running_tests/general_spec.rb | 1 + .../running_tests/makefile_c_tests_spec.rb | 1 + .../running_tests/malicious_code_spec.rb | 1 + .../running_tests/maven_tests_spec.rb | 1 + .../running_tests/packages_spec.rb | 1 + spec/integration/running_tests/rerun_spec.rb | 1 + spec/integration/stats_view_usecases_spec.rb | 1 + spec/integration/student_usecases_spec.rb | 1 + spec/integration/utf8_exercise_spec.rb | 1 + .../course_refresh_database_updater_spec.rb | 32 +- spec/lib/date_and_time_utils_spec.rb | 1 + ...ercise_completion_status_generator_spec.rb | 1 + spec/lib/file_tree_hasher_spec.rb | 1 + spec/lib/safe_unzipper_spec.rb | 1 + spec/lib/sorbet_runtime_reporting_spec.rb | 41 + spec/lib/student_submission_migrator_spec.rb | 1 + .../submission_packager/java_maven_spec.rb | 1 + spec/lib/submission_processor_spec.rb | 1 + spec/lib/system_commands_spec.rb | 1 + spec/lib/test_run_grader_spec.rb | 1 + spec/lib/version_spec.rb | 1 + .../mailers/password_reset_key_mailer_spec.rb | 1 + spec/models/action_token_spec.rb | 1 + spec/models/assistantship_spec.rb | 1 + spec/models/available_point_spec.rb | 1 + spec/models/awarded_point_spec.rb | 1 + spec/models/course_spec.rb | 1 + spec/models/course_template_spec.rb | 1 + spec/models/deadline_spec_spec.rb | 1 + .../exercise/unlock_without_rows_spec.rb | 1 + .../exercise/unlocks_and_deadlines_spec.rb | 1 + spec/models/exercise_group_spec.rb | 1 + spec/models/exercise_spec.rb | 1 + spec/models/extra_field_spec.rb | 1 + .../feedback_answer_format_validator_spec.rb | 1 + spec/models/feedback_answer_spec.rb | 1 + spec/models/feedback_question_spec.rb | 1 + spec/models/organization_membership_spec.rb | 1 + spec/models/organization_spec.rb | 1 + spec/models/points_upload_queue_spec.rb | 1 + spec/models/review_spec.rb | 1 + spec/models/solution_spec.rb | 1 + spec/models/stats_spec.rb | 1 + spec/models/submission_spec.rb | 1 + spec/models/uncomputed_unlock_spec.rb | 1 + spec/models/unlock_spec.rb | 1 + spec/models/unlock_spec_spec.rb | 1 + spec/models/user_spec.rb | 1 + ...ses_mooc_fi_introspection_contract_spec.rb | 1 + ...courses_mooc_fi_token_introspector_spec.rb | 1 + spec/spec_helper.rb | 1 + spec/support/courses_mooc_fi_introspection.rb | 1 + spec/support/fixture_exercise.rb | 1 + .../fixture_exercise/makefile_c_exercise.rb | 1 + .../fixture_exercise/maven_exercise.rb | 1 + .../fixture_exercise/simple_exercise.rb | 1 + spec/support/free_ports.rb | 1 + spec/support/git_repo.rb | 1 + spec/support/git_test_actions.rb | 1 + spec/support/integration_test_actions.rb | 1 + spec/support/matchers.rb | 1 + spec/support/remote_sandbox_for_testing.rb | 1 + spec/support/root_helper.rb | 1 + .../shared_specs/orderable_spec_shared.rb | 1 + spec/support/submission_result_receiver.rb | 1 + spec/support/submission_test_setup.rb | 1 + spec/support/tmpdir_support.rb | 1 + spec/usermanual/usermanual_spec.rb | 1 + 803 files changed, 599104 insertions(+), 1342 deletions(-) delete mode 100644 app/controllers/breadcrumb_helpers.rb delete mode 100644 app/helpers/embeddable_helper.rb create mode 100755 bin/tapioca create mode 100644 config/sorbet_runtime.rb create mode 100644 sorbet/config create mode 100644 sorbet/rbi/annotations/.gitattributes create mode 100644 sorbet/rbi/annotations/actionmailer.rbi create mode 100644 sorbet/rbi/annotations/actionpack.rbi create mode 100644 sorbet/rbi/annotations/actionview.rbi create mode 100644 sorbet/rbi/annotations/activejob.rbi create mode 100644 sorbet/rbi/annotations/activemodel.rbi create mode 100644 sorbet/rbi/annotations/activerecord.rbi create mode 100644 sorbet/rbi/annotations/activesupport.rbi create mode 100644 sorbet/rbi/annotations/faraday.rbi create mode 100644 sorbet/rbi/annotations/globalid.rbi create mode 100644 sorbet/rbi/annotations/i18n.rbi create mode 100644 sorbet/rbi/annotations/minitest.rbi create mode 100644 sorbet/rbi/annotations/railties.rbi create mode 100644 sorbet/rbi/annotations/rainbow.rbi create mode 100644 sorbet/rbi/dsl/.gitattributes create mode 100644 sorbet/rbi/dsl/abstract_controller/caching.rbi create mode 100644 sorbet/rbi/dsl/abstract_controller/caching/fragments.rbi create mode 100644 sorbet/rbi/dsl/abstract_controller/callbacks.rbi create mode 100644 sorbet/rbi/dsl/abstract_controller/helpers.rbi create mode 100644 sorbet/rbi/dsl/abstract_controller/rendering.rbi create mode 100644 sorbet/rbi/dsl/abstract_controller/url_for.rbi create mode 100644 sorbet/rbi/dsl/action_cable/channel/callbacks.rbi create mode 100644 sorbet/rbi/dsl/action_cable/channel/periodic_timers.rbi create mode 100644 sorbet/rbi/dsl/action_cable/connection/callbacks.rbi create mode 100644 sorbet/rbi/dsl/action_cable/connection/identification.rbi create mode 100644 sorbet/rbi/dsl/action_controller/caching.rbi create mode 100644 sorbet/rbi/dsl/action_controller/conditional_get.rbi create mode 100644 sorbet/rbi/dsl/action_controller/content_security_policy.rbi create mode 100644 sorbet/rbi/dsl/action_controller/data_streaming.rbi create mode 100644 sorbet/rbi/dsl/action_controller/etag_with_flash.rbi create mode 100644 sorbet/rbi/dsl/action_controller/etag_with_template_digest.rbi create mode 100644 sorbet/rbi/dsl/action_controller/flash.rbi create mode 100644 sorbet/rbi/dsl/action_controller/form_builder.rbi create mode 100644 sorbet/rbi/dsl/action_controller/helpers.rbi create mode 100644 sorbet/rbi/dsl/action_controller/params_wrapper.rbi create mode 100644 sorbet/rbi/dsl/action_controller/redirecting.rbi create mode 100644 sorbet/rbi/dsl/action_controller/renderers.rbi create mode 100644 sorbet/rbi/dsl/action_controller/renderers/all.rbi create mode 100644 sorbet/rbi/dsl/action_controller/request_forgery_protection.rbi create mode 100644 sorbet/rbi/dsl/action_controller/rescue.rbi create mode 100644 sorbet/rbi/dsl/action_controller/respond_with.rbi create mode 100644 sorbet/rbi/dsl/action_controller/test_case/behavior.rbi create mode 100644 sorbet/rbi/dsl/action_controller/url_for.rbi create mode 100644 sorbet/rbi/dsl/action_dispatch/assertions.rbi create mode 100644 sorbet/rbi/dsl/action_dispatch/integration_test.rbi create mode 100644 sorbet/rbi/dsl/action_dispatch/routing/route_set/mounted_helpers.rbi create mode 100644 sorbet/rbi/dsl/action_dispatch/routing/url_for.rbi create mode 100644 sorbet/rbi/dsl/action_mailbox/inbound_email.rbi create mode 100644 sorbet/rbi/dsl/action_mailbox/incineration_job.rbi create mode 100644 sorbet/rbi/dsl/action_mailbox/routing_job.rbi create mode 100644 sorbet/rbi/dsl/action_mailer/callbacks.rbi create mode 100644 sorbet/rbi/dsl/action_mailer/delivery_methods.rbi create mode 100644 sorbet/rbi/dsl/action_mailer/form_builder.rbi create mode 100644 sorbet/rbi/dsl/action_mailer/mail_delivery_job.rbi create mode 100644 sorbet/rbi/dsl/action_mailer/queued_delivery.rbi create mode 100644 sorbet/rbi/dsl/action_mailer/rescuable.rbi create mode 100644 sorbet/rbi/dsl/action_mailer/test_case/behavior.rbi create mode 100644 sorbet/rbi/dsl/action_text/encrypted_rich_text.rbi create mode 100644 sorbet/rbi/dsl/action_text/rich_text.rbi create mode 100644 sorbet/rbi/dsl/action_token.rbi create mode 100644 sorbet/rbi/dsl/action_view/helpers.rbi create mode 100644 sorbet/rbi/dsl/action_view/helpers/form_helper.rbi create mode 100644 sorbet/rbi/dsl/action_view/helpers/form_tag_helper.rbi create mode 100644 sorbet/rbi/dsl/action_view/helpers/text_helper.rbi create mode 100644 sorbet/rbi/dsl/action_view/layouts.rbi create mode 100644 sorbet/rbi/dsl/action_view/rendering.rbi create mode 100644 sorbet/rbi/dsl/active_job/callbacks.rbi create mode 100644 sorbet/rbi/dsl/active_job/exceptions.rbi create mode 100644 sorbet/rbi/dsl/active_job/execution.rbi create mode 100644 sorbet/rbi/dsl/active_job/logging.rbi create mode 100644 sorbet/rbi/dsl/active_job/queue_adapter.rbi create mode 100644 sorbet/rbi/dsl/active_job/queue_name.rbi create mode 100644 sorbet/rbi/dsl/active_job/queue_priority.rbi create mode 100644 sorbet/rbi/dsl/active_job/test_helper/test_queue_adapter.rbi create mode 100644 sorbet/rbi/dsl/active_model/attribute_methods.rbi create mode 100644 sorbet/rbi/dsl/active_model/attributes.rbi create mode 100644 sorbet/rbi/dsl/active_model/conversion.rbi create mode 100644 sorbet/rbi/dsl/active_model/dirty.rbi create mode 100644 sorbet/rbi/dsl/active_model/serializers/json.rbi create mode 100644 sorbet/rbi/dsl/active_model/validations.rbi create mode 100644 sorbet/rbi/dsl/active_model/validations/callbacks.rbi create mode 100644 sorbet/rbi/dsl/active_record/attribute_methods.rbi create mode 100644 sorbet/rbi/dsl/active_record/attribute_methods/dirty.rbi create mode 100644 sorbet/rbi/dsl/active_record/attribute_methods/serialization.rbi create mode 100644 sorbet/rbi/dsl/active_record/attribute_methods/time_zone_conversion.rbi create mode 100644 sorbet/rbi/dsl/active_record/attributes.rbi create mode 100644 sorbet/rbi/dsl/active_record/callbacks.rbi create mode 100644 sorbet/rbi/dsl/active_record/core.rbi create mode 100644 sorbet/rbi/dsl/active_record/counter_cache.rbi create mode 100644 sorbet/rbi/dsl/active_record/encryption/encryptable_record.rbi create mode 100644 sorbet/rbi/dsl/active_record/inheritance.rbi create mode 100644 sorbet/rbi/dsl/active_record/integration.rbi create mode 100644 sorbet/rbi/dsl/active_record/locking/optimistic.rbi create mode 100644 sorbet/rbi/dsl/active_record/model_schema.rbi create mode 100644 sorbet/rbi/dsl/active_record/nested_attributes.rbi create mode 100644 sorbet/rbi/dsl/active_record/normalization.rbi create mode 100644 sorbet/rbi/dsl/active_record/readonly_attributes.rbi create mode 100644 sorbet/rbi/dsl/active_record/reflection.rbi create mode 100644 sorbet/rbi/dsl/active_record/scoping.rbi create mode 100644 sorbet/rbi/dsl/active_record/scoping/default.rbi create mode 100644 sorbet/rbi/dsl/active_record/secure_password.rbi create mode 100644 sorbet/rbi/dsl/active_record/serialization.rbi create mode 100644 sorbet/rbi/dsl/active_record/session_store/session.rbi create mode 100644 sorbet/rbi/dsl/active_record/signed_id.rbi create mode 100644 sorbet/rbi/dsl/active_record/timestamp.rbi create mode 100644 sorbet/rbi/dsl/active_record/token_for.rbi create mode 100644 sorbet/rbi/dsl/active_record/validations.rbi create mode 100644 sorbet/rbi/dsl/active_storage/analyze_job.rbi create mode 100644 sorbet/rbi/dsl/active_storage/attachment.rbi create mode 100644 sorbet/rbi/dsl/active_storage/blob.rbi create mode 100644 sorbet/rbi/dsl/active_storage/current.rbi create mode 100644 sorbet/rbi/dsl/active_storage/mirror_job.rbi create mode 100644 sorbet/rbi/dsl/active_storage/purge_job.rbi create mode 100644 sorbet/rbi/dsl/active_storage/reflection/active_record_extensions.rbi create mode 100644 sorbet/rbi/dsl/active_storage/streaming.rbi create mode 100644 sorbet/rbi/dsl/active_storage/transform_job.rbi create mode 100644 sorbet/rbi/dsl/active_storage/variant_record.rbi create mode 100644 sorbet/rbi/dsl/active_support/actionable_error.rbi create mode 100644 sorbet/rbi/dsl/active_support/callbacks.rbi create mode 100644 sorbet/rbi/dsl/active_support/rescuable.rbi create mode 100644 sorbet/rbi/dsl/active_support/test_case.rbi create mode 100644 sorbet/rbi/dsl/active_support/testing/file_fixtures.rbi create mode 100644 sorbet/rbi/dsl/api/v8/apidocs_controller.rbi create mode 100644 sorbet/rbi/dsl/application_controller.rbi create mode 100644 sorbet/rbi/dsl/assistantship.rbi create mode 100644 sorbet/rbi/dsl/available_point.rbi create mode 100644 sorbet/rbi/dsl/awarded_point.rbi create mode 100644 sorbet/rbi/dsl/banned_email.rbi create mode 100644 sorbet/rbi/dsl/can_can/controller_additions.rbi create mode 100644 sorbet/rbi/dsl/certificate.rbi create mode 100644 sorbet/rbi/dsl/course.rbi create mode 100644 sorbet/rbi/dsl/course_notification.rbi create mode 100644 sorbet/rbi/dsl/course_notification_mailer.rbi create mode 100644 sorbet/rbi/dsl/course_template.rbi create mode 100644 sorbet/rbi/dsl/course_template_refresh.rbi create mode 100644 sorbet/rbi/dsl/course_template_refresh_phase.rbi create mode 100644 sorbet/rbi/dsl/course_template_refresh_report.rbi create mode 100644 sorbet/rbi/dsl/doorkeeper/access_grant.rbi create mode 100644 sorbet/rbi/dsl/doorkeeper/access_grant_mixin.rbi create mode 100644 sorbet/rbi/dsl/doorkeeper/access_token.rbi create mode 100644 sorbet/rbi/dsl/doorkeeper/access_token_mixin.rbi create mode 100644 sorbet/rbi/dsl/doorkeeper/application_controller.rbi create mode 100644 sorbet/rbi/dsl/doorkeeper/application_metal_controller.rbi create mode 100644 sorbet/rbi/dsl/exercise.rbi create mode 100644 sorbet/rbi/dsl/feedback_answer.rbi create mode 100644 sorbet/rbi/dsl/feedback_question.rbi create mode 100644 sorbet/rbi/dsl/feedback_reply_mailer.rbi create mode 100644 sorbet/rbi/dsl/generated_mounted_helpers.rbi create mode 100644 sorbet/rbi/dsl/generated_path_helpers_module.rbi create mode 100644 sorbet/rbi/dsl/generated_url_helpers_module.rbi create mode 100644 sorbet/rbi/dsl/guest.rbi create mode 100644 sorbet/rbi/dsl/kafka_batch_update_points.rbi create mode 100644 sorbet/rbi/dsl/migrated_submissions.rbi create mode 100644 sorbet/rbi/dsl/model_solution_access_log.rbi create mode 100644 sorbet/rbi/dsl/model_solution_token_used.rbi create mode 100644 sorbet/rbi/dsl/new_organization_request_mailer.rbi create mode 100644 sorbet/rbi/dsl/organization.rbi create mode 100644 sorbet/rbi/dsl/organization_membership.rbi create mode 100644 sorbet/rbi/dsl/password_reset_key_mailer.rbi create mode 100644 sorbet/rbi/dsl/pg_hero/engine/generated_path_helpers_module.rbi create mode 100644 sorbet/rbi/dsl/pg_hero/engine/generated_url_helpers_module.rbi create mode 100644 sorbet/rbi/dsl/pg_hero/home_controller.rbi create mode 100644 sorbet/rbi/dsl/rails/conductor/base_controller.rbi create mode 100644 sorbet/rbi/dsl/recently_changed_user_detail.rbi create mode 100644 sorbet/rbi/dsl/reply_to_feedback_answer.rbi create mode 100644 sorbet/rbi/dsl/review.rbi create mode 100644 sorbet/rbi/dsl/review_mailer.rbi create mode 100644 sorbet/rbi/dsl/session.rbi create mode 100644 sorbet/rbi/dsl/sprockets/rails/context.rbi create mode 100644 sorbet/rbi/dsl/sprockets/rails/helper.rbi create mode 100644 sorbet/rbi/dsl/submission.rbi create mode 100644 sorbet/rbi/dsl/submission_data.rbi create mode 100644 sorbet/rbi/dsl/teachership.rbi create mode 100644 sorbet/rbi/dsl/test_case_run.rbi create mode 100644 sorbet/rbi/dsl/time.rbi create mode 100644 sorbet/rbi/dsl/uncomputed_unlock.rbi create mode 100644 sorbet/rbi/dsl/unlock.rbi create mode 100644 sorbet/rbi/dsl/user.rbi create mode 100644 sorbet/rbi/dsl/user_app_datum.rbi create mode 100644 sorbet/rbi/dsl/user_field_value.rbi create mode 100644 sorbet/rbi/dsl/user_mailer.rbi create mode 100644 sorbet/rbi/dsl/verification_token.rbi create mode 100644 sorbet/rbi/gems/.gitattributes create mode 100644 sorbet/rbi/gems/actioncable@7.1.3.4.rbi create mode 100644 sorbet/rbi/gems/actionmailbox@7.1.3.4.rbi create mode 100644 sorbet/rbi/gems/actionmailer@7.1.3.4.rbi create mode 100644 sorbet/rbi/gems/actionpack@7.1.3.4.rbi create mode 100644 sorbet/rbi/gems/actiontext@7.1.3.4.rbi create mode 100644 sorbet/rbi/gems/actionview@7.1.3.4.rbi create mode 100644 sorbet/rbi/gems/activejob@7.1.3.4.rbi create mode 100644 sorbet/rbi/gems/activemodel@7.1.3.4.rbi create mode 100644 sorbet/rbi/gems/activerecord-import@1.7.0.rbi create mode 100644 sorbet/rbi/gems/activerecord-session_store@2.1.0.rbi create mode 100644 sorbet/rbi/gems/activerecord@7.1.3.4.rbi create mode 100644 sorbet/rbi/gems/activestorage@7.1.3.4.rbi create mode 100644 sorbet/rbi/gems/activesupport@7.1.3.4.rbi create mode 100644 sorbet/rbi/gems/addressable@2.8.7.rbi create mode 100644 sorbet/rbi/gems/argon2@2.3.0.rbi create mode 100644 sorbet/rbi/gems/ast@2.4.2.rbi create mode 100644 sorbet/rbi/gems/autoprefixer-rails@10.4.16.0.rbi create mode 100644 sorbet/rbi/gems/base64@0.2.0.rbi create mode 100644 sorbet/rbi/gems/benchmark@0.5.0.rbi create mode 100644 sorbet/rbi/gems/bigdecimal@3.1.8.rbi create mode 100644 sorbet/rbi/gems/bootstrap@4.6.2.rbi create mode 100644 sorbet/rbi/gems/brakeman@6.1.2.rbi create mode 100644 sorbet/rbi/gems/builder@3.3.0.rbi create mode 100644 sorbet/rbi/gems/bundler-audit@0.9.1.rbi create mode 100644 sorbet/rbi/gems/byebug@11.1.3.rbi create mode 100644 sorbet/rbi/gems/cancancan@3.6.1.rbi create mode 100644 sorbet/rbi/gems/capybara@3.40.0.rbi create mode 100644 sorbet/rbi/gems/cgi@0.3.6.rbi create mode 100644 sorbet/rbi/gems/childprocess@5.0.0.rbi create mode 100644 sorbet/rbi/gems/cliver@0.3.2.rbi create mode 100644 sorbet/rbi/gems/coderay@1.1.3.rbi create mode 100644 sorbet/rbi/gems/concurrent-ruby@1.3.3.rbi create mode 100644 sorbet/rbi/gems/connection_pool@2.4.1.rbi create mode 100644 sorbet/rbi/gems/crass@1.0.6.rbi create mode 100644 sorbet/rbi/gems/daemons@1.4.1.rbi create mode 100644 sorbet/rbi/gems/database_cleaner-active_record@2.2.0.rbi create mode 100644 sorbet/rbi/gems/database_cleaner-core@2.0.1.rbi create mode 100644 sorbet/rbi/gems/database_cleaner@2.0.2.rbi create mode 100644 sorbet/rbi/gems/date@3.3.4.rbi create mode 100644 sorbet/rbi/gems/diff-lcs@1.5.1.rbi create mode 100644 sorbet/rbi/gems/docile@1.4.1.rbi create mode 100644 sorbet/rbi/gems/domain_name@0.6.20240107.rbi create mode 100644 sorbet/rbi/gems/doorkeeper-openid_connect@1.8.9.rbi create mode 100644 sorbet/rbi/gems/doorkeeper@5.7.1.rbi create mode 100644 sorbet/rbi/gems/drb@2.2.1.rbi create mode 100644 sorbet/rbi/gems/erubi@1.13.0.rbi create mode 100644 sorbet/rbi/gems/eventmachine@1.2.7.rbi create mode 100644 sorbet/rbi/gems/execjs@2.9.1.rbi create mode 100644 sorbet/rbi/gems/factory_bot@6.4.6.rbi create mode 100644 sorbet/rbi/gems/factory_bot_rails@6.4.3.rbi create mode 100644 sorbet/rbi/gems/faraday-net_http@3.4.2.rbi create mode 100644 sorbet/rbi/gems/faraday@2.14.0.rbi create mode 100644 sorbet/rbi/gems/ffi-compiler@1.3.2.rbi create mode 100644 sorbet/rbi/gems/ffi@1.17.0.rbi create mode 100644 sorbet/rbi/gems/file_validators@3.0.0.rbi create mode 100644 sorbet/rbi/gems/font-awesome-rails@4.7.0.8.rbi create mode 100644 sorbet/rbi/gems/globalid@1.2.1.rbi create mode 100644 sorbet/rbi/gems/gravtastic@3.2.6.rbi create mode 100644 sorbet/rbi/gems/hiredis@0.6.3.rbi create mode 100644 sorbet/rbi/gems/http-accept@1.7.0.rbi create mode 100644 sorbet/rbi/gems/http-cookie@1.0.6.rbi create mode 100644 sorbet/rbi/gems/i18n@1.14.5.rbi create mode 100644 sorbet/rbi/gems/image_processing@1.13.0.rbi create mode 100644 sorbet/rbi/gems/io-console@0.7.2.rbi create mode 100644 sorbet/rbi/gems/jquery-rails@4.6.0.rbi create mode 100644 sorbet/rbi/gems/json-schema@4.3.1.rbi create mode 100644 sorbet/rbi/gems/json@2.7.2.rbi create mode 100644 sorbet/rbi/gems/jwt@2.8.2.rbi create mode 100644 sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi create mode 100644 sorbet/rbi/gems/launchy@3.0.1.rbi create mode 100644 sorbet/rbi/gems/letter_opener@1.10.0.rbi create mode 100644 sorbet/rbi/gems/libv8-node@24.12.0.1.rbi create mode 100644 sorbet/rbi/gems/logger@1.6.0.rbi create mode 100644 sorbet/rbi/gems/logstasher@2.1.5.rbi create mode 100644 sorbet/rbi/gems/loofah@2.22.0.rbi create mode 100644 sorbet/rbi/gems/mail@2.8.1.rbi create mode 100644 sorbet/rbi/gems/marcel@1.0.4.rbi create mode 100644 sorbet/rbi/gems/matrix@0.4.2.rbi create mode 100644 sorbet/rbi/gems/method_source@1.1.0.rbi create mode 100644 sorbet/rbi/gems/mime-types-data@3.2024.0702.rbi create mode 100644 sorbet/rbi/gems/mime-types@3.5.2.rbi create mode 100644 sorbet/rbi/gems/mimic@0.4.4.rbi create mode 100644 sorbet/rbi/gems/mini_magick@4.13.2.rbi create mode 100644 sorbet/rbi/gems/mini_mime@1.1.5.rbi create mode 100644 sorbet/rbi/gems/mini_racer@0.19.2.rbi create mode 100644 sorbet/rbi/gems/minitest@5.24.1.rbi create mode 100644 sorbet/rbi/gems/multi_json@1.15.0.rbi create mode 100644 sorbet/rbi/gems/mustermann@3.0.0.rbi create mode 100644 sorbet/rbi/gems/mutex_m@0.2.0.rbi create mode 100644 sorbet/rbi/gems/natcmp@1.4.3.rbi create mode 100644 sorbet/rbi/gems/net-http@0.8.0.rbi create mode 100644 sorbet/rbi/gems/net-imap@0.4.14.rbi create mode 100644 sorbet/rbi/gems/net-pop@0.1.2.rbi create mode 100644 sorbet/rbi/gems/net-protocol@0.2.2.rbi create mode 100644 sorbet/rbi/gems/net-smtp@0.5.0.rbi create mode 100644 sorbet/rbi/gems/netrc@0.11.0.rbi create mode 100644 sorbet/rbi/gems/newrelic_rpm@9.12.0.rbi create mode 100644 sorbet/rbi/gems/nio4r@2.7.3.rbi create mode 100644 sorbet/rbi/gems/nokogiri@1.16.7.rbi create mode 100644 sorbet/rbi/gems/parallel@1.25.1.rbi create mode 100644 sorbet/rbi/gems/parser@3.3.4.0.rbi create mode 100644 sorbet/rbi/gems/pdfkit@0.8.7.3.rbi create mode 100644 sorbet/rbi/gems/pg@1.5.7.rbi create mode 100644 sorbet/rbi/gems/pghero@3.5.0.rbi create mode 100644 sorbet/rbi/gems/plist@3.1.0.rbi create mode 100644 sorbet/rbi/gems/poltergeist@1.18.1.rbi create mode 100644 sorbet/rbi/gems/popper_js@1.16.1.rbi create mode 100644 sorbet/rbi/gems/prism@1.9.0.rbi create mode 100644 sorbet/rbi/gems/pry-byebug@3.10.1.rbi create mode 100644 sorbet/rbi/gems/pry-rails@0.3.11.rbi create mode 100644 sorbet/rbi/gems/pry@0.14.2.rbi create mode 100644 sorbet/rbi/gems/psych@5.1.2.rbi create mode 100644 sorbet/rbi/gems/public_suffix@6.0.1.rbi create mode 100644 sorbet/rbi/gems/puma@6.4.2.rbi create mode 100644 sorbet/rbi/gems/racc@1.8.0.rbi create mode 100644 sorbet/rbi/gems/rack-attack@6.7.0.rbi create mode 100644 sorbet/rbi/gems/rack-cors@2.0.2.rbi create mode 100644 sorbet/rbi/gems/rack-mini-profiler@3.3.1.rbi create mode 100644 sorbet/rbi/gems/rack-protection@3.2.0.rbi create mode 100644 sorbet/rbi/gems/rack-session@1.0.2.rbi create mode 100644 sorbet/rbi/gems/rack-test@2.1.0.rbi create mode 100644 sorbet/rbi/gems/rack-timeout@0.7.0.rbi create mode 100644 sorbet/rbi/gems/rack@2.2.9.rbi create mode 100644 sorbet/rbi/gems/rackup@1.0.0.rbi create mode 100644 sorbet/rbi/gems/railroady@1.6.0.rbi create mode 100644 sorbet/rbi/gems/rails-controller-testing@1.0.5.rbi create mode 100644 sorbet/rbi/gems/rails-dom-testing@2.2.0.rbi create mode 100644 sorbet/rbi/gems/rails-html-sanitizer@1.6.0.rbi create mode 100644 sorbet/rbi/gems/rails@7.1.3.4.rbi create mode 100644 sorbet/rbi/gems/railties@7.1.3.4.rbi create mode 100644 sorbet/rbi/gems/rainbow@3.1.1.rbi create mode 100644 sorbet/rbi/gems/rake@13.2.1.rbi create mode 100644 sorbet/rbi/gems/rbi@0.5.0.rbi create mode 100644 sorbet/rbi/gems/rbs@4.2.0.rbi create mode 100644 sorbet/rbi/gems/rdoc@6.7.0.rbi create mode 100644 sorbet/rbi/gems/readthis@2.2.0.rbi create mode 100644 sorbet/rbi/gems/redis@4.8.1.rbi create mode 100644 sorbet/rbi/gems/regexp_parser@2.9.2.rbi create mode 100644 sorbet/rbi/gems/reline@0.5.9.rbi create mode 100644 sorbet/rbi/gems/request_store@1.7.0.rbi create mode 100644 sorbet/rbi/gems/require-hooks@0.5.1.rbi create mode 100644 sorbet/rbi/gems/responders@3.1.1.rbi create mode 100644 sorbet/rbi/gems/rest-client@2.1.0.rbi create mode 100644 sorbet/rbi/gems/rexml@3.3.2.rbi create mode 100644 sorbet/rbi/gems/rspec-activemodel-mocks@1.2.0.rbi create mode 100644 sorbet/rbi/gems/rspec-core@3.13.0.rbi create mode 100644 sorbet/rbi/gems/rspec-expectations@3.13.1.rbi create mode 100644 sorbet/rbi/gems/rspec-mocks@3.13.1.rbi create mode 100644 sorbet/rbi/gems/rspec-rails@6.1.3.rbi create mode 100644 sorbet/rbi/gems/rspec-support@3.13.1.rbi create mode 100644 sorbet/rbi/gems/rspec@3.13.0.rbi create mode 100644 sorbet/rbi/gems/rubocop-ast@1.31.3.rbi create mode 100644 sorbet/rbi/gems/rubocop-md@1.2.2.rbi create mode 100644 sorbet/rbi/gems/rubocop-minitest@0.35.1.rbi create mode 100644 sorbet/rbi/gems/rubocop-packaging@0.5.2.rbi create mode 100644 sorbet/rbi/gems/rubocop-performance@1.21.1.rbi create mode 100644 sorbet/rbi/gems/rubocop-rails@2.25.1.rbi create mode 100644 sorbet/rbi/gems/rubocop-rails_config@1.16.0.rbi create mode 100644 sorbet/rbi/gems/rubocop@1.65.0.rbi create mode 100644 sorbet/rbi/gems/ruby-prof@1.7.0.rbi create mode 100644 sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi create mode 100644 sorbet/rbi/gems/ruby-vips@2.2.2.rbi create mode 100644 sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi create mode 100644 sorbet/rbi/gems/rubydex@0.4.4.rbi create mode 100644 sorbet/rbi/gems/sassc-rails@2.1.2.rbi create mode 100644 sorbet/rbi/gems/sassc@2.4.0.rbi create mode 100644 sorbet/rbi/gems/simplecov-html@0.12.3.rbi create mode 100644 sorbet/rbi/gems/simplecov@0.22.0.rbi create mode 100644 sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi create mode 100644 sorbet/rbi/gems/sinatra@3.2.0.rbi create mode 100644 sorbet/rbi/gems/spoom@1.8.13.rbi create mode 100644 sorbet/rbi/gems/sprockets-rails@3.5.1.rbi create mode 100644 sorbet/rbi/gems/sprockets@4.2.1.rbi create mode 100644 sorbet/rbi/gems/stringio@3.1.1.rbi create mode 100644 sorbet/rbi/gems/strscan@3.1.0.rbi create mode 100644 sorbet/rbi/gems/swagger-blocks@3.0.0.rbi create mode 100644 sorbet/rbi/gems/tapioca@0.20.0.rbi create mode 100644 sorbet/rbi/gems/thin@1.8.2.rbi create mode 100644 sorbet/rbi/gems/thor@1.3.1.rbi create mode 100644 sorbet/rbi/gems/tilt@2.4.0.rbi create mode 100644 sorbet/rbi/gems/timeout@0.4.1.rbi create mode 100644 sorbet/rbi/gems/tsort@0.2.0.rbi create mode 100644 sorbet/rbi/gems/tzinfo@2.0.6.rbi create mode 100644 sorbet/rbi/gems/uglifier@4.2.0.rbi create mode 100644 sorbet/rbi/gems/unicode-display_width@2.5.0.rbi create mode 100644 sorbet/rbi/gems/uri@1.1.1.rbi create mode 100644 sorbet/rbi/gems/webrick@1.8.1.rbi create mode 100644 sorbet/rbi/gems/websocket-driver@0.7.6.rbi create mode 100644 sorbet/rbi/gems/websocket-extensions@0.1.5.rbi create mode 100644 sorbet/rbi/gems/xml-simple@1.1.9.rbi create mode 100644 sorbet/rbi/gems/xpath@3.2.0.rbi create mode 100644 sorbet/rbi/gems/zeitwerk@2.6.16.rbi create mode 100644 sorbet/rbi/shims/application_cable.rbi create mode 100644 sorbet/rbi/shims/gems/doorkeeper.rbi create mode 100644 sorbet/rbi/shims/gems/logstasher.rbi create mode 100644 sorbet/rbi/shims/gems/rack-cors.rbi create mode 100644 sorbet/rbi/shims/gems/swagger-blocks.rbi create mode 100644 sorbet/rbi/shims/lib_natsort.rbi create mode 100644 sorbet/rbi/shims/view_helpers.rbi create mode 100644 sorbet/tapioca/extensions/active_record_singleton_method_added.rb create mode 100644 sorbet/tapioca/extensions/site_setting_distribution_defaults.rb create mode 100644 sorbet/tapioca/require.rb create mode 100644 spec/lib/sorbet_runtime_reporting_spec.rb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f359a147..5899939c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,40 @@ on: branches: [ master, bs4 ] workflow_dispatch: jobs: + sorbet: + runs-on: ubuntu-latest + services: + postgres: + image: postgres:16 + env: + POSTGRES_HOST_AUTH_METHOD: trust + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + RAILS_ENV: development + DATABASE_URL: postgres://postgres@localhost:5432/tmc-sorbet + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + bundler-cache: true + - name: Type check + run: bundle exec srb tc + - name: Verify gem RBIs + run: bin/tapioca gem --verify + - name: Load database schema + run: bin/rake db:create db:schema:load + - name: Verify DSL RBIs + run: bin/tapioca dsl --verify + spec_v8: runs-on: ubuntu-latest steps: diff --git a/Gemfile b/Gemfile index 483ac3252..48a203b15 100644 --- a/Gemfile +++ b/Gemfile @@ -36,6 +36,7 @@ gem 'swagger-blocks', '~> 3.0' gem 'sassc-rails', '~> 2.1', '>= 2.1.2' gem 'xml-simple', '~> 1.1', '>= 1.1.9', require: false gem 'cgi', '~> 0.3.6' +gem 'sorbet-runtime', '~> 0.6.13640' gem 'hiredis', '~> 0.6.3' # Redis for caching gem 'readthis', '~> 2.2' # Redis for caching @@ -75,6 +76,9 @@ group :development, :test do gem 'rubocop-rails_config', '~> 1.16' # Rubocop locked gem 'ruby-prof', '~> 1.7' # for performance tests gem 'simplecov', '~> 0.22.0', require: false + gem 'sorbet', '~> 0.6.13640', require: false + gem 'spoom', '~> 1.8', require: false + gem 'tapioca', '~> 0.20.0', require: false end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 46ed5c02e..116394222 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -93,6 +93,7 @@ GEM autoprefixer-rails (10.4.16.0) execjs (~> 2) base64 (0.2.0) + benchmark (0.5.0) bigdecimal (3.1.8) bootstrap (4.6.2) autoprefixer-rails (>= 9.1.0) @@ -283,6 +284,7 @@ GEM cliver (~> 0.3.1) websocket-driver (>= 0.2.0) popper_js (1.16.1) + prism (1.9.0) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) @@ -351,6 +353,13 @@ GEM zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) + rbi (0.5.0) + prism (~> 1.0) + rbs (>= 4.0.1) + rbs (4.2.0) + logger + prism (>= 1.6.0) + tsort rdoc (6.7.0) psych (>= 4.0.0) readthis (2.2.0) @@ -362,6 +371,7 @@ GEM io-console (~> 0.5) request_store (1.7.0) rack (>= 1.4) + require-hooks (0.5.1) responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) @@ -439,6 +449,11 @@ GEM ffi (~> 1.12) logger ruby2_keywords (0.0.5) + rubydex (0.4.4) + rubydex (0.4.4-aarch64-linux) + rubydex (0.4.4-arm64-darwin) + rubydex (0.4.4-x86_64-darwin) + rubydex (0.4.4-x86_64-linux) sassc (2.4.0) ffi (~> 1.9) sassc-rails (2.1.2) @@ -458,6 +473,23 @@ GEM rack (~> 2.2, >= 2.2.4) rack-protection (= 3.2.0) tilt (~> 2.0) + sorbet (0.6.13640) + sorbet-static (= 0.6.13640) + sorbet-runtime (0.6.13640) + sorbet-static (0.6.13640-aarch64-linux) + sorbet-static (0.6.13640-universal-darwin) + sorbet-static (0.6.13640-x86_64-linux) + sorbet-static-and-runtime (0.6.13640) + sorbet (= 0.6.13640) + sorbet-runtime (= 0.6.13640) + spoom (1.8.13) + erubi (>= 1.10.0) + prism (>= 0.28.0) + rbi (>= 0.4.2) + rbs (>= 4.0.0.dev.5) + rexml (>= 3.2.6) + sorbet-static-and-runtime (>= 0.5.10187) + thor (>= 0.19.2) sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) @@ -468,6 +500,18 @@ GEM stringio (3.1.1) strscan (3.1.0) swagger-blocks (3.0.0) + tapioca (0.20.0) + benchmark + bundler (>= 2.2.25) + netrc (>= 0.11.0) + parallel (>= 1.21.0) + rbi (>= 0.4.1) + require-hooks (>= 0.2.2) + rubydex (>= 0.1.0.beta10) + sorbet-static-and-runtime (>= 0.6.12698) + spoom (>= 1.7.16) + thor (>= 1.2.0) + tsort thin (1.8.2) daemons (~> 1.0, >= 1.0.9) eventmachine (~> 1.0, >= 1.0.4) @@ -475,6 +519,7 @@ GEM thor (1.3.1) tilt (2.4.0) timeout (0.4.1) + tsort (0.2.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) uglifier (4.2.0) @@ -565,8 +610,12 @@ DEPENDENCIES ruby-prof (~> 1.7) sassc-rails (~> 2.1, >= 2.1.2) simplecov (~> 0.22.0) + sorbet (~> 0.6.13640) + sorbet-runtime (~> 0.6.13640) + spoom (~> 1.8) sprockets-rails (~> 3.5, >= 3.5.1) swagger-blocks (~> 3.0) + tapioca (~> 0.20.0) thin (~> 1.8, >= 1.8.2) uglifier (~> 4.2) xml-simple (~> 1.1, >= 1.1.9) diff --git a/app/background_tasks/kafka_batch_update_points_task.rb b/app/background_tasks/kafka_batch_update_points_task.rb index f902811da..d0fc479ad 100644 --- a/app/background_tasks/kafka_batch_update_points_task.rb +++ b/app/background_tasks/kafka_batch_update_points_task.rb @@ -1,15 +1,19 @@ +# typed: strict # frozen_string_literal: true require 'kafka_updater' class KafkaBatchUpdatePointsTask + extend T::Sig + sig { void } def initialize - @kafka_bridge_url = SiteSetting.value('kafka_bridge_url') - @kafka_bridge_secret = SiteSetting.value('kafka_bridge_secret') - @service_id = SiteSetting.value('moocfi_service_id') - @updater = KafkaUpdater.new(@kafka_bridge_url, @kafka_bridge_secret, @service_id) + @kafka_bridge_url = T.let(SiteSetting.value('kafka_bridge_url'), T.nilable(String)) + @kafka_bridge_secret = T.let(SiteSetting.value('kafka_bridge_secret'), T.nilable(String)) + @service_id = T.let(SiteSetting.value('moocfi_service_id'), T.nilable(String)) + @updater = T.let(KafkaUpdater.new(@kafka_bridge_url, @kafka_bridge_secret, @service_id), KafkaUpdater) end + sig { void } def run return unless @kafka_bridge_url && @kafka_bridge_secret && @service_id return if @kafka_bridge_url.empty? || @kafka_bridge_secret.empty? || @service_id.empty? @@ -35,12 +39,14 @@ def run end rescue => e Rails.logger.error("Task failed: #{e.class.name}: #{e.message}") - Rails.logger.error("Task failed backtrace: #{e.backtrace.join("\n")}") if e.backtrace + backtrace = e.backtrace + Rails.logger.error("Task failed backtrace: #{backtrace.join("\n")}") if backtrace end task.destroy! if finished_successfully end end + sig { returns(Integer) } def wait_delay 5 end diff --git a/app/background_tasks/kafka_realtime_update_points_task.rb b/app/background_tasks/kafka_realtime_update_points_task.rb index 4b18631c6..472e9e4db 100644 --- a/app/background_tasks/kafka_realtime_update_points_task.rb +++ b/app/background_tasks/kafka_realtime_update_points_task.rb @@ -1,15 +1,19 @@ +# typed: strict # frozen_string_literal: true require 'kafka_updater' class KafkaRealtimeUpdatePointsTask + extend T::Sig + sig { void } def initialize - @kafka_bridge_url = SiteSetting.value('kafka_bridge_url') - @kafka_bridge_secret = SiteSetting.value('kafka_bridge_secret') - @service_id = SiteSetting.value('moocfi_service_id') - @updater = KafkaUpdater.new(@kafka_bridge_url, @kafka_bridge_secret, @service_id) + @kafka_bridge_url = T.let(SiteSetting.value('kafka_bridge_url'), T.nilable(String)) + @kafka_bridge_secret = T.let(SiteSetting.value('kafka_bridge_secret'), T.nilable(String)) + @service_id = T.let(SiteSetting.value('moocfi_service_id'), T.nilable(String)) + @updater = T.let(KafkaUpdater.new(@kafka_bridge_url, @kafka_bridge_secret, @service_id), KafkaUpdater) end + sig { void } def run return unless @kafka_bridge_url && @kafka_bridge_secret && @service_id return if @kafka_bridge_url.empty? || @kafka_bridge_secret.empty? || @service_id.empty? @@ -35,12 +39,14 @@ def run end rescue => e Rails.logger.error("Task failed: #{e.class.name}: #{e.message}") - Rails.logger.error("Task failed backtrace: #{e.backtrace.join("\n")}") if e.backtrace + backtrace = e.backtrace + Rails.logger.error("Task failed backtrace: #{backtrace.join("\n")}") if backtrace end task.destroy! if finished_successfully end end + sig { returns(Integer) } def wait_delay 5 end diff --git a/app/background_tasks/refresh_course_task.rb b/app/background_tasks/refresh_course_task.rb index 230194e1d..f9ee3252f 100644 --- a/app/background_tasks/refresh_course_task.rb +++ b/app/background_tasks/refresh_course_task.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'rust_langs_cli_executor' @@ -5,9 +6,12 @@ require 'course_refresh_database_updater' class RefreshCourseTask + extend T::Sig + sig { void } def initialize end + sig { void } def run CourseTemplateRefresh.where(status: :not_started).each do |task| channel_id = task.course_template_id @@ -23,45 +27,47 @@ def run broadcast_to_channel(channel_id, 'Updating database', 0.95, '-') # Should we do this loop in CourseRefreshDatabaseUpdater? - courses.each do |course| - @refresh = CourseRefreshDatabaseUpdater.new.refresh_course(course, rust_output) - end + refresh = courses.map { |course| CourseRefreshDatabaseUpdater.new.refresh_course(course, rust_output) }.last broadcast_to_channel(channel_id, 'Generating refresh report', 0.98, '-') - CourseTemplateRefreshReport.create(course_template_refresh_id: task.id, refresh_errors: @refresh.errors, refresh_warnings: @refresh.warnings, refresh_notices: @refresh.notices, refresh_timings: @refresh.timings) + raise 'Template has no courses' unless refresh + CourseTemplateRefreshReport.create(course_template_refresh_id: task.id, refresh_errors: refresh.errors, refresh_warnings: refresh.warnings, refresh_notices: refresh.notices, refresh_timings: refresh.timings) broadcast_to_channel(channel_id, 'Cleaning up cache', 0.99, '-') if File.directory?(task.langs_refresh_output['output-data']['new-cache-path']) - old_cache_path = task.course_template.cache_path - task.course_template.increment_cached_version - task.course_template.save! - task.course_template.reload + course_template = T.must(task.course_template) + old_cache_path = course_template.cache_path + course_template.increment_cached_version + course_template.save! + course_template.reload courses.each(&:save!) FileUtils.rm_rf(old_cache_path) end broadcast_to_channel(channel_id, 'Refresh completed', 1, '-', task.id) task.status = :complete - task.percent_done = 1 + task.percent_done = BigDecimal('1') task.save! rescue => e Rails.logger.error("Course Refresh task #{task.id} failed:#{e}") - Rails.logger.error(e.backtrace.join("\n")) - CourseTemplateRefreshReport.create(course_template_refresh_id: task.id, refresh_errors: [e.backtrace.join("\n")], refresh_warnings: [], refresh_notices: [], refresh_timings: {}) - broadcast_to_channel(channel_id, 'Refresh crashed', 0, '-', task.id) + Rails.logger.error(T.must(e.backtrace).join("\n")) + CourseTemplateRefreshReport.create(course_template_refresh_id: task.id, refresh_errors: [T.must(e.backtrace).join("\n")], refresh_warnings: [], refresh_notices: [], refresh_timings: {}) + broadcast_to_channel(task.course_template_id, 'Refresh crashed', 0, '-', task.id) task.status = :crashed - task.percent_done = 0 + task.percent_done = BigDecimal('0') task.create_phase(e, 0) task.save! end end + sig { returns(Integer) } def wait_delay 5 end private + sig { params(id: Integer, msg: String, percent: Numeric, time: String, refresh_id: T.nilable(Integer)).void } def broadcast_to_channel(id, msg, percent, time, refresh_id = nil) Rails.logger.info("Broadcasting message: #{msg} to channel CourseTemplateRefreshChannel-#{id}, Percent done: #{percent}, Time: #{time}, Course Template Refresh ID: #{refresh_id}") ActionCable.server.broadcast("CourseTemplateRefreshChannel-#{id}", { diff --git a/app/background_tasks/rust_langs_downloader_task.rb b/app/background_tasks/rust_langs_downloader_task.rb index 2f9e561f0..868a563c8 100644 --- a/app/background_tasks/rust_langs_downloader_task.rb +++ b/app/background_tasks/rust_langs_downloader_task.rb @@ -1,13 +1,17 @@ +# typed: strict # frozen_string_literal: true require 'rust_langs_cli_executor' class RustLangsDownloaderTask - @@rust_langs_version = '0.39.8' + extend T::Sig + @@rust_langs_version = T.let('0.39.8', String) + sig { void } def initialize end + sig { void } def run Rails.logger.info('Creating directory vendor/tmc-langs-rust') unless File.directory?('vendor/tmc-langs-rust') Dir.mkdir('vendor/tmc-langs-rust') unless File.directory?('vendor/tmc-langs-rust') @@ -46,6 +50,7 @@ def run end end + sig { returns(Integer) } def wait_delay 1 end diff --git a/app/background_tasks/sandbox_status_fetcher_task.rb b/app/background_tasks/sandbox_status_fetcher_task.rb index 8332aa12f..f707c3849 100644 --- a/app/background_tasks/sandbox_status_fetcher_task.rb +++ b/app/background_tasks/sandbox_status_fetcher_task.rb @@ -1,16 +1,21 @@ +# typed: strict # frozen_string_literal: true require 'json' require 'benchmark' class SandboxStatusFetcherTask + extend T::Sig + + sig { void } def initialize - @sandboxes = RemoteSandbox.all + RemoteSandbox.all_experimental + @sandboxes = T.let(RemoteSandbox.all + RemoteSandbox.all_experimental, T::Array[RemoteSandbox]) end + sig { void } def run - data = @sandboxes.map do |sandbox| - data = nil + statuses = @sandboxes.map do |sandbox| + data = T.let({}, T::Hash[Symbol, T.untyped]) fetching_time = Benchmark.measure do data = { baseurl: sandbox.baseurl, @@ -21,9 +26,10 @@ def run data[:fetching_time] = fetching_time.real.round(2) data end - Rails.cache.write('sandbox-status-cache', data.to_json, expires_in: 1.minute) + Rails.cache.write('sandbox-status-cache', statuses.to_json, expires_in: 1.minute) end + sig { returns(Integer) } def wait_delay 1 end diff --git a/app/background_tasks/stats_fetcher_task.rb b/app/background_tasks/stats_fetcher_task.rb index 44def18bd..2e8517828 100644 --- a/app/background_tasks/stats_fetcher_task.rb +++ b/app/background_tasks/stats_fetcher_task.rb @@ -1,9 +1,13 @@ +# typed: strict # frozen_string_literal: true class StatsFetcherTask + extend T::Sig + sig { void } def initialize end + sig { void } def run data = { high_priority_submissions_count: Submission.to_be_reprocessed.where(processing_priority: 0).count, @@ -19,6 +23,7 @@ def run Rails.cache.write('submission-stats-cache', data.to_json, expires_in: 1.minute) end + sig { returns(Integer) } def wait_delay 5 end diff --git a/app/background_tasks/submission_long_queue_processor_task.rb b/app/background_tasks/submission_long_queue_processor_task.rb index 623db7b1e..60567a86e 100644 --- a/app/background_tasks/submission_long_queue_processor_task.rb +++ b/app/background_tasks/submission_long_queue_processor_task.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'submission_processor' @@ -6,10 +7,13 @@ # submissions to sandbox. This task uses reverse order in order to avoid # sending the same submission to sandbox multiple times class SubmissionLongQueueProcessorTask + extend T::Sig + sig { void } def initialize - @processor = SubmissionProcessor.new + @processor = T.let(SubmissionProcessor.new, SubmissionProcessor) end + sig { void } def run queue = Submission.to_be_reprocessed.where(processing_priority: 0).order(:created_at).reverse_order return if queue.length <= 10 @@ -21,6 +25,7 @@ def run end end + sig { returns(Integer) } def wait_delay 1 end diff --git a/app/background_tasks/submission_processor_task.rb b/app/background_tasks/submission_processor_task.rb index a67fc408e..e10da7940 100644 --- a/app/background_tasks/submission_processor_task.rb +++ b/app/background_tasks/submission_processor_task.rb @@ -1,16 +1,21 @@ +# typed: strict # frozen_string_literal: true require 'submission_processor' class SubmissionProcessorTask + extend T::Sig + sig { void } def initialize - @processor = SubmissionProcessor.new + @processor = T.let(SubmissionProcessor.new, SubmissionProcessor) end + sig { void } def run @processor.process_some_submissions end + sig { returns(Float) } def wait_delay 0.1 end diff --git a/app/background_tasks/uncomputed_unlock_computor_task.rb b/app/background_tasks/uncomputed_unlock_computor_task.rb index dae4f5275..d77105af4 100644 --- a/app/background_tasks/uncomputed_unlock_computor_task.rb +++ b/app/background_tasks/uncomputed_unlock_computor_task.rb @@ -1,20 +1,25 @@ +# typed: strict # frozen_string_literal: true require 'submission_processor' class UncomputedUnlockComputorTask + extend T::Sig + sig { void } def initialize end + sig { void } def run UncomputedUnlock.order('id ASC').limit(1).each do |uncomputed_unlock| - course = uncomputed_unlock.course - user = uncomputed_unlock.user + course = T.must(uncomputed_unlock.course) + user = T.must(uncomputed_unlock.user) Rails.logger.info "Calculating unlocks for user #{user.id} and course #{course.name}. Queue length: #{UncomputedUnlock.count}." Unlock.refresh_unlocks(course, user) end end + sig { returns(Float) } def wait_delay 0.1 end diff --git a/app/background_tasks/uncomputed_unlock_computor_task_backup.rb b/app/background_tasks/uncomputed_unlock_computor_task_backup.rb index b0d0790b3..339afb185 100644 --- a/app/background_tasks/uncomputed_unlock_computor_task_backup.rb +++ b/app/background_tasks/uncomputed_unlock_computor_task_backup.rb @@ -1,11 +1,15 @@ +# typed: strict # frozen_string_literal: true require 'submission_processor' class UncomputedUnlockComputorTaskBackup + extend T::Sig + sig { void } def initialize end + sig { returns(T.nilable(T::Array[Thread])) } def run count = UncomputedUnlock.count return unless count > 3 @@ -18,8 +22,8 @@ def run workers = a.to_a.each_slice((a.size / threads.to_f).round).map do |uncomputed_unlocks| Thread.new do uncomputed_unlocks.each do |uncomputed_unlock| - course = uncomputed_unlock.course - user = uncomputed_unlock.user + course = T.must(uncomputed_unlock.course) + user = T.must(uncomputed_unlock.user) Rails.logger.info "Calculating unlocks for user #{user.id} and course #{course.name} with a backup task. Queue length: #{UncomputedUnlock.count}." Unlock.refresh_unlocks(course, user) end @@ -28,6 +32,7 @@ def run workers.map(&:join) end + sig { returns(Float) } def wait_delay 0.1 end diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb index 9aec23053..246da394a 100644 --- a/app/channels/application_cable/channel.rb +++ b/app/channels/application_cable/channel.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module ApplicationCable diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb index 051daf8d0..72e38bca8 100644 --- a/app/channels/application_cable/connection.rb +++ b/app/channels/application_cable/connection.rb @@ -1,16 +1,21 @@ +# typed: strict # frozen_string_literal: true module ApplicationCable class Connection < ActionCable::Connection::Base + extend T::Sig + identified_by :current_user + sig { void } def connect self.current_user = find_verified_user end private + sig { returns(User) } def find_verified_user - if verified_user = User.find_by(id: @request.session[:user_id]) + if verified_user = User.find_by(id: request.session[:user_id]) verified_user else reject_unauthorized_connection diff --git a/app/channels/course_template_refresh_channel.rb b/app/channels/course_template_refresh_channel.rb index b2c2bfab5..69225d53a 100644 --- a/app/channels/course_template_refresh_channel.rb +++ b/app/channels/course_template_refresh_channel.rb @@ -1,10 +1,15 @@ +# typed: strict # frozen_string_literal: true class CourseTemplateRefreshChannel < ApplicationCable::Channel + extend T::Sig + + sig { void } def subscribed stream_from "CourseTemplateRefreshChannel-#{params[:courseTemplateId]}" end + sig { void } def unsubscribed # Any cleanup needed when channel is unsubscribed end diff --git a/app/controllers/api.rb b/app/controllers/api.rb index e30e81f73..603fc34c0 100644 --- a/app/controllers/api.rb +++ b/app/controllers/api.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api diff --git a/app/controllers/api/beta.rb b/app/controllers/api/beta.rb index 60e6e6359..07443f1a2 100644 --- a/app/controllers/api/beta.rb +++ b/app/controllers/api/beta.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api diff --git a/app/controllers/api/beta/base_controller.rb b/app/controllers/api/beta/base_controller.rb index 37699d18a..fee736024 100644 --- a/app/controllers/api/beta/base_controller.rb +++ b/app/controllers/api/beta/base_controller.rb @@ -1,8 +1,10 @@ +# typed: strict # frozen_string_literal: true require 'json' class Api::Beta::BaseController < ApplicationController + extend T::Sig clear_respond_to respond_to :json @@ -12,13 +14,16 @@ class Api::Beta::BaseController < ApplicationController skip_authorization_check # we use doorkeeper in api, so let's skip cancancan rescue_from CanCan::AccessDenied do |e| + T.bind(self, Api::Beta::BaseController) render json: errors_json(e.message), status: :forbidden end rescue_from ActiveRecord::RecordNotFound do |e| + T.bind(self, Api::Beta::BaseController) render json: errors_json(e.message), status: :not_found end + sig { params(hash: T.untyped).void } def present(hash) if !!params[:pretty] render json: JSON.pretty_generate(hash) @@ -28,9 +33,10 @@ def present(hash) end private + sig { void } def authenticate_user! if doorkeeper_token - @current_user = User.find(doorkeeper_token.resource_owner_id) + @current_user = T.let(User.find(doorkeeper_token.resource_owner_id), T.nilable(User)) end return if @current_user @@ -38,8 +44,13 @@ def authenticate_user! render json: { errors: ['User is not authenticated!'] }, status: :unauthorized end - attr_reader :current_user + # Before authenticate_user! has run (ApplicationController's own before_actions), this is a Guest. + sig { returns(User) } + def current_user + @current_user || Guest.new + end + sig { params(messages: T.any(String, T::Array[String])).returns(T::Hash[Symbol, T::Array[String]]) } def errors_json(messages) { errors: [*messages] } end diff --git a/app/controllers/api/beta/course_id_information_controller.rb b/app/controllers/api/beta/course_id_information_controller.rb index 5cdfa81b4..518351149 100644 --- a/app/controllers/api/beta/course_id_information_controller.rb +++ b/app/controllers/api/beta/course_id_information_controller.rb @@ -1,8 +1,10 @@ +# typed: strict # frozen_string_literal: true class Api::Beta::CourseIdInformationController < Api::Beta::BaseController before_action :doorkeeper_authorize!, scopes: [:public] + sig { void } def index course_ids = Course.order(:id).where(hidden: false).enabled.pluck(:id) present(course_ids) diff --git a/app/controllers/api/beta/participant_controller.rb b/app/controllers/api/beta/participant_controller.rb index 0fb47402f..5398320d0 100644 --- a/app/controllers/api/beta/participant_controller.rb +++ b/app/controllers/api/beta/participant_controller.rb @@ -1,15 +1,19 @@ +# typed: strict # frozen_string_literal: true require 'course_list' class Api::Beta::ParticipantController < Api::Beta::BaseController + extend T::Sig + before_action :doorkeeper_authorize!, scopes: [:public] + sig { void } def courses user = User.where(id: params[:id]).first || current_user authorize! :read, user courses = user.courses_with_submissions - list = CourseList.new(current_user, view_context).course_list_data_no_organisation(Course.find(user.course_ids)) + list = CourseList.new(current_user, view_context).course_list_data_no_organisation(Course.find(T.let(user.course_ids, T::Array[Numeric]))) list.each do |course| course[:exercises] = courses[course[:id]] end @@ -17,6 +21,7 @@ def courses present(list) end + sig { void } def index user = current_user present(username: user.login, diff --git a/app/controllers/api/beta/stats_controller.rb b/app/controllers/api/beta/stats_controller.rb index 8d530ebbd..fb6ccd1ad 100644 --- a/app/controllers/api/beta/stats_controller.rb +++ b/app/controllers/api/beta/stats_controller.rb @@ -1,8 +1,10 @@ +# typed: strict # frozen_string_literal: true class Api::Beta::StatsController < Api::Beta::BaseController before_action :doorkeeper_authorize!, scopes: [:public] + sig { void } def submission_processing_times processing_began_at = Submission.arel_table[:processing_began_at] results = Submission @@ -14,15 +16,16 @@ def submission_processing_times res = results.map do |result| { - avg_duration: result.avg_duration, - stddev: result.stddev, - minute: result.minute, - count: result.count + avg_duration: result[:avg_duration], + stddev: result[:stddev], + minute: result[:minute], + count: result[:count] } end present(res) end + sig { void } def submission_queue_times created_at = Submission.arel_table[:created_at] results = Submission @@ -30,10 +33,10 @@ def submission_queue_times res = results.map do |result| { - avg_duration: result.avg_duration, - stddev: result.stddev, - minute: result.minute, - count: result.count + avg_duration: result[:avg_duration], + stddev: result[:stddev], + minute: result[:minute], + count: result[:count] } end present(res) diff --git a/app/controllers/api/v8.rb b/app/controllers/api/v8.rb index ae08a53e7..ea0271e96 100644 --- a/app/controllers/api/v8.rb +++ b/app/controllers/api/v8.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api diff --git a/app/controllers/api/v8/apidocs_controller.rb b/app/controllers/api/v8/apidocs_controller.rb index f8b984310..8758e309e 100644 --- a/app/controllers/api/v8/apidocs_controller.rb +++ b/app/controllers/api/v8/apidocs_controller.rb @@ -1,8 +1,10 @@ +# typed: strict # frozen_string_literal: true module Api module V8 class ApidocsController < ActionController::Base + extend T::Sig include Swagger::Blocks swagger_root do @@ -150,7 +152,7 @@ class ApidocsController < ActionController::Base # A list of all classes that have swagger_* declarations. # The order of the swagered_classes affects the order they are shown in swaggerUI - SWAGGERED_CLASSES = [ + SWAGGERED_CLASSES = T.let([ Api::V8::UsersController, Api::V8::CoursesController, Api::V8::Courses::PointsController, @@ -197,8 +199,9 @@ class ApidocsController < ActionController::Base Submission, User, self - ].freeze + ].freeze, T::Array[T::Class[T.anything]]) + sig { void } def index render json: Swagger::Blocks.build_root_json(SWAGGERED_CLASSES) end diff --git a/app/controllers/api/v8/application/credentials_controller.rb b/app/controllers/api/v8/application/credentials_controller.rb index e8058673d..330268aa8 100644 --- a/app/controllers/api/v8/application/credentials_controller.rb +++ b/app/controllers/api/v8/application/credentials_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -5,6 +6,7 @@ module V8 module Application class CredentialsController < Api::V8::BaseController skip_authorization_check + sig { void } def index valid_clients = SiteSetting.value('valid_clients') .map { |o| o['name'] } diff --git a/app/controllers/api/v8/base_controller.rb b/app/controllers/api/v8/base_controller.rb index c9b362808..53ae552bf 100644 --- a/app/controllers/api/v8/base_controller.rb +++ b/app/controllers/api/v8/base_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'json' @@ -6,6 +7,7 @@ module Api module V8 class BaseController < ApplicationController + extend T::Sig clear_respond_to respond_to :json @@ -15,6 +17,7 @@ class BaseController < ApplicationController skip_before_action :verify_authenticity_token rescue_from CanCan::AccessDenied do |e| + T.bind(self, Api::V8::BaseController) if current_user.guest? respond_unauthorized(e.message) else @@ -23,14 +26,17 @@ class BaseController < ApplicationController end rescue_from CoursesMoocFiTokenIntrospector::Unavailable do |e| + T.bind(self, Api::V8::BaseController) Rails.logger.error("courses.mooc.fi token introspection unavailable: #{e.message}") respond_with_error('courses.mooc.fi could not verify your login right now. Try again later.', 503) end rescue_from ActiveRecord::RecordNotFound do |e| + T.bind(self, Api::V8::BaseController) render json: errors_json(e.message), status: :not_found end + sig { params(hash: T.untyped).void } def present(hash) if params[:pretty] render json: JSON.pretty_generate(hash) @@ -40,40 +46,51 @@ def present(hash) end private + sig { void } def authenticate_user! - return @current_user if @current_user + return if @current_user if doorkeeper_token - @current_user ||= User.find_by(id: doorkeeper_token.resource_owner_id) + @current_user = T.let(User.find_by(id: doorkeeper_token.resource_owner_id), T.nilable(User)) raise 'Invalid token' unless @current_user elsif Rails.configuration.x.accept_courses_mooc_fi_tokens @current_user = CoursesMoocFiAuthentication.user_for(request) - @auth_source = :courses_mooc_fi_token if @current_user + @auth_source = T.let(:courses_mooc_fi_token, T.nilable(Symbol)) if @current_user end @current_user ||= user_from_session || Guest.new end - attr_reader :current_user + # Before authenticate_user! has run (ApplicationController's own before_actions), this is a Guest. + sig { returns(User) } + def current_user + @current_user || Guest.new + end + sig { returns(::Ability) } def current_ability - @current_ability ||= ::Ability.new(current_user, auth_source: @auth_source) + @current_ability ||= T.let(::Ability.new(current_user, auth_source: @auth_source), T.nilable(::Ability)) end + sig { params(messages: T.any(String, T::Array[String])).returns(T::Hash[Symbol, T::Array[String]]) } def errors_json(messages) { errors: [*messages] } end + sig { params(msg: String).void } def respond_not_found(msg = 'Not Found') respond_with_error(msg, 404) end + sig { params(msg: String).void } def respond_forbidden(msg = 'Forbidden') respond_with_error(msg, 403) end + sig { params(msg: String).void } def respond_unauthorized(msg = 'Authentication required') respond_with_error(msg, 401) end + sig { params(msg: String, code: Integer, exception: T.nilable(Exception), extra_json_keys: T::Hash[Symbol, T.untyped]).void } def respond_with_error(msg, code = 500, exception = nil, extra_json_keys = {}) respond_to do |format| format.html do @@ -87,6 +104,7 @@ def respond_with_error(msg, code = 500, exception = nil, extra_json_keys = {}) end end + sig { void } def check_client_version_api_v8 if should_check_for_client_version? begin @@ -110,6 +128,7 @@ def check_client_version_api_v8 end end + sig { returns(T::Boolean) } def should_check_for_client_version? params[:format] == 'json' && (params[:client].present? && params[:client_version].present?) && @@ -117,6 +136,7 @@ def should_check_for_client_version? (controller_name == 'submissions' && action_name == 'create') end + sig { params(client_name: T.untyped, client_version: T.untyped).void } def check_client_minimum_version(client_name, client_version) begin client_version = Version.new(client_version) unless client_version.nil? diff --git a/app/controllers/api/v8/core.rb b/app/controllers/api/v8/core.rb index ca589c3b8..4803504c9 100644 --- a/app/controllers/api/v8/core.rb +++ b/app/controllers/api/v8/core.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api diff --git a/app/controllers/api/v8/core/courses/reviews_controller.rb b/app/controllers/api/v8/core/courses/reviews_controller.rb index 04e34df6a..bbf75a53d 100644 --- a/app/controllers/api/v8/core/courses/reviews_controller.rb +++ b/app/controllers/api/v8/core/courses/reviews_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'natsort' @@ -7,6 +8,7 @@ module V8 module Core module Courses class ReviewsController < Api::V8::BaseController + extend T::Sig include Swagger::Blocks swagger_path '/api/v8/core/courses/{course_id}/reviews' do @@ -53,6 +55,7 @@ class ReviewsController < Api::V8::BaseController end end + sig { void } def index unauthorize_guest! course = Course.find_by!(id: params[:course_id]) @@ -65,9 +68,10 @@ def index present Review.course_reviews_json(course, users_reviewed_submissions, view_context) end + sig { void } def update - fetch :review - authorize! :update, @review + review = fetch_review + authorize! :update, review if params[:review].present? && params[:review].has_key?(:review_body) update_review elsif params[:mark_as_read] @@ -77,51 +81,44 @@ def update end end + sig { void } def update_review - fetch :review - authorize! :update, @review - @review.review_body = params[:review][:review_body] + review = fetch_review + authorize! :update, review + review.review_body = params[:review][:review_body] begin - mark_as_reviewed - award_points - @review.submission.save! - @review.save! + mark_as_reviewed(review) + award_points(review) + T.must(review.submission).save! + review.save! rescue StandardError ::Rails.logger.error($!) respond_with_error('Failed to save code review.') else - present(status: 200) && return + present(status: 200) end end + sig { params(read: T::Boolean).void } def mark_as_read(read) - fetch :review - authorize!(read ? :mark_as_read : :mark_as_unread, @review) + review = fetch_review + authorize!(read ? :mark_as_read : :mark_as_unread, review) - @review.marked_as_read = read - present(status: 200) && return if @review.save + review.marked_as_read = read + present(status: 200) if review.save end - def fetch(*stuff) - if stuff.include? :course - @course = Course.find(params[:course_id]) - authorize! :read, @course - end - if stuff.include? :submission - @submission = Submission.find(params[:submission_id]) - authorize! :read, @submission - end - if stuff.include? :review - @review = Review.find(params[:id]) - authorize! :read, @review - end - return unless stuff.include? :files - @files = SourceFileList.for_submission(@submission) + sig { returns(Review) } + def fetch_review + review = Review.find(params[:id]) + authorize! :read, review + review end - def mark_as_reviewed - sub = @review.submission + sig { params(review: Review).void } + def mark_as_reviewed(review) + sub = T.must(review.submission) sub.reviewed = true sub.review_dismissed = false sub.of_same_kind @@ -130,16 +127,17 @@ def mark_as_reviewed .update_all(newer_submission_reviewed: true) end - def award_points - submission = @review.submission + sig { params(review: Review).void } + def award_points(review) + submission = T.must(review.submission) exercise = submission.exercise - course = exercise.course raise 'Exercise of submission has been moved or deleted' unless exercise + course = T.must(exercise.course) available_points = exercise.available_points.where(requires_review: true).map(&:name) previous_points = course.awarded_points.where(user_id: submission.user_id, name: available_points).map(&:name) - new_points = [] + new_points = T.let([], T::Array[String]) if params[:review][:points].respond_to?(:keys) params[:review][:points].keys.each do |point_name| unless exercise.available_points.where(name: point_name).any? @@ -157,7 +155,7 @@ def award_points end end - @review.points = (@review.points_list + new_points + previous_points).uniq.natsort.join(' ') + review.points = (review.points_list + new_points + previous_points).uniq.natsort.join(' ') submission.points = (submission.points_list + new_points + previous_points).uniq.natsort.join(' ') end end diff --git a/app/controllers/api/v8/core/courses/unlocks_controller.rb b/app/controllers/api/v8/core/courses/unlocks_controller.rb index 4ed46d0be..56286f51c 100644 --- a/app/controllers/api/v8/core/courses/unlocks_controller.rb +++ b/app/controllers/api/v8/core/courses/unlocks_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -29,6 +30,7 @@ class UnlocksController < Api::V8::BaseController around_action :wrap_transaction + sig { void } def create unauthorize_guest! course = Course.find(params[:course_id]) diff --git a/app/controllers/api/v8/core/courses_controller.rb b/app/controllers/api/v8/core/courses_controller.rb index c494875ec..ab481874a 100644 --- a/app/controllers/api/v8/core/courses_controller.rb +++ b/app/controllers/api/v8/core/courses_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'course_info' @@ -32,6 +33,7 @@ class CoursesController < Api::V8::BaseController end end + sig { void } def show unauthorize_guest! course = Course.find_by!(id: params[:id]) diff --git a/app/controllers/api/v8/core/exercises/details_controller.rb b/app/controllers/api/v8/core/exercises/details_controller.rb index 784edfa4d..5192cea79 100644 --- a/app/controllers/api/v8/core/exercises/details_controller.rb +++ b/app/controllers/api/v8/core/exercises/details_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -43,6 +44,7 @@ class DetailsController < Api::V8::BaseController skip_authorization_check + sig { void } def show exercise_ids = params[:ids] return respond_not_found('Query param ids is empty. Example: ?ids=1,2,3') if !exercise_ids.present? || exercise_ids.empty? @@ -53,9 +55,9 @@ def show { id: exercise.id, checksum: exercise.checksum, - course_name: exercise.course.name, + course_name: T.must(exercise.course).name, exercise_name: exercise.name, - hide_submission_results: (exercise.course.hide_submission_results || exercise.hide_submission_results), + hide_submission_results: (T.must(exercise.course).hide_submission_results || exercise.hide_submission_results), } end present exercises: data diff --git a/app/controllers/api/v8/core/exercises/solutions_controller.rb b/app/controllers/api/v8/core/exercises/solutions_controller.rb index 639fb1399..6736bd297 100644 --- a/app/controllers/api/v8/core/exercises/solutions_controller.rb +++ b/app/controllers/api/v8/core/exercises/solutions_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -27,6 +28,7 @@ class SolutionsController < Api::V8::BaseController around_action :wrap_transaction + sig { void } def download unauthorize_guest! exercise = Exercise.find_by!(id: params[:exercise_id]) diff --git a/app/controllers/api/v8/core/exercises/submissions_controller.rb b/app/controllers/api/v8/core/exercises/submissions_controller.rb index 8ff23ccff..c71273f58 100644 --- a/app/controllers/api/v8/core/exercises/submissions_controller.rb +++ b/app/controllers/api/v8/core/exercises/submissions_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'submission_processor' @@ -36,26 +37,27 @@ class SubmissionsController < Api::V8::BaseController around_action :wrap_transaction + sig { void } def create unauthorize_guest! - @exercise = Exercise.find(params[:exercise_id]) - authorize! :read, @exercise - @course = @exercise.course - authorize! :read, @course + exercise = Exercise.find(params[:exercise_id]) + authorize! :read, exercise + course = T.must(exercise.course) + authorize! :read, course if !params[:submission] || !params[:submission][:file] authorization_skip! return respond_not_found('No ZIP file selected or failed to receive it') end - unless @exercise.submittable_by?(current_user) + unless exercise.submittable_by?(current_user) authorization_skip! return respond_forbidden('Submissions for this exercise are no longer accepted.') end # Check if user has too many processing submissions for this exercise - processing_count = current_user.processing_submissions_count_for_exercise(@exercise.name, @course.id) + processing_count = current_user.processing_submissions_count_for_exercise(T.must(exercise.name), course.id) if processing_count >= 3 authorization_skip! return respond_forbidden("Too many submissions currently processing for this exercise. You have #{processing_count} submissions being processed. Please wait for them to complete before submitting again. All your submissions will eventually get processed and you will get your points.") @@ -76,10 +78,10 @@ def create low_priority = Submission.where(created_at: (Time.now - 10.minutes)..Time.now, user: current_user).count > 3 unless errormsg - @submission = Submission.new( + submission = Submission.new( user: current_user, - course: @course, - exercise: @exercise, + course: course, + exercise: exercise, return_file: file_contents, params_json: submission_params.to_json, requests_review: !params[:request_review].nil?, @@ -102,22 +104,22 @@ def create processing_priority: low_priority ? -100 : 0 ) - authorize! :create, @submission + authorize! :create, submission - unless @submission.save + unless submission.save errormsg = 'Failed to save submission.' - errormsg += " Errors: #{@submission.errors.messages}" + errormsg += " Errors: #{submission.errors.messages}" end end unless errormsg - # SubmissionProcessor.new.process_submission(@submission) + # SubmissionProcessor.new.process_submission(submission) end if !errormsg - render json: { submission_url: api_v8_core_submission_url(@submission), - paste_url: @submission.paste_key ? paste_url(@submission.paste_key) : '', - show_submission_url: submission_url(@submission) } + render json: { submission_url: api_v8_core_submission_url(submission), + paste_url: submission.paste_key ? paste_url(submission.paste_key) : '', + show_submission_url: submission_url(submission) } else render json: { error: errormsg } end diff --git a/app/controllers/api/v8/core/exercises_controller.rb b/app/controllers/api/v8/core/exercises_controller.rb index dcc30ab66..152f60eb2 100644 --- a/app/controllers/api/v8/core/exercises_controller.rb +++ b/app/controllers/api/v8/core/exercises_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'submission_list' @@ -49,6 +50,7 @@ class ExercisesController < Api::V8::BaseController end end + sig { void } def download exercise = Exercise.find(params[:id]) @@ -56,10 +58,11 @@ def download send_file exercise.stub_zip_file_path end + sig { void } def show unauthorize_guest! exercise = Exercise.find(params[:id]) - course = Course.find(exercise.course_id) + course = Course.find(T.must(exercise.course_id)) authorize! :read, course authorize! :read, exercise diff --git a/app/controllers/api/v8/core/organizations/courses_controller.rb b/app/controllers/api/v8/core/organizations/courses_controller.rb index 0f636f118..c91027ead 100644 --- a/app/controllers/api/v8/core/organizations/courses_controller.rb +++ b/app/controllers/api/v8/core/organizations/courses_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -27,6 +28,7 @@ class CoursesController < Api::V8::BaseController end end + sig { void } def index unauthorize_guest! organization = Organization.find_by!(slug: params[:organization_slug]) diff --git a/app/controllers/api/v8/core/submissions/feedback_controller.rb b/app/controllers/api/v8/core/submissions/feedback_controller.rb index 4cdadae6f..384cabd08 100644 --- a/app/controllers/api/v8/core/submissions/feedback_controller.rb +++ b/app/controllers/api/v8/core/submissions/feedback_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -38,6 +39,7 @@ class FeedbackController < Api::V8::BaseController end end + sig { void } def create submission = Submission.find(params[:submission_id]) authorize! :read, submission diff --git a/app/controllers/api/v8/core/submissions/reviews_controller.rb b/app/controllers/api/v8/core/submissions/reviews_controller.rb index 8ccf4ab9f..5705e73f2 100644 --- a/app/controllers/api/v8/core/submissions/reviews_controller.rb +++ b/app/controllers/api/v8/core/submissions/reviews_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'natsort' @@ -7,6 +8,7 @@ module V8 module Core module Submissions class ReviewsController < Api::V8::BaseController + extend T::Sig include Swagger::Blocks swagger_path '/api/v8/core/submissions/{submission_id}/reviews' do @@ -33,12 +35,13 @@ class ReviewsController < Api::V8::BaseController around_action :wrap_transaction + sig { void } def create unauthorize_guest! submission = Submission.find(params[:submission_id]) authorize! :read, submission - @review = Review.new( + review = Review.new( submission_id: submission.id, reviewer_id: current_user.id, review_body: params[:review][:review_body] @@ -48,31 +51,32 @@ def create begin ActiveRecord::Base.connection.transaction do - award_points - mark_as_reviewed - @review.submission.save! - @review.save! + award_points(review) + mark_as_reviewed(review) + T.must(review.submission).save! + review.save! end rescue StandardError ::Rails.logger.error($!) respond_with_error('Failed to save code review.') else - send_email_about_new_review if params[:send_email] + send_email_about_new_review(review) if params[:send_email] present(status: 'ok') end end private - def award_points - submission = @review.submission + sig { params(review: Review).void } + def award_points(review) + submission = T.must(review.submission) exercise = submission.exercise - course = exercise.course raise 'Exercise of submission has been moved or deleted' unless exercise + course = T.must(exercise.course) available_points = exercise.available_points.where(requires_review: true).map(&:name) previous_points = course.awarded_points.where(user_id: submission.user_id, name: available_points).map(&:name) - new_points = [] + new_points = T.let([], T::Array[String]) if params[:review][:points].respond_to?(:keys) params[:review][:points].keys.each do |point_name| unless exercise.available_points.where(name: point_name).any? @@ -90,12 +94,13 @@ def award_points end end - @review.points = (@review.points_list + new_points + previous_points).uniq.natsort.join(' ') + review.points = (review.points_list + new_points + previous_points).uniq.natsort.join(' ') submission.points = (submission.points_list + new_points + previous_points).uniq.natsort.join(' ') end - def mark_as_reviewed - sub = @review.submission + sig { params(review: Review).void } + def mark_as_reviewed(review) + sub = T.must(review.submission) sub.reviewed = true sub.review_dismissed = false sub.of_same_kind @@ -104,8 +109,9 @@ def mark_as_reviewed .update_all(newer_submission_reviewed: true) end - def send_email_about_new_review - ReviewMailer.review_email(@review).deliver + sig { params(review: Review).void } + def send_email_about_new_review(review) + ReviewMailer.review_email(review).deliver_now end end end diff --git a/app/controllers/api/v8/core/submissions_controller.rb b/app/controllers/api/v8/core/submissions_controller.rb index ad3509d87..7b1237648 100644 --- a/app/controllers/api/v8/core/submissions_controller.rb +++ b/app/controllers/api/v8/core/submissions_controller.rb @@ -1,9 +1,11 @@ +# typed: strict # frozen_string_literal: true module Api module V8 module Core class SubmissionsController < Api::V8::BaseController + extend T::Sig include Swagger::Blocks swagger_path '/api/v8/core/submissions/{submission_id}/download' do @@ -26,73 +28,74 @@ class SubmissionsController < Api::V8::BaseController around_action :wrap_transaction + sig { void } def download unauthorize_guest! submission = Submission.find(params[:id]) authorize! :download, submission - send_data(submission.return_file, filename: "#{submission.user.login}-#{submission.exercise.name}-#{submission.id}.zip") + send_data(submission.return_file, filename: "#{T.must(submission.user).login}-#{T.must(submission.exercise).name}-#{submission.id}.zip") end + sig { void } def show - @submission = Submission.find_by!(id: params[:id]) - unless @submission.processed? + submission = Submission.find_by!(id: params[:id]) + unless submission.processed? authorization_skip! sandbox_status = :created - if @submission.processing_began_at + if submission.processing_began_at sandbox_status = :processing_on_sandbox - elsif @submission.processing_tried_at + elsif submission.processing_tried_at sandbox_status = :sending_to_sandbox end status = :processing - status = :hidden unless @submission.can_see_results?(current_user) + status = :hidden unless submission.can_see_results?(current_user) return render json: { status: status, sandbox_status: sandbox_status } end unauthorize_guest! - authorize! :read, @submission + authorize! :read, submission # This gets invalidated for the submitter when the results arrive so that they see the results right away. - output = Rails.cache.fetch("api_v8_core_submission_show_#{@submission.id}_user_#{current_user.id}", expires_in: 30.seconds) do - @course = @submission.course - @exercise = @submission.exercise - @organization = @course.organization - output = { + output = Rails.cache.fetch("api_v8_core_submission_show_#{submission.id}_user_#{current_user.id}", expires_in: 30.seconds) do + course = T.must(submission.course) + exercise = T.must(submission.exercise) + submission_json = { api_version: ApiVersion::API_VERSION, - all_tests_passed: @submission.all_tests_passed?, - user_id: @submission.user_id, - login: @submission.user.login, - course: @course.name, - exercise_name: @submission.exercise.name, - status: @submission.status(current_user), - points: @submission.points_list, - validations: @submission.validations, - valgrind: @submission.valgrind, - submission_url: submission_url(@submission), - solution_url: @exercise.solution.visible_to?(current_user, true) ? view_context.exercise_solution_url(@exercise) : nil, - submitted_at: @submission.created_at, - processing_time: @submission.processing_time, - reviewed: @submission.reviewed?, - requests_review: @submission.requests_review?, - paste_url: @submission.paste_available ? paste_url(@submission.paste_key) : nil, - message_for_paste: @submission.paste_available ? @submission.message_for_paste : nil, - missing_review_points: @exercise.missing_review_points_for(@submission.user) + all_tests_passed: submission.all_tests_passed?, + user_id: submission.user_id, + login: T.must(submission.user).login, + course: course.name, + exercise_name: exercise.name, + status: submission.status(current_user), + points: submission.points_list, + validations: submission.validations, + valgrind: submission.valgrind, + submission_url: submission_url(submission), + solution_url: exercise.solution.visible_to?(current_user, true) ? view_context.exercise_solution_url(exercise) : nil, + submitted_at: submission.created_at, + processing_time: submission.processing_time, + reviewed: submission.reviewed?, + requests_review: submission.requests_review?, + paste_url: submission.paste_available ? paste_url(submission.paste_key) : nil, + message_for_paste: submission.paste_available ? submission.message_for_paste : nil, + missing_review_points: exercise.missing_review_points_for(T.must(submission.user)) } - output = output.merge( - case @submission.status(current_user) + submission_json = submission_json.merge( + T.must(case submission.status(current_user) when :processing then { - submissions_before_this: @submission.unprocessed_submissions_before_this, + submissions_before_this: submission.unprocessed_submissions_before_this, total_unprocessed: Submission.unprocessed_count } when :ok then { - test_cases: @submission.test_case_records, - feedback_questions: @course.feedback_questions.order(:position).map(&:record_for_api), - feedback_answer_url: api_v8_core_submission_feedback_index_url(@submission, format: :json) + test_cases: submission.test_case_records, + feedback_questions: course.feedback_questions.order(:position).map(&:record_for_api), + feedback_answer_url: api_v8_core_submission_feedback_index_url(submission, format: :json) } when :fail then { - test_cases: @submission.test_case_records + test_cases: submission.test_case_records } when :hidden then { all_tests_passed: nil, @@ -102,21 +105,22 @@ def show valgrind: nil } when :error then { - error: @submission.pretest_error + error: submission.pretest_error } - end + end) ) - output[:status] = :ok if output[:status] == :hidden && !can_handle_hidden_fields(params) + submission_json[:status] = :ok if submission_json[:status] == :hidden && !can_handle_hidden_fields(params) if !!params[:include_files] - output[:files] = SourceFileList.for_submission(@submission).map { |f| { path: f.path, contents: f.contents } } + submission_json[:files] = SourceFileList.for_submission(submission).map { |f| { path: f.path, contents: f.contents } } end - output + submission_json end render json: output end private + sig { params(params: T.untyped).returns(T::Boolean) } def can_handle_hidden_fields(params) return false unless params[:client] == 'netbeans_plugin' splitted = params[:client_version].split('.') diff --git a/app/controllers/api/v8/courses/all_courses_with_this_template_controller.rb b/app/controllers/api/v8/courses/all_courses_with_this_template_controller.rb index b481be2c6..445622c03 100644 --- a/app/controllers/api/v8/courses/all_courses_with_this_template_controller.rb +++ b/app/controllers/api/v8/courses/all_courses_with_this_template_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -35,6 +36,7 @@ class AllCoursesWithThisTemplateController < Api::V8::BaseController end end + sig { void } def index unauthorize_guest! course = Course.find_by!(id: params[:course_id]) diff --git a/app/controllers/api/v8/courses/exercises/points_controller.rb b/app/controllers/api/v8/courses/exercises/points_controller.rb index a6ecb8cc8..e55115399 100644 --- a/app/controllers/api/v8/courses/exercises/points_controller.rb +++ b/app/controllers/api/v8/courses/exercises/points_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -33,6 +34,7 @@ class PointsController < Api::V8::BaseController end end + sig { void } def index unauthorize_guest! course = Course.find_by!(id: params[:course_id]) @@ -42,7 +44,7 @@ def index course_id: course.id) authorize! :read, points - present(points.as_json_with_exercise_ids(course.exercises)) + present(AwardedPoint.as_json_with_exercise_ids(points, course.exercises)) end end end diff --git a/app/controllers/api/v8/courses/exercises/users/points_controller.rb b/app/controllers/api/v8/courses/exercises/users/points_controller.rb index eabed9ffd..320cb16dc 100644 --- a/app/controllers/api/v8/courses/exercises/users/points_controller.rb +++ b/app/controllers/api/v8/courses/exercises/users/points_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -61,6 +62,7 @@ class PointsController < Api::V8::BaseController end end + sig { void } def index unauthorize_guest! course = Course.find_by!(id: params[:course_id]) @@ -72,7 +74,7 @@ def index user_id: params[:user_id]) authorize! :read, points - present(points.as_json_with_exercise_ids(course.exercises)) + present(AwardedPoint.as_json_with_exercise_ids(points, course.exercises)) end end end diff --git a/app/controllers/api/v8/courses/exercises_controller.rb b/app/controllers/api/v8/courses/exercises_controller.rb index 0523b3399..59176903d 100644 --- a/app/controllers/api/v8/courses/exercises_controller.rb +++ b/app/controllers/api/v8/courses/exercises_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -31,9 +32,10 @@ class ExercisesController < Api::V8::BaseController end end + sig { void } def index unauthorize_guest! - course = Course.find_by!(id: params[:course_id]) if params[:course_id] + course = Course.find_by!(id: params[:course_id]) can_see_everything = current_user.administrator? || current_user.teacher?(course.organization) || current_user.assistant?(course) authorize! :read, course diff --git a/app/controllers/api/v8/courses/points_controller.rb b/app/controllers/api/v8/courses/points_controller.rb index a099a997c..15322d568 100644 --- a/app/controllers/api/v8/courses/points_controller.rb +++ b/app/controllers/api/v8/courses/points_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -26,11 +27,12 @@ class PointsController < Api::V8::BaseController end end + sig { void } def index course = Course.find_by!(id: params[:course_id]) points = course.awarded_points.includes(:submission) authorize_collection :read, points - present points.as_json_with_exercise_ids(course.exercises) + present AwardedPoint.as_json_with_exercise_ids(points, course.exercises) end end end diff --git a/app/controllers/api/v8/courses/submissions/last_hour_controller.rb b/app/controllers/api/v8/courses/submissions/last_hour_controller.rb index 4df2fd339..94924ed72 100644 --- a/app/controllers/api/v8/courses/submissions/last_hour_controller.rb +++ b/app/controllers/api/v8/courses/submissions/last_hour_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -29,6 +30,7 @@ class LastHourController < Api::V8::BaseController skip_authorization_check + sig { void } def index return respond_forbidden unless current_user.administrator? course = Course.find(params[:course_id]) diff --git a/app/controllers/api/v8/courses/submissions_controller.rb b/app/controllers/api/v8/courses/submissions_controller.rb index 680b8ef53..edb9ff043 100644 --- a/app/controllers/api/v8/courses/submissions_controller.rb +++ b/app/controllers/api/v8/courses/submissions_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -37,6 +38,7 @@ class SubmissionsController < Api::V8::BaseController around_action :wrap_transaction + sig { void } def index unauthorize_guest! course = Course.find_by!(id: params[:course_id]) diff --git a/app/controllers/api/v8/courses/users/points_controller.rb b/app/controllers/api/v8/courses/users/points_controller.rb index 26d27aeaa..e00f815fb 100644 --- a/app/controllers/api/v8/courses/users/points_controller.rb +++ b/app/controllers/api/v8/courses/users/points_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -48,12 +49,13 @@ class PointsController < Api::V8::BaseController end end + sig { void } def index course = Course.find_by!(id: params[:course_id]) params[:user_id] = current_user.id if params[:user_id] == 'current' points = course.awarded_points.includes(:submission).where(user_id: params[:user_id]) authorize_collection :read, points - present points.as_json_with_exercise_ids(course.exercises) + present AwardedPoint.as_json_with_exercise_ids(points, course.exercises) end end end diff --git a/app/controllers/api/v8/courses/users/submissions_controller.rb b/app/controllers/api/v8/courses/users/submissions_controller.rb index cd4e88a39..c4b6c6258 100644 --- a/app/controllers/api/v8/courses/users/submissions_controller.rb +++ b/app/controllers/api/v8/courses/users/submissions_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -68,6 +69,7 @@ class SubmissionsController < Api::V8::BaseController around_action :wrap_transaction + sig { void } def index unauthorize_guest! course = Course.find_by!(id: params[:course_id]) diff --git a/app/controllers/api/v8/courses_controller.rb b/app/controllers/api/v8/courses_controller.rb index c51c5979c..156974455 100644 --- a/app/controllers/api/v8/courses_controller.rb +++ b/app/controllers/api/v8/courses_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -24,6 +25,7 @@ class CoursesController < Api::V8::BaseController end end + sig { void } def show unauthorize_guest! course = Course.find_by!(id: params[:id]) diff --git a/app/controllers/api/v8/exercises/model_solutions_controller.rb b/app/controllers/api/v8/exercises/model_solutions_controller.rb index 63af57422..cb7c8e024 100644 --- a/app/controllers/api/v8/exercises/model_solutions_controller.rb +++ b/app/controllers/api/v8/exercises/model_solutions_controller.rb @@ -1,13 +1,15 @@ +# typed: strict # frozen_string_literal: true module Api module V8 module Exercises class ModelSolutionsController < Api::V8::BaseController + sig { void } def index unauthorize_guest! exercise = Exercise.find(params[:exercise_id]) - course = exercise.course + course = T.must(exercise.course) authorize! :read, exercise solution = exercise.solution begin diff --git a/app/controllers/api/v8/exercises/users/submissions_controller.rb b/app/controllers/api/v8/exercises/users/submissions_controller.rb index 391926c2a..3672e9b76 100644 --- a/app/controllers/api/v8/exercises/users/submissions_controller.rb +++ b/app/controllers/api/v8/exercises/users/submissions_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -58,6 +59,7 @@ class SubmissionsController < Api::V8::BaseController end end + sig { void } def index unauthorize_guest! exercise = Exercise.find_by!(id: params[:exercise_id]) diff --git a/app/controllers/api/v8/organizations/courses/exercises/points_controller.rb b/app/controllers/api/v8/organizations/courses/exercises/points_controller.rb index d01221218..d16b666f5 100644 --- a/app/controllers/api/v8/organizations/courses/exercises/points_controller.rb +++ b/app/controllers/api/v8/organizations/courses/exercises/points_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -35,6 +36,7 @@ class PointsController < Api::V8::BaseController end end + sig { void } def index unauthorize_guest! course = Course.find_by!(name: "#{params[:organization_slug]}-#{params[:course_name]}") @@ -44,7 +46,7 @@ def index course_id: course.id) authorize! :read, points - present(points.as_json_with_exercise_ids(course.exercises)) + present(AwardedPoint.as_json_with_exercise_ids(points, course.exercises)) end end end diff --git a/app/controllers/api/v8/organizations/courses/exercises/users/points_controller.rb b/app/controllers/api/v8/organizations/courses/exercises/users/points_controller.rb index 1b48b88a8..5b256c3d8 100644 --- a/app/controllers/api/v8/organizations/courses/exercises/users/points_controller.rb +++ b/app/controllers/api/v8/organizations/courses/exercises/users/points_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -64,6 +65,7 @@ class PointsController < Api::V8::BaseController end end + sig { void } def index unauthorize_guest! course = Course.find_by!(name: "#{params[:organization_slug]}-#{params[:course_name]}") @@ -75,7 +77,7 @@ def index user_id: params[:user_id]) authorize! :read, points - present(points.as_json_with_exercise_ids(course.exercises)) + present(AwardedPoint.as_json_with_exercise_ids(points, course.exercises)) end end end diff --git a/app/controllers/api/v8/organizations/courses/exercises_controller.rb b/app/controllers/api/v8/organizations/courses/exercises_controller.rb index ec8cff354..6252b6dbf 100644 --- a/app/controllers/api/v8/organizations/courses/exercises_controller.rb +++ b/app/controllers/api/v8/organizations/courses/exercises_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -52,6 +53,7 @@ class ExercisesController < Api::V8::BaseController end end + sig { void } def index unauthorize_guest! course = Course.find_by!(name: "#{params[:organization_slug]}-#{params[:course_name]}") @@ -74,6 +76,7 @@ def index present(presentable) end + sig { void } def show authorization_skip! organization = Organization.find_by!(slug: params[:organization_slug]) @@ -140,6 +143,7 @@ def show ) end + sig { void } def download course = Course.find_by!(name: "#{params[:organization_slug]}-#{params[:course_name]}") exercise = Exercise.find_by!(name: params[:name], course_id: course.id) diff --git a/app/controllers/api/v8/organizations/courses/points_controller.rb b/app/controllers/api/v8/organizations/courses/points_controller.rb index 2155bae10..c06be0b7e 100644 --- a/app/controllers/api/v8/organizations/courses/points_controller.rb +++ b/app/controllers/api/v8/organizations/courses/points_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -28,11 +29,12 @@ class PointsController < Api::V8::BaseController end end + sig { void } def index course = Course.find_by!(name: "#{params[:organization_slug]}-#{params[:course_name]}") points = course.awarded_points.includes(:submission) authorize_collection :read, points - present points.as_json_with_exercise_ids(course.exercises) + present AwardedPoint.as_json_with_exercise_ids(points, course.exercises) end end end diff --git a/app/controllers/api/v8/organizations/courses/studyright_eligibility_controller.rb b/app/controllers/api/v8/organizations/courses/studyright_eligibility_controller.rb index 818b761ba..ff96fc485 100644 --- a/app/controllers/api/v8/organizations/courses/studyright_eligibility_controller.rb +++ b/app/controllers/api/v8/organizations/courses/studyright_eligibility_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -30,6 +31,7 @@ class StudyrightEligibilityController < Api::V8::BaseController skip_authorization_check + sig { void } def eligible_students unauthorize_guest! @@ -41,11 +43,11 @@ def eligible_students applied_students = UserAppDatum.where(field_name: 'applies_for_study_right', value: 't', namespace: 'ohjelmoinnin-mooc-2019').pluck(:user_id) - groups = course.exercise_groups[0..6] + course.exercise_groups[7..13] + groups = T.must(course.exercise_groups[0..6]) + T.must(course.exercise_groups[7..13]) cbu = course.exercise_group_completion_by_user - user_ids = groups.flat_map { |group| ap = cbu[group.name][:available_points]; cbu[group.name][:points_by_user].map { |k, v| { k => (v.to_f / ap) } } }.group_by { |o| o.keys.first }.map { |k, v| { k => v.map { |o2| o2[k] } } }.inject(:merge).select { |_k, v| v.length == groups.length }.select { |_k, v| v.all? { |o2| o2 >= 0.8995 } }.map { |k, _v| k } + user_ids = groups.flat_map { |group| ap = T.must(cbu[group.name])[:available_points]; T.must(cbu[group.name])[:points_by_user].map { |k, v| { k => (v.to_f / ap) } } }.group_by { |o| o.keys.first }.map { |k, v| { k => v.map { |o2| o2[k] } } }.inject(:merge).select { |_k, v| v.length == groups.length }.select { |_k, v| v.all? { |o2| o2 >= 0.8995 } }.map { |k, _v| k } eligble_ids = (user_ids & applied_students) users = User.where(id: eligble_ids) diff --git a/app/controllers/api/v8/organizations/courses/submissions_controller.rb b/app/controllers/api/v8/organizations/courses/submissions_controller.rb index f3ae4ead9..b2ff37a74 100644 --- a/app/controllers/api/v8/organizations/courses/submissions_controller.rb +++ b/app/controllers/api/v8/organizations/courses/submissions_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -39,6 +40,7 @@ class SubmissionsController < Api::V8::BaseController around_action :wrap_transaction + sig { void } def index unauthorize_guest! course = Course.find_by!(name: "#{params[:organization_slug]}-#{params[:course_name]}") diff --git a/app/controllers/api/v8/organizations/courses/users/points_controller.rb b/app/controllers/api/v8/organizations/courses/users/points_controller.rb index ee1534f25..1253e1a6f 100644 --- a/app/controllers/api/v8/organizations/courses/users/points_controller.rb +++ b/app/controllers/api/v8/organizations/courses/users/points_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -51,12 +52,13 @@ class PointsController < Api::V8::BaseController end end + sig { void } def index course = Course.find_by!(name: "#{params[:organization_slug]}-#{params[:course_name]}") params[:user_id] = current_user.id if params[:user_id] == 'current' points = course.awarded_points.includes(:submission).where(user_id: params[:user_id]) authorize_collection :read, points - present points.as_json_with_exercise_ids(course.exercises) + present AwardedPoint.as_json_with_exercise_ids(points, course.exercises) end end end diff --git a/app/controllers/api/v8/organizations/courses/users/progress_controller.rb b/app/controllers/api/v8/organizations/courses/users/progress_controller.rb index 98e43af65..d8a7fd265 100644 --- a/app/controllers/api/v8/organizations/courses/users/progress_controller.rb +++ b/app/controllers/api/v8/organizations/courses/users/progress_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -51,6 +52,7 @@ class ProgressController < Api::V8::BaseController end end + sig { void } def index unauthorize_guest! course = Course.find_by!(name: "#{params[:organization_slug]}-#{params[:course_name]}") @@ -64,7 +66,7 @@ def index { group: group, progress: info[:progress], - n_points: info[:awarded] + info[:late], + n_points: T.must(info[:awarded]) + T.must(info[:late]), max_points: info[:available_points], } end diff --git a/app/controllers/api/v8/organizations/courses/users/submissions_controller.rb b/app/controllers/api/v8/organizations/courses/users/submissions_controller.rb index 853589010..7aa792d96 100644 --- a/app/controllers/api/v8/organizations/courses/users/submissions_controller.rb +++ b/app/controllers/api/v8/organizations/courses/users/submissions_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -71,6 +72,7 @@ class SubmissionsController < Api::V8::BaseController around_action :wrap_transaction + sig { void } def index unauthorize_guest! course = Course.find_by!(name: "#{params[:organization_slug]}-#{params[:course_name]}") diff --git a/app/controllers/api/v8/organizations/courses_controller.rb b/app/controllers/api/v8/organizations/courses_controller.rb index 927be7147..6f420f530 100644 --- a/app/controllers/api/v8/organizations/courses_controller.rb +++ b/app/controllers/api/v8/organizations/courses_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -26,6 +27,7 @@ class CoursesController < Api::V8::BaseController end end + sig { void } def show unauthorize_guest! course = Course.find_by!(name: "#{params[:organization_slug]}-#{params[:name]}") diff --git a/app/controllers/api/v8/organizations/memberships_controller.rb b/app/controllers/api/v8/organizations/memberships_controller.rb index 99bc00803..b6b33b376 100644 --- a/app/controllers/api/v8/organizations/memberships_controller.rb +++ b/app/controllers/api/v8/organizations/memberships_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -57,6 +58,7 @@ class MembershipsController < Api::V8::BaseController end end + sig { void } def create unauthorize_guest! @@ -71,6 +73,7 @@ def create end end + sig { void } def index unauthorize_guest! diff --git a/app/controllers/api/v8/organizations_controller.rb b/app/controllers/api/v8/organizations_controller.rb index 0b7163d1b..657c51ef6 100644 --- a/app/controllers/api/v8/organizations_controller.rb +++ b/app/controllers/api/v8/organizations_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -45,6 +46,7 @@ class OrganizationsController < Api::V8::BaseController end end + sig { void } def index orgs = Organization .visible_organizations @@ -60,6 +62,7 @@ def index present(orgs) end + sig { void } def show org = Organization.find_by!(slug: params[:slug]) authorize! :read, org diff --git a/app/controllers/api/v8/user_app_datum_controller.rb b/app/controllers/api/v8/user_app_datum_controller.rb index 52303c8a2..5abd1049d 100644 --- a/app/controllers/api/v8/user_app_datum_controller.rb +++ b/app/controllers/api/v8/user_app_datum_controller.rb @@ -1,9 +1,11 @@ +# typed: strict # frozen_string_literal: true module Api module V8 class UserAppDatumController < Api::V8::BaseController skip_authorization_check + sig { void } def index only_admins! diff --git a/app/controllers/api/v8/user_field_value_controller.rb b/app/controllers/api/v8/user_field_value_controller.rb index 489c97a41..2a8a581d1 100644 --- a/app/controllers/api/v8/user_field_value_controller.rb +++ b/app/controllers/api/v8/user_field_value_controller.rb @@ -1,9 +1,11 @@ +# typed: strict # frozen_string_literal: true module Api module V8 class UserFieldValueController < Api::V8::BaseController skip_authorization_check + sig { void } def index only_admins! diff --git a/app/controllers/api/v8/users/assistantships_controller.rb b/app/controllers/api/v8/users/assistantships_controller.rb index 2b7b6378d..4c66916c4 100644 --- a/app/controllers/api/v8/users/assistantships_controller.rb +++ b/app/controllers/api/v8/users/assistantships_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -66,6 +67,7 @@ class AssistantshipsController < Api::V8::BaseController around_action :wrap_transaction + sig { void } def index unauthorize_guest! @@ -73,7 +75,7 @@ def index user = User.find(params[:user_id]) authorize! :read, user - assisted_courses = user.assistantships.pluck(:course_id) + assisted_courses = T.let(user.assistantships.pluck(:course_id), T::Array[Integer]) readable = Course.find(assisted_courses).map do |c| { 'course_id': c.id, diff --git a/app/controllers/api/v8/users/basic_info_by_emails_controller.rb b/app/controllers/api/v8/users/basic_info_by_emails_controller.rb index e3b3572e6..d595d4a8a 100644 --- a/app/controllers/api/v8/users/basic_info_by_emails_controller.rb +++ b/app/controllers/api/v8/users/basic_info_by_emails_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -58,6 +59,7 @@ class BasicInfoByEmailsController < Api::V8::BaseController skip_authorization_check + sig { void } def create return respond_forbidden unless current_user.administrator? users = params[:emails].map do |email| diff --git a/app/controllers/api/v8/users/basic_info_by_ids_controller.rb b/app/controllers/api/v8/users/basic_info_by_ids_controller.rb index b7f51e7b9..c7fad7402 100644 --- a/app/controllers/api/v8/users/basic_info_by_ids_controller.rb +++ b/app/controllers/api/v8/users/basic_info_by_ids_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -6,6 +7,7 @@ module Users class BasicInfoByIdsController < Api::V8::BaseController skip_authorization_check + sig { void } def create return respond_forbidden unless current_user.administrator? users = if params[:extra_fields] diff --git a/app/controllers/api/v8/users/basic_info_by_usernames_controller.rb b/app/controllers/api/v8/users/basic_info_by_usernames_controller.rb index e8a2186f0..2d6b20146 100644 --- a/app/controllers/api/v8/users/basic_info_by_usernames_controller.rb +++ b/app/controllers/api/v8/users/basic_info_by_usernames_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -58,6 +59,7 @@ class BasicInfoByUsernamesController < Api::V8::BaseController skip_authorization_check + sig { void } def create return respond_forbidden unless current_user.administrator? users = if params[:extra_fields] diff --git a/app/controllers/api/v8/users/password_reset_controller.rb b/app/controllers/api/v8/users/password_reset_controller.rb index 35f494b15..8acc23cea 100644 --- a/app/controllers/api/v8/users/password_reset_controller.rb +++ b/app/controllers/api/v8/users/password_reset_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -6,16 +7,17 @@ module Users class PasswordResetController < Api::V8::BaseController skip_authorization_check + sig { void } def create - @email = params['email'].to_s.strip - if @email.empty? + email = params['email'].to_s.strip + if email.empty? return render json: { success: false, errors: 'No email address provided' } end - user = User.find_by('lower(email) = ?', @email.downcase) + user = User.find_by('lower(email) = ?', email.downcase) unless user return render json: { success: false, @@ -25,7 +27,7 @@ def create key = ActionToken.generate_password_reset_key_for(user) # TODO: Whitelist origins - PasswordResetKeyMailer.reset_link_email(user, key, params['origin']).deliver + PasswordResetKeyMailer.reset_link_email(user, key, params['origin']).deliver_now render json: { success: true } diff --git a/app/controllers/api/v8/users/recently_changed_user_details_controller.rb b/app/controllers/api/v8/users/recently_changed_user_details_controller.rb index ff29f5d10..79be98b10 100644 --- a/app/controllers/api/v8/users/recently_changed_user_details_controller.rb +++ b/app/controllers/api/v8/users/recently_changed_user_details_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -6,9 +7,10 @@ module Users class RecentlyChangedUserDetailsController < Api::V8::BaseController skip_authorization_check + sig { void } def index return respond_forbidden unless current_user.administrator? - RecentlyChangedUserDetail.deleted.where('created_at < ?', DateTime.now - 1.week).update(email: nil) + RecentlyChangedUserDetail.deleted.where('created_at < ?', DateTime.now - 1.week).update(:all, email: nil) RecentlyChangedUserDetail.email_changed.where('created_at < ?', DateTime.now - 1.month).delete_all render json: { changes: RecentlyChangedUserDetail.all } end diff --git a/app/controllers/api/v8/users/request_deletion_controller.rb b/app/controllers/api/v8/users/request_deletion_controller.rb index c1baf2c2d..cf683195c 100644 --- a/app/controllers/api/v8/users/request_deletion_controller.rb +++ b/app/controllers/api/v8/users/request_deletion_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -6,6 +7,7 @@ module Users class RequestDeletionController < Api::V8::BaseController skip_authorization_check + sig { void } def create user = current_user user = User.find_by!(id: params[:user_id]) unless params[:user_id] == 'current' diff --git a/app/controllers/api/v8/users/teacherships_controller.rb b/app/controllers/api/v8/users/teacherships_controller.rb index 9469ad468..ad83061d4 100644 --- a/app/controllers/api/v8/users/teacherships_controller.rb +++ b/app/controllers/api/v8/users/teacherships_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module Api @@ -66,6 +67,7 @@ class TeachershipsController < Api::V8::BaseController around_action :wrap_transaction + sig { void } def index unauthorize_guest! @@ -73,7 +75,7 @@ def index user = User.find(params[:user_id]) authorize! :read, user - taught_organizations = user.teacherships.pluck(:organization_id) + taught_organizations = T.let(user.teacherships.pluck(:organization_id), T::Array[Integer]) readable = Organization.find(taught_organizations).map do |o| { 'organization_id': o.id, diff --git a/app/controllers/api/v8/users_controller.rb b/app/controllers/api/v8/users_controller.rb index 16d110f7d..b0bbca875 100644 --- a/app/controllers/api/v8/users_controller.rb +++ b/app/controllers/api/v8/users_controller.rb @@ -1,8 +1,10 @@ +# typed: strict # frozen_string_literal: true module Api module V8 class UsersController < Api::V8::BaseController + extend T::Sig include Swagger::Blocks swagger_path '/api/v8/users/{user_id}' do @@ -111,6 +113,7 @@ class UsersController < Api::V8::BaseController skip_authorization_check only: %i[set_password_managed_by_courses_mooc_fi destroy] + sig { void } def show unauthorize_guest! if current_user.guest? user = current_user @@ -125,7 +128,7 @@ def show } if params[:show_user_fields] - user_field = {} + user_field = T.let({}, T::Hash[String, T.any(String, T::Boolean)]) UserField.all.select { |f| f.visible_to?(current_user) }.each do |field| value_record = user.field_value_record(field) value = value_record.ruby_value @@ -135,7 +138,7 @@ def show end if params[:extra_fields] - extra_fields = {} + extra_fields = T.let({}, T::Hash[T.nilable(String), T.nilable(String)]) namespace = params[:extra_fields] UserAppDatum.where(namespace: namespace, user: user).each do |datum| extra_fields[datum.field_name] = datum.value @@ -145,71 +148,74 @@ def show render json: data end + sig { void } def create authorize! :create, User - @user = User.new + user = User.new - @user.login = SecureRandom.uuid + user.login = SecureRandom.uuid - set_email - set_password - set_user_fields - set_extra_data + set_email(user) + set_password(user) + set_user_fields(user) + set_extra_data(user) - if BannedEmail.banned?(@user.email) - return render json: build_success_response(params[:include_id]) + if BannedEmail.banned?(user.email) + return render json: build_success_response(user, params[:include_id]) end - if @user.errors.empty? && @user.save + if user.errors.empty? && user.save # TODO: Whitelist origins - UserMailer.email_confirmation(@user, params[:origin], params[:language]).deliver_now + UserMailer.email_confirmation(user, params[:origin], params[:language]).deliver_now # Post the new user to courses.mooc.fi for password management if params[:user][:password].present? - @user.post_new_user_to_courses_mooc_fi(params[:user][:password]) + user.post_new_user_to_courses_mooc_fi(params[:user][:password]) end - render json: build_success_response(params[:include_id]) + render json: build_success_response(user, params[:include_id]) else - errors = @user.errors - errors[:username] = errors.delete(:login) if errors.key?(:login) + errors = user.errors + T.unsafe(errors)[:username] = errors.delete(:login) if errors.key?(:login) render json: { success: false, - errors: @user.errors + errors: user.errors } end end + sig { void } def update unauthorize_guest! if current_user.guest? + user = current_user User.transaction do - @user = current_user - @user = User.find_by!(id: params[:id]) unless params[:id] == 'current' - @email_before = @user.email - authorize! :update, @user - set_user_fields - set_extra_data(true) - update_email - maybe_update_password - raise ActiveRecord::Rollback if !@user.errors.empty? || !@user.save + user = User.find_by!(id: params[:id]) unless params[:id] == 'current' + email_before = user.email + authorize! :update, user + set_user_fields(user) + set_extra_data(user, true) + update_email(user) + maybe_update_password(user) + raise ActiveRecord::Rollback if !user.errors.empty? || !user.save # Password changed locally: migrate the user to courses.mooc.fi - if params[:old_password].present? && params[:password].present? && !@user.managed_externally? - @user.post_new_user_to_courses_mooc_fi(params[:password]) + if params[:old_password].present? && params[:password].present? && !user.managed_externally? + user.post_new_user_to_courses_mooc_fi(params[:password]) end - RecentlyChangedUserDetail.email_changed.create!(old_value: @email_before, new_value: @user.email, username: @user.login, user_id: @user.id) unless @email_before.casecmp(@user.email).zero? + RecentlyChangedUserDetail.email_changed.create!(old_value: email_before, new_value: user.email, username: user.login, user_id: user.id) unless T.must(email_before.casecmp(user.email)).zero? return render json: { message: 'User details updated.' } end render json: { - errors: @user.errors + errors: user.errors }, status: :bad_request end # courses.mooc.fi retries account deletion and keys off success/already_deleted/code, so a # user that is already gone must answer 200, never 404. + sig { void } def destroy return render_destroy_failure('not_authorized', 'Authentication required', :unauthorized) if current_user.guest? @@ -238,6 +244,7 @@ def destroy render_destroy_failure('internal_error', 'User deletion failed.', :internal_server_error) end + sig { void } def set_password_managed_by_courses_mooc_fi only_admins! @@ -265,6 +272,7 @@ def set_password_managed_by_courses_mooc_fi }, status: :bad_request end + sig { void } def get_user_with_email unauthorize_guest! if current_user.guest? @@ -283,78 +291,84 @@ def get_user_with_email end private + sig { params(code: String, messages: T.any(String, T::Array[String]), status: Symbol).void } def render_destroy_failure(code, messages, status) render json: { success: false, code: code, errors: [*messages] }, status: status end - def set_email + sig { params(user: User).void } + def set_email(user) user_params = params[:user] - return unless @user.new_record? + return unless user.new_record? if user_params[:email].blank? - @user.errors.add(:email, 'needed') + user.errors.add(:email, 'needed') else - @user.email = user_params[:email].strip + user.email = user_params[:email].strip end end - def update_email + sig { params(user: User).void } + def update_email(user) user_params = params[:user] return unless user_params[:email] new_email = user_params[:email].strip if new_email.blank? - @user.errors.add(:email, 'needed') - elsif @user.email.casecmp(new_email) != 0 - @user.email = new_email - @user.email_verified = false - UserMailer.email_confirmation(@user, params[:origin], params[:language]).deliver_now + user.errors.add(:email, 'needed') + elsif user.email.casecmp(new_email) != 0 + user.email = new_email + user.email_verified = false + UserMailer.email_confirmation(user, params[:origin], params[:language]).deliver_now end end - def set_password + sig { params(user: User).void } + def set_password(user) user_params = params[:user] if user_params[:password].blank? - @user.errors.add(:password, 'needed') + user.errors.add(:password, 'needed') elsif user_params[:password].length > 1000 - @user.errors.add(:password, 'cannot be over 1000 characters') + user.errors.add(:password, 'cannot be over 1000 characters') elsif user_params[:password] != user_params[:password_confirmation] - @user.errors.add(:password_confirmation, 'did not match') + user.errors.add(:password_confirmation, 'did not match') else - @user.password = user_params[:password] + user.password = user_params[:password] end end - def maybe_update_password + sig { params(user: User).void } + def maybe_update_password(user) if params[:old_password].present? && params[:password].present? - if @user.managed_externally? - unless @user.update_password_via_courses_mooc_fi(params[:old_password], params[:password]) - @user.errors.add(:password, 'could not be changed. Please check your current password and try again.') + if user.managed_externally? + unless user.update_password_via_courses_mooc_fi(params[:old_password], params[:password]) + user.errors.add(:password, 'could not be changed. Please check your current password and try again.') end return - elsif @user.externally_managed_without_target? - @user.errors.add(:base, 'This account is being migrated; password changes are temporarily unavailable.') + elsif user.externally_managed_without_target? + user.errors.add(:base, 'This account is being migrated; password changes are temporarily unavailable.') return end - if !@user.has_password?(params[:old_password]) - @user.errors.add(:old_password, 'incorrect') + if !user.has_password?(params[:old_password]) + user.errors.add(:old_password, 'incorrect') elsif params[:password] != params[:password_repeat] - @user.errors.add(:password_repeat, 'did not match') + user.errors.add(:password_repeat, 'did not match') elsif params[:password].blank? - @user.errors.add(:password, 'cannot be empty') + user.errors.add(:password, 'cannot be empty') elsif params[:password].length > 1000 - @user.errors.add(:password, 'cannot be over 1000 characters') + user.errors.add(:password, 'cannot be over 1000 characters') else - @user.password = params[:password] + user.password = params[:password] end end end - def set_user_fields + sig { params(user: User).returns(T.nilable(T::Hash[String, T::Hash[Symbol, T.any(String, T::Boolean)]])) } + def set_user_fields(user) return if params[:user_field].nil? - changes = {} + changes = T.let({}, T::Hash[String, T::Hash[Symbol, T.any(String, T::Boolean)]]) UserField.all.select { |f| f.visible_to?(current_user) }.each do |field| - value_record = @user.field_value_record(field) + value_record = user.field_value_record(field) old_value = value_record.ruby_value value_record.set_from_form(params[:user_field][field.name]) new_value = value_record.ruby_value @@ -363,26 +377,28 @@ def set_user_fields changes end - def set_extra_data(eager_save = false) + sig { params(user: User, eager_save: T::Boolean).void } + def set_extra_data(user, eager_save = false) return unless params['user'] extra_fields = params['user']['extra_fields'] return if extra_fields.nil? namespace = extra_fields['namespace'] raise 'Namespace not defined' unless namespace extra_fields['data'].each do |key, value| - datum = @user.user_app_data.find_or_initialize_by(namespace: namespace, field_name: key) + datum = user.user_app_data.find_or_initialize_by(namespace: namespace, field_name: key) datum.value = value datum.save! if eager_save end end - def build_success_response(include_id = false) - response = { + sig { params(user: User, include_id: T.untyped).returns(T::Hash[Symbol, T.untyped]) } + def build_success_response(user, include_id = false) + response = T.let({ success: true, message: 'User created.', - } + }, T::Hash[Symbol, T.untyped]) if include_id - response[:id] = @user.id + response[:id] = user.id end response end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4e307cb1d..aa4dc658f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'version' @@ -8,6 +9,7 @@ # Includes common parts like handling some exceptions as well as # various utility methods. class ApplicationController < ActionController::Base + extend T::Sig include BreadCrumbs helper :all @@ -20,13 +22,12 @@ class ApplicationController < ActionController::Base include BootstrapFlashHelper include FlashBlockHelper include SessionsHelper - include BreadcrumbHelpers - include EmbeddableHelper include AuthorizeCollectionHelper include ApplicationHelper check_authorization rescue_from CanCan::AccessDenied do |_exception| + T.bind(self, ApplicationController) if current_user.guest? redirect_to(login_path(return_to: return_to_link)) else @@ -35,18 +36,22 @@ class ApplicationController < ActionController::Base end rescue_from ActiveRecord::RecordNotFound do |exception| + T.bind(self, ApplicationController) respond_with_error('Not found', 404, exception) end rescue_from ActionController::MissingFile do |exception| + T.bind(self, ApplicationController) respond_with_error('File not found', 404, exception) end rescue_from Rack::Timeout::RequestTimeoutException do |exception| + T.bind(self, ApplicationController) respond_with_error('Request timed out', 504, exception) # status code 408 would be the correct status code, but when receiving 408 Firefox retries 10 times and then states the connection was reset instead of showing our error end rescue_from Rack::Timeout::RequestTimeoutError do |exception| + T.bind(self, ApplicationController) respond_with_error('Request timed out', 504, exception) # status code 408 would be the correct status code, but when receiving 408 Firefox retries 10 times and then states the connection was reset instead of showing our error end @@ -56,6 +61,17 @@ class ApplicationController < ActionController::Base before_action :set_controller_and_action_name before_action :setup_rack_mini_profiler + sig { void } + def initialize + super + # Declared here because the breadcrumb helpers read them; subclasses assign them. + @organization = T.let(nil, T.nilable(Organization)) + @course = T.let(nil, T.nilable(Course)) + @exercise = T.let(nil, T.nilable(Exercise)) + @submission = T.let(nil, T.nilable(Submission)) + end + + sig { returns(T::Hash[Symbol, T.untyped]) } def url_options if @bare_layout { bare_layout: '1' }.merge(super) @@ -65,14 +81,17 @@ def url_options end private + sig { returns(::Ability) } def current_ability - @current_ability ||= ::Ability.new(current_user) + @current_ability ||= T.let(::Ability.new(current_user), T.nilable(::Ability)) end + sig { void } def set_default_url_options Rails.application.routes.default_url_options[:host] = request.host_with_port end + sig { void } def check_api_version if should_check_api_version? if params[:api_version].blank? @@ -91,6 +110,7 @@ def check_api_version end end + sig { params(client_name: T.untyped, client_version: T.untyped).void } def check_client_version(client_name, client_version) begin client_version = Version.new(client_version) unless client_version.nil? @@ -111,6 +131,7 @@ def check_client_version(client_name, client_version) end end + sig { returns(T::Boolean) } def should_check_api_version? params[:format] == 'json' && controller_name != 'stats' && @@ -119,49 +140,65 @@ def should_check_api_version? !(controller_path.starts_with? 'api') end + sig { void } def set_bare_layout - @bare_layout = !!params[:bare_layout] + @bare_layout = T.let(!!params[:bare_layout], T.nilable(T::Boolean)) + end + + sig { void } + def remove_x_frame_options_header_when_bare_layout + response.headers.except! 'X-Frame-Options' if @bare_layout end + sig { void } def set_controller_and_action_name - @controller_name = controller_name - @action_name = action_name + @controller_name = T.let(controller_name, T.nilable(String)) + @action_name = T.let(action_name, T.nilable(String)) end + sig { void } def setup_rack_mini_profiler - if current_user && current_user.administrator? + if current_user.administrator? Rack::MiniProfiler.authorize_request end end + sig { params(message: T.nilable(String)).returns(T.noreturn) } def unauthorized!(message = nil) raise CanCan::AccessDenied, message end + sig { params(message: String).void } def unauthorize_guest!(message = 'Authentication required') unauthorized!(message) if current_user.guest? end + sig { void } def only_admins! unauthorized! unless current_user.administrator? end + sig { void } def authorization_skip! authorize! :read, nil end + sig { params(msg: String).void } def respond_not_found(msg = 'Not Found') respond_with_error(msg, 404) end + sig { params(msg: String).void } def respond_forbidden(msg = 'Forbidden') respond_with_error(msg, 403) end + sig { params(msg: String).void } def respond_unauthorized(msg = 'Authentication required') respond_with_error(msg, 401) end + sig { params(msg: String, code: Integer, exception: T.nilable(Exception), extra_json_keys: T::Hash[Symbol, T.untyped]).void } def respond_with_error(msg, code = 500, exception = nil, extra_json_keys = {}) respond_to do |format| format.html do @@ -190,6 +227,7 @@ def respond_with_error(msg, code = 500, exception = nil, extra_json_keys = {}) end # To support older versions of tmc-netbeans-plugin + sig { returns(T::Boolean) } def client_supports_http_basic_auth? return true if params[:client].blank? client = params[:client] @@ -197,9 +235,10 @@ def client_supports_http_basic_auth? Version.new(params['client_version']) if params['client_version'].present? rescue StandardError end - !(client == 'netbeans_plugin' && client_version < Version.new('0.8.0')) + !(client == 'netbeans_plugin' && T.must(client_version) < Version.new('0.8.0')) end + sig { returns(String) } def select_layout if params[:bare_layout] 'bare' @@ -208,15 +247,17 @@ def select_layout end end + # permitted: :all, or the field names without the prefix. + sig { params(prefix: String, permitted: T.any(Symbol, T::Array[String]), options: T::Hash[Symbol, T.untyped]).returns(T::Hash[String, T.untyped]) } def params_starting_with(prefix, permitted, options = {}) options = { remove_prefix: false }.merge(options) - permitted = permitted.map { |f| prefix + f } unless permitted == :all + permitted = permitted.map { |f| prefix + f } if permitted.is_a?(Array) result = Hash[params.select do |k, v| - k.start_with?(prefix) && v.present? && (permitted == :all || permitted.include?(k)) + k.start_with?(prefix) && v.present? && (permitted == :all || (permitted.is_a?(Array) && permitted.include?(k))) end.permit(permitted)] if options[:remove_prefix] result = result.transform_keys { |k| k.sub(/^#{prefix}/, '') } @@ -226,6 +267,7 @@ def params_starting_with(prefix, permitted, options = {}) # To be called from a respond_to on csv. # http://stackoverflow.com/questions/94502/in-rails-how-to-return-records-as-a-csv-file + sig { params(options: T::Hash[Symbol, T.untyped]).void } def render_csv(options = {}) options = { filename: action_name @@ -250,7 +292,39 @@ def render_csv(options = {}) render render_options end + sig { params(block: T.proc.void).void } def wrap_transaction(&block) ActiveRecord::Base.transaction(requires_new: true, &block) end + + sig { void } + def add_organization_breadcrumb + organization = T.must(@organization) + add_breadcrumb "Organization #{organization.name}", organization_path(organization) + end + + sig { void } + def add_course_breadcrumb + add_organization_breadcrumb + course = T.must(@course) + add_breadcrumb "Course #{course.name}", organization_course_path(@organization, course) + end + + sig { void } + def add_exercise_breadcrumb + exercise = @exercise || @submission&.exercise + if exercise + add_breadcrumb "Exercise #{exercise.name}", exercise_path(exercise) + elsif @submission&.exercise_name + add_breadcrumb "(deleted exercise #{@submission.exercise_name}" + else + raise 'Neither @exercise nor @submission.exercise_name set' + end + end + + sig { void } + def add_submission_breadcrumb + submission = T.must(@submission) + add_breadcrumb "Submission ##{submission.id}", submission_path(submission) + end end diff --git a/app/controllers/auths_controller.rb b/app/controllers/auths_controller.rb index e79611689..859f3107c 100644 --- a/app/controllers/auths_controller.rb +++ b/app/controllers/auths_controller.rb @@ -1,13 +1,16 @@ +# typed: strict # frozen_string_literal: true # Provides an authentication service. class AuthsController < ApplicationController + extend T::Sig OK_MESSAGE = 'OK' FAIL_MESSAGE = 'FAIL' skip_authorization_check skip_before_action :verify_authenticity_token + sig { void } def show if params[:username].present? && params[:session_id].present? user = User.find_by(login: params[:username]) @@ -42,6 +45,7 @@ def show end private + sig { params(sid: T.untyped).returns(T.nilable(Session)) } def find_session_by_id(sid) # Can't say Session.find_by_session_id because of a nasty metaprogramming hax in AR's superclass. Session.where(session_id: sid).first diff --git a/app/controllers/breadcrumb_helpers.rb b/app/controllers/breadcrumb_helpers.rb deleted file mode 100644 index 06f98ae4f..000000000 --- a/app/controllers/breadcrumb_helpers.rb +++ /dev/null @@ -1,32 +0,0 @@ - -# frozen_string_literal: true - -# Helper methods for making breadcrumbs. -# -# See https://github.com/weppos/breadcrumbs_on_rails -module BreadcrumbHelpers # Included in ApplicationController - def add_organization_breadcrumb - add_breadcrumb "Organization #{@organization.name}", organization_path(@organization) - end - - def add_course_breadcrumb - add_organization_breadcrumb - add_breadcrumb "Course #{@course.name}", organization_course_path(@organization, @course) - end - - def add_exercise_breadcrumb - if @exercise - add_breadcrumb "Exercise #{@exercise.name}", exercise_path(@exercise) - elsif @submission&.exercise - add_breadcrumb "Exercise #{@submission.exercise.name}", exercise_path(@submission.exercise) - elsif @submission&.exercise_name - add_breadcrumb "(deleted exercise #{@submission.exercise_name}" - else - raise 'Neither @exercise nor @submission.exercise_name set' - end - end - - def add_submission_breadcrumb - add_breadcrumb "Submission ##{@submission.id}", submission_path(@submission) - end -end diff --git a/app/controllers/certificates_controller.rb b/app/controllers/certificates_controller.rb index afcbaeadf..9871b2be4 100644 --- a/app/controllers/certificates_controller.rb +++ b/app/controllers/certificates_controller.rb @@ -1,21 +1,27 @@ +# typed: strict # frozen_string_literal: true class CertificatesController < ApplicationController + extend T::Sig before_action :set_user, except: [:show] before_action :set_courses, except: [:show] before_action :add_certificate_breadcrumbs, except: [:show] + sig { void } def index authorize! :read, @user - @certificates = @user.certificates.order(:created_at).includes(:course) - @names = @certificates.map(&:name).uniq.sort + certificates = T.must(@user).certificates.order(:created_at).includes(:course) + @certificates = T.let(certificates, T.nilable(ActiveRecord::Relation)) + @names = T.let(certificates.map(&:name).uniq.sort, T.nilable(T::Array[T.nilable(String)])) - @certificate = Certificate.new(user: @user) + certificate = Certificate.new(user: @user) + @certificate = T.let(certificate, T.nilable(Certificate)) - last_certificate = @certificates.last - @certificate.name = last_certificate.name if last_certificate + last_certificate = certificates.last + certificate.name = last_certificate.name if last_certificate end + sig { void } def show certificate = Certificate.find params[:id] authorize! :read, certificate @@ -23,6 +29,7 @@ def show send_data certificate.pdf, type: :pdf, disposition: 'inline' end + sig { void } def create @certificate = Certificate.new certificate_params authorize! :read, @certificate.user @@ -39,25 +46,31 @@ def create end private + sig { returns(ActionController::Parameters) } def certificate_params params.require(:certificate).permit(:name, :user_id, :course_id) end + sig { void } def set_user id = params[:participant_id] || params[:certificate][:user_id] - @user = User.find(id) + @user = T.let(User.find(id), T.nilable(User)) end + sig { void } def set_courses - @courses = current_user.administrator? ? Course.where(certificate_downloadable: true).order(:name) : Course.with_certificates_for(@user) + courses = current_user.administrator? ? Course.where(certificate_downloadable: true).order(:name) : Course.with_certificates_for(@user) + @courses = T.let(courses, T.nilable(T::Enumerable[Course])) end + sig { void } def add_certificate_breadcrumbs - if @user == current_user - add_breadcrumb 'My stats', participant_path(@user) + user = T.must(@user) + if user == current_user + add_breadcrumb 'My stats', participant_path(user) elsif current_user.administrator? add_breadcrumb 'Participants', :participants_path - add_breadcrumb @user.display_name, participant_path(@user) + add_breadcrumb user.display_name, participant_path(user) end add_breadcrumb 'Certificate' end diff --git a/app/controllers/course_notifications_controller.rb b/app/controllers/course_notifications_controller.rb index 167c1ea04..b4ead18fe 100644 --- a/app/controllers/course_notifications_controller.rb +++ b/app/controllers/course_notifications_controller.rb @@ -1,18 +1,22 @@ +# typed: strict # frozen_string_literal: true # Handles emailing notification to every participant class CourseNotificationsController < ApplicationController + extend T::Sig before_action :set_organization + sig { void } def new course = Course.find(course_notification_params[:course_id]) authorize! :send_mail_to_participants, course - @notifier ||= CourseNotification.new + @notifier ||= T.let(CourseNotification.new, T.nilable(CourseNotification)) @course = Course.find_by(id: params[:course_id]) add_course_breadcrumb add_breadcrumb 'Course notification' end + sig { void } def create course = Course.find(course_notification_params[:course_id]) authorize! :send_mail_to_participants, course @@ -20,7 +24,8 @@ def create participants = User.course_students(course) emails = participants.map(&:email).reject(&:blank?) - notifier = course.course_notifications.create(course_notification_params[:course_notification].merge(sender_id: current_user.id)) + notification_attributes = T.let(course_notification_params[:course_notification].merge(sender_id: current_user.id), ActionController::Parameters) + notifier = course.course_notifications.create(notification_attributes) if notifier.message.blank? flash[:error] = 'Cannot send a blank message.' @@ -46,10 +51,12 @@ def create end private + sig { returns(ActionController::Parameters) } def course_notification_params params.permit(:commit, :course_id, course_notification: %i[topic message]) end + sig { void } def set_organization @organization = Organization.find_by(slug: params[:organization_id]) end diff --git a/app/controllers/course_templates_controller.rb b/app/controllers/course_templates_controller.rb index b76a576ed..28032cd92 100644 --- a/app/controllers/course_templates_controller.rb +++ b/app/controllers/course_templates_controller.rb @@ -1,25 +1,30 @@ +# typed: strict # frozen_string_literal: true class CourseTemplatesController < ApplicationController + extend T::Sig before_action :set_course_template, except: %i[index new create list_for_teachers] + sig { void } def index authorize! :read, CourseTemplate ordering = Arel.sql('LOWER(name)') add_breadcrumb 'Course templates', course_templates_path - @course_templates = CourseTemplate.not_hidden.not_dummy.order(ordering) - @hidden_course_templates = CourseTemplate.hidden.not_dummy.order(ordering) + @course_templates = T.let(CourseTemplate.not_hidden.not_dummy.order(ordering), T.nilable(ActiveRecord::Relation)) + @hidden_course_templates = T.let(CourseTemplate.hidden.not_dummy.order(ordering), T.nilable(ActiveRecord::Relation)) if request.params[:generate_report] - @refresh_report = CourseTemplateRefresh.find(request.params[:generate_report]) + @refresh_report = T.let(CourseTemplateRefresh.find(request.params[:generate_report]), T.nilable(CourseTemplateRefresh)) end end + sig { void } def show authorize! :read, CourseTemplate add_breadcrumb 'Course templates', course_templates_path - add_breadcrumb @course_template.title.to_s + add_breadcrumb T.must(@course_template).title.to_s end + sig { void } def new authorize! :create, CourseTemplate add_breadcrumb 'Course templates', course_templates_path @@ -27,12 +32,14 @@ def new @course_template = CourseTemplate.new end + sig { void } def edit authorize! :edit, CourseTemplate add_breadcrumb 'Course templates', course_templates_path add_breadcrumb 'Edit Course template' end + sig { void } def create authorize! :create, CourseTemplate @course_template = CourseTemplate.new(course_template_params) @@ -44,19 +51,23 @@ def create end end + sig { void } def update authorize! :edit, CourseTemplate - if @course_template.update(course_template_params) - redirect_to course_templates_path, notice: "Course template '#{@course_template.name}' was successfully updated." + course_template = T.must(@course_template) + if course_template.update(course_template_params) + redirect_to course_templates_path, notice: "Course template '#{course_template.name}' was successfully updated." else render :edit end end + sig { returns(T.noreturn) } def destroy raise 'One does not destroy a course template' end + sig { void } def list_for_teachers @organization = Organization.find_by(slug: params[:organization_id]) authorize! :teach, @organization @@ -65,25 +76,31 @@ def list_for_teachers @course_templates = CourseTemplate.available.order(Arel.sql('LOWER(title)')) end + sig { void } def toggle_hidden - @course_template.hidden = !@course_template.hidden - @course_template.save + course_template = T.must(@course_template) + course_template.hidden = !course_template.hidden + course_template.save redirect_to course_templates_path, notice: 'Course templates hidden status changed' end + sig { void } def refresh authorize! :create, CourseTemplate - notice = "Refresh initialized for course template #{@course_template.name}" - @course_template.refresh(current_user.id) - redirect_to course_templates_path(id: @course_template.id), notice: notice + course_template = T.must(@course_template) + notice = "Refresh initialized for course template #{course_template.name}" + course_template.refresh(current_user.id) + redirect_to course_templates_path(id: course_template.id), notice: notice end private + sig { void } def set_course_template authorize! params[:action].to_sym, CourseTemplate - @course_template = CourseTemplate.find(params[:id]) + @course_template = T.let(CourseTemplate.find(params[:id]), T.nilable(CourseTemplate)) end + sig { returns(ActionController::Parameters) } def course_template_params params.require(:course_template).permit(:name, :title, :description, :material_url, :source_url, :expires_at, :git_branch) end diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 48fb55028..1c001f651 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'natsort' @@ -7,11 +8,13 @@ require 'course_info' class CoursesController < ApplicationController + extend T::Sig before_action :set_organization before_action :set_course, except: %i[help index show_json] skip_authorization_check only: [:index] + sig { void } def index ordering = Arel.sql('hidden, disabled_status, LOWER(name)') @@ -20,7 +23,8 @@ def index redirect_to organization_path(@organization) end format.json do - courses = @organization.courses.ongoing.order(ordering) + organization = T.must(@organization) + courses = organization.courses.ongoing.order(ordering) courses = courses.select { |c| c.visible_to?(current_user) } authorize! :read, courses return respond_unauthorized('Authentication required') if current_user.guest? @@ -28,19 +32,21 @@ def index data = { api_version: ApiVersion::API_VERSION, - courses: CourseList.new(current_user, view_context).course_list_data(@organization, courses, opts) + courses: CourseList.new(current_user, view_context).course_list_data(organization, courses, opts) } render json: data.to_json end end end + sig { void } def show authorize! :read, @course + course = T.must(@course) - if (request.params[:generate_report]) && (can? :teach, @course) + if (request.params[:generate_report]) && (can? :teach, course) report = CourseTemplateRefresh.find(request.params[:generate_report]) - @refresh_report = report if report.course_template_id == @course.course_template_id + @refresh_report = T.let(report, T.nilable(CourseTemplateRefresh)) if report.course_template_id == course.course_template_id end respond_to do |format| @@ -53,7 +59,7 @@ def show opts = { include_points: !!params[:show_points], include_unlock_conditions: !!params[:show_unlock_conditions] } data = { api_version: ApiVersion::API_VERSION, - course: CourseInfo.new(current_user, view_context).course_data(@organization, @course, opts) + course: CourseInfo.new(current_user, view_context).course_data(T.must(@organization), course, opts) } render json: data.to_json end @@ -61,6 +67,7 @@ def show end # Method for teacher to give a single course for students to select. + sig { void } def show_json course = [Course.find(params[:id])] authorize! :read, course @@ -68,41 +75,52 @@ def show_json data = { api_version: ApiVersion::API_VERSION, - courses: CourseList.new(current_user, view_context).course_list_data(@organization, course) + courses: CourseList.new(current_user, view_context).course_list_data(T.must(@organization), course) } render json: data.to_json end + sig { void } def refresh authorize! :refresh, @course - refresh_course(@course) - redirect_to(organization_course_path(@organization, @course), notice: 'Refresh initialized, please wait') + course = T.must(@course) + refresh_course(course) + redirect_to(organization_course_path(@organization, course), notice: 'Refresh initialized, please wait') end + sig { void } def enable authorize! :teach, @organization # should assistants be able to enable/disable? - @course.enabled! - redirect_to(organization_course_path(@organization, @course), notice: 'Course was successfully enabled.') + course = T.must(@course) + course.enabled! + redirect_to(organization_course_path(@organization, course), notice: 'Course was successfully enabled.') end + sig { void } def disable authorize! :teach, @organization - @course.disabled! - redirect_to(organization_course_path(@organization, @course), notice: 'Course was successfully disabled.') + course = T.must(@course) + course.disabled! + redirect_to(organization_course_path(@organization, course), notice: 'Course was successfully disabled.') end + sig { void } def toggle_hidden authorize! :teach, @organization - @course.update!(hidden: !@course.hidden) - redirect_to(organization_course_path(@organization, @course), notice: "Course is now #{@course.hidden? ? 'hidden' : 'visible'}.") + course = T.must(@course) + course.update!(hidden: !course.hidden) + redirect_to(organization_course_path(@organization, course), notice: "Course is now #{course.hidden? ? 'hidden' : 'visible'}.") end + sig { void } def toggle_code_review_requests authorize! :teach, @organization - @course.update!(code_review_requests_enabled: !@course.code_review_requests_enabled) - redirect_to(organization_course_path(@organization, @course), notice: "Code review requests are now #{@course.code_review_requests_enabled? ? 'enabled' : 'disabled'}.") + course = T.must(@course) + course.update!(code_review_requests_enabled: !course.code_review_requests_enabled) + redirect_to(organization_course_path(@organization, course), notice: "Code review requests are now #{course.code_review_requests_enabled? ? 'enabled' : 'disabled'}.") end + sig { void } def manage_deadlines authorize! :manage_deadlines, @course add_course_breadcrumb @@ -110,15 +128,17 @@ def manage_deadlines assign_show_view_vars end + sig { void } def save_deadlines authorize! :manage_deadlines, @course + course = T.must(@course) groups = group_params groups.each do |name, deadlines| soft_deadlines = [deadlines[:soft][:static], deadlines[:soft][:unlock]].to_json hard_deadlines = [deadlines[:hard][:static], deadlines[:hard][:unlock]].to_json - @course.exercise_group_by_name(name).soft_group_deadline = soft_deadlines - @course.exercise_group_by_name(name).hard_group_deadline = hard_deadlines + T.must(course.exercise_group_by_name(name)).soft_group_deadline = soft_deadlines + T.must(course.exercise_group_by_name(name)).hard_group_deadline = hard_deadlines end exercises = params[:exercise] || {} @@ -126,18 +146,19 @@ def save_deadlines soft_deadlines = [deadlines[:soft][:static], deadlines[:soft][:unlock]].to_json hard_deadlines = [deadlines[:hard][:static], deadlines[:hard][:unlock]].to_json - exercise = Exercise.where(course_id: @course.id).find_by(name: name) + exercise = Exercise.where(course_id: course.id).find_by(name: name) next if exercise.nil? exercise.soft_deadline_spec = soft_deadlines exercise.deadline_spec = hard_deadlines exercise.save! end - redirect_to manage_deadlines_organization_course_path(@organization, @course), notice: 'Successfully saved deadlines.' + redirect_to manage_deadlines_organization_course_path(@organization, course), notice: 'Successfully saved deadlines.' rescue DeadlineSpec::InvalidSyntaxError => e - redirect_to manage_deadlines_organization_course_path(@organization, @course), alert: e.to_s + redirect_to manage_deadlines_organization_course_path(@organization, course), alert: e.to_s end + sig { void } def help @course = Course.find(params[:course_id]) authorize! :read, @course @@ -145,6 +166,7 @@ def help add_breadcrumb 'Help page' end + sig { void } def manage_unlocks authorize! :manage_unlocks, @course add_course_breadcrumb @@ -152,84 +174,100 @@ def manage_unlocks assign_show_view_vars end + sig { void } def save_unlocks authorize! :manage_unlocks, @course + course = T.must(@course) begin group_params.each do |name, conditions| array = conditions.values.reject(&:blank?) - group = @course.exercise_group_by_name(name) - Rails.logger.info "Unlock conditions of #{@course.name}/#{name} set by user #{current_user.id}: #{group.exercises(false).first&.unlock_spec || '[]'} -> #{array.to_json}" + group = T.must(course.exercise_group_by_name(name)) + Rails.logger.info "Unlock conditions of #{course.name}/#{name} set by user #{current_user.id}: #{group.exercises(false).first&.unlock_spec || '[]'} -> #{array.to_json}" group.group_unlock_conditions = array.to_json end ensure - UncomputedUnlock.create_all_for_course(@course) + UncomputedUnlock.create_all_for_course(course) end redirect_to manage_unlocks_organization_course_path, notice: 'Successfully set unlock dates.' rescue UnlockSpec::InvalidSyntaxError => e - redirect_to manage_unlocks_organization_course_path(@organization, @course), alert: e.to_s + redirect_to manage_unlocks_organization_course_path(@organization, course), alert: e.to_s end + sig { void } def manage_exercises authorize! :manage_exercises, @course + course = T.must(@course) add_course_breadcrumb add_breadcrumb 'Manage exercises' - @exercises = @course.exercises.natsort_by(&:name) - @exercises_id_map = @exercises.index_by { |e| e.id } + exercises = course.exercises.natsort_by(&:name) + @exercises = T.let(exercises, T.nilable(T::Array[Exercise])) + @exercises_id_map = T.let(exercises.index_by { |e| e.id }, T.nilable(T::Hash[Integer, Exercise])) end + sig { void } def toggle_submission_result_visibility authorize! :toggle_submission_result_visibility, @course - @course.toggle_submission_result_visiblity - redirect_to organization_course_path(@organization, @course), notice: "Exam mode is now #{@course.hide_submission_results ? 'enabled' : 'disabled'}" + course = T.must(@course) + course.toggle_submission_result_visiblity + redirect_to organization_course_path(@organization, course), notice: "Exam mode is now #{course.hide_submission_results ? 'enabled' : 'disabled'}" end private + sig { returns(ActionController::Parameters) } def course_params - if @course.custom? + if T.must(@course).custom? params.require(:course).permit(:title, :description, :material_url, :source_url, :git_branch, :external_scoreboard_url) else params.require(:course).permit(:title, :description, :material_url, :external_scoreboard_url) end end + sig { void } def assign_show_view_vars - @exercises = @course.exercises.includes(:course) - @exercises.preload(:unlocks).where(unlocks: { user: current_user }) - @exercises = @exercises.select { |ex| ex.visible_to?(current_user) } - .natsort_by(&:name) - @exercise_completion_status = ExerciseCompletionStatusGenerator.completion_status(current_user, @course) - @unlocks = @course.unlocked_exercise_names_for(current_user, @exercises) - - if can?(:teach, @course) - last_refresh = @course.course_template.course_template_refreshes.last - @refresh_initialized = last_refresh.status == 'in_progress' || last_refresh.status == 'not_started' if last_refresh + course = T.must(@course) + exercises = course.exercises.includes(:course) + exercises.preload(:unlocks).where(unlocks: { user: current_user }) + exercises = exercises.select { |ex| ex.visible_to?(current_user) } + .natsort_by(&:name) + @exercises = exercises + @exercise_completion_status = T.let(ExerciseCompletionStatusGenerator.completion_status(current_user, course), T.nilable(T::Hash[Integer, T.nilable(Integer)])) + @unlocks = T.let(course.unlocked_exercise_names_for(current_user, exercises), T.nilable(T::Set[T.nilable(String)])) + + if can?(:teach, course) + last_refresh = T.must(course.course_template).course_template_refreshes.last + @refresh_initialized = T.let(last_refresh.status == 'in_progress' || last_refresh.status == 'not_started', T.nilable(T::Boolean)) if last_refresh end unless current_user.guest? max_submissions = 100 - @submissions = @course.submissions - @submissions = @submissions.where(user_id: current_user.id) unless can? :teach, @course - @submissions = @submissions.order('created_at DESC').includes(:user) - @total_submissions = if can?(:teach, @course) - @course.submissions_count + submissions = course.submissions + submissions = submissions.where(user_id: current_user.id) unless can? :teach, course + submissions = submissions.order('created_at DESC').includes(:user) + total_submissions = if can?(:teach, course) + course.submissions_count else - @submissions.count + submissions.count end - @submissions = @submissions.limit(max_submissions) - Submission.eager_load_exercises(@submissions) + @total_submissions = T.let(total_submissions, T.nilable(Integer)) + submissions = submissions.limit(max_submissions) + @submissions = T.let(submissions, T.nilable(ActiveRecord::Relation)) + Submission.eager_load_exercises(submissions) end end + sig { void } def set_organization @organization = Organization.find_by!(slug: params[:organization_id]) unauthorized! unless @organization.visibility_allowed?(request, current_user) end + sig { void } def set_course @course = Course.find(params[:id]) end + sig { returns(T.any(ActionController::Parameters, T::Hash[T.untyped, T.untyped])) } def group_params sliced = params.slice(:group, :empty_group) groups = sliced[:group] || {} @@ -238,6 +276,7 @@ def group_params groups end + sig { params(course: Course).returns(CourseTemplateRefresh) } def refresh_course(course) course.refresh(current_user.id) end diff --git a/app/controllers/emails_controller.rb b/app/controllers/emails_controller.rb index 10420239e..1c1f78e9b 100644 --- a/app/controllers/emails_controller.rb +++ b/app/controllers/emails_controller.rb @@ -1,7 +1,10 @@ +# typed: strict # frozen_string_literal: true # Displays the raw list of participant e-mails, useful for mass-mailing scripts. class EmailsController < ApplicationController + extend T::Sig + sig { void } def index organization_id = params[:organization_id] course_id = params[:id] @@ -14,18 +17,21 @@ def index end private + sig { void } def index_global authorize! :view, :emails filter_params = params_starting_with('filter_', :all, remove_prefix: true) filter_params['include_administrators'] = '1' # Always include administrators. Could make this exclude_administrators instead - @emails = User.filter_by(filter_params).order(:email).map(&:email) + emails = User.filter_by(filter_params).order(:email).map(&:email) + @emails = T.let(emails, T.nilable(T::Array[String])) respond_to do |format| format.text do - render plain: @emails.join("\n") + render plain: emails.join("\n") end end end + sig { void } def index_course @course = Course.find(params[:id]) @organization = @course.organization @@ -35,12 +41,13 @@ def index_course add_course_breadcrumb add_breadcrumb('Students', organization_emails_path) - @students = User.course_students(@course) + students = User.course_students(@course) + @students = T.let(students, T.nilable(ActiveRecord::Relation)) respond_to do |format| format.html - format.text { render plain: @students.map { |s| s.email.to_s }.join("\n") } - format.csv { render plain: "Username,Email\n" + @students.map { |s| "#{s.username},#{s.email}" }.join("\n") } + format.text { render plain: students.map { |s| s.email.to_s }.join("\n") } + format.csv { render plain: "Username,Email\n" + students.map { |s| "#{s.username},#{s.email}" }.join("\n") } end end end diff --git a/app/controllers/exercise_status_controller.rb b/app/controllers/exercise_status_controller.rb index d5d87c74a..cb194efa9 100644 --- a/app/controllers/exercise_status_controller.rb +++ b/app/controllers/exercise_status_controller.rb @@ -1,23 +1,25 @@ +# typed: strict # frozen_string_literal: true class ExerciseStatusController < ApplicationController skip_authorization_check + sig { void } def show course_id = params[:course_id] user_id = params[:id] - course = Course.where(id: course_id).first || Course.where(name: course_id).first - user = User.where(id: user_id).first || User.where(login: user_id).first + course = T.must(Course.where(id: course_id).first || Course.where(name: course_id).first) + found_user = User.where(id: user_id).first || User.where(login: user_id).first return respond_forbidden unless course.visible_to?(Guest.new) || current_user.administrator? + user = T.must(found_user) user_subs = user.submissions.where(course_id: course.id).to_a.group_by(&:exercise_name) - user_subs.default = [] results = {} course.exercises.each do |ex| - ex.set_submissions_by!(user, user_subs[ex.name]) # used by completed_by? and attempted_by? + ex.set_submissions_by!(user, user_subs.fetch(T.must(ex.name), [])) # used by completed_by? and attempted_by? results[ex.name] = if ex.completed_by?(user) 'completed' elsif ex.attempted_by?(user) diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index d9e634818..c9daeb2e2 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -1,11 +1,13 @@ +# typed: strict # frozen_string_literal: true require 'submission_list' class ExercisesController < ApplicationController + sig { void } def show @exercise = Exercise.find(params[:id]) - @course = Course.lock('FOR SHARE').find(@exercise.course_id) + @course = Course.lock('FOR SHARE').find(T.must(@exercise.course_id)) @organization = @course.organization authorize! :read, @course authorize! :read, @exercise @@ -17,18 +19,19 @@ def show Course.transaction(requires_new: true) do if !current_user.guest? - @submissions = @exercise.submissions.order('submissions.created_at DESC') + submissions = @exercise.submissions.order('submissions.created_at DESC') - @submissions = @submissions.where(user_id: current_user.id) unless can? :teach, @course - @submissions = @submissions.includes(:awarded_points).includes(:user).includes(:course) - @submissions = @submissions.limit(50) unless !!params[:view_all] + submissions = submissions.where(user_id: current_user.id) unless can? :teach, @course + submissions = submissions.includes(:awarded_points).includes(:user).includes(:course) + submissions = submissions.limit(50) unless !!params[:view_all] + @submissions = T.let(submissions, T.nilable(ActiveRecord::Relation)) else @submissions = nil end authorize! :read, @submissions - @new_submission = Submission.new + @new_submission = T.let(Submission.new, T.nilable(Submission)) end end format.zip do @@ -60,6 +63,7 @@ def show end end + sig { void } def set_disabled_statuses @course = Course.find(params[:course_id]) @organization = @course.organization @@ -80,6 +84,7 @@ def set_disabled_statuses notice: 'Exercises successfully updated.' end + sig { void } def toggle_submission_result_visibility @exercise = Exercise.find(params[:id]) authorize! :toggle_submission_result_visibility, @exercise.course diff --git a/app/controllers/feedback_answers_charts_controller.rb b/app/controllers/feedback_answers_charts_controller.rb index 43be8e808..71407d3ee 100644 --- a/app/controllers/feedback_answers_charts_controller.rb +++ b/app/controllers/feedback_answers_charts_controller.rb @@ -1,6 +1,8 @@ +# typed: strict # frozen_string_literal: true class FeedbackAnswersChartsController < ApplicationController + sig { void } def show @course = Course.find(params[:course_id]) @organization = @course.organization @@ -25,9 +27,11 @@ def show end private + sig { void } def show_scatterplot - @questions = @course.feedback_questions.select(&:intrange?).sort_by(&:position) - if @questions.size == 2 + questions = T.must(@course).feedback_questions.select(&:intrange?).sort_by(&:position) + @questions = T.let(questions, T.nilable(T::Array[FeedbackQuestion])) + if questions.size == 2 render action: 'show_scatterplot', layout: 'bare' else respond_with_error('Scatterplot only available if there are exactly two numeric questions') diff --git a/app/controllers/feedback_answers_controller.rb b/app/controllers/feedback_answers_controller.rb index 203a8072a..3c9a7f67a 100644 --- a/app/controllers/feedback_answers_controller.rb +++ b/app/controllers/feedback_answers_controller.rb @@ -1,17 +1,21 @@ +# typed: strict # frozen_string_literal: true class FeedbackAnswersController < ApplicationController + extend T::Sig + sig { void } def index if params[:course_id] @course = Course.find(params[:course_id]) - @parent = @course - @numeric_stats = @course.exercises.where(hidden: false).sort.map do |ex| + @parent = T.let(@course, T.nilable(T.any(Course, Exercise))) + numeric_stats = @course.exercises.where(hidden: false).sort.map do |ex| [ex, FeedbackAnswer.numeric_answer_averages(ex), ex.submissions_having_feedback.count] end - @title = @course.title + @numeric_stats = T.let(numeric_stats, T.nilable(T::Array[[Exercise, T::Hash[Integer, Float], Integer]])) + @title = T.let(@course.title, T.nilable(String)) elsif params[:exercise_id] @exercise = Exercise.find(params[:exercise_id]) - @course = @exercise.course + @course = T.must(@exercise.course) @parent = @exercise @numeric_stats = [[@exercise, FeedbackAnswer.numeric_answer_averages(@exercise), @exercise.submissions_having_feedback.count]] @title = @exercise.name @@ -28,7 +32,8 @@ def index add_breadcrumb 'Feedback', organization_course_feedback_answers_path end - @numeric_questions = @course.feedback_questions.where("kind LIKE 'intrange%'").order(:position) + numeric_questions = @course.feedback_questions.where("kind LIKE 'intrange%'").order(:position) + @numeric_questions = T.let(numeric_questions, T.nilable(ActiveRecord::Relation)) respond_to do |format| format.html do @@ -36,20 +41,20 @@ def index authorize! :read_feedback_questions, @parent authorize! :read_feedback_answers, @parent - @text_answers = @parent.feedback_answers + @text_answers = T.let(T.must(@parent).feedback_answers .joins(:feedback_question) .joins(:submission) .joins(submission: :user) # .joins(:exercise) # fails due to :conditions of belongs_to receiving incorrect self :( .where(feedback_questions: { kind: 'text' }) .order('created_at DESC') - .all + .all, T.nilable(ActiveRecord::Relation)) end format.json do authorize! :read, @parent # We only deliver public statistics so no authorization required render json: { - numeric_questions: @numeric_questions.map do |q| + numeric_questions: numeric_questions.map do |q| { id: q.id, title: q.title, @@ -57,7 +62,7 @@ def index position: q.position } end, - numeric_stats: @numeric_stats.map do |ex, averages, answer_count| + numeric_stats: T.must(@numeric_stats).map do |ex, averages, answer_count| { exercise: { id: ex.id, @@ -73,14 +78,17 @@ def index end end + sig { void } def show - @answer = FeedbackAnswer.find(params[:id]) - authorize! :read, @answer - @course = @answer.course - @exercise = @answer.exercise + answer = FeedbackAnswer.find(params[:id]) + @answer = T.let(answer, T.nilable(FeedbackAnswer)) + authorize! :read, answer + @course = answer.course + @exercise = answer.exercise end # Create multiple answers at once + sig { void } def create submission = Submission.find(params[:submission_id]) authorize! :read, submission diff --git a/app/controllers/feedback_questions_controller.rb b/app/controllers/feedback_questions_controller.rb index b456dd014..ceb962461 100644 --- a/app/controllers/feedback_questions_controller.rb +++ b/app/controllers/feedback_questions_controller.rb @@ -1,26 +1,31 @@ +# typed: strict # frozen_string_literal: true # Handles the feedback question editing UI. class FeedbackQuestionsController < ApplicationController + extend T::Sig before_action :set_course before_action :set_organization + sig { void } def index add_course_breadcrumb add_breadcrumb 'Feedback questions' - @questions = @course.feedback_questions.order(:position) + @questions = T.let(T.must(@course).feedback_questions.order(:position), T.nilable(ActiveRecord::Relation)) authorize! :manage_feedback_questions, @course end + sig { void } def new - @question = FeedbackQuestion.new(course: @course) + @question = T.let(FeedbackQuestion.new(course: @course), T.nilable(FeedbackQuestion)) authorize! :manage_feedback_questions, @course add_course_breadcrumb add_breadcrumb 'Feedback questions', organization_course_feedback_questions_path(@organization, @course) add_breadcrumb 'Add new question' end + sig { void } def create @question = FeedbackQuestion.new(feedback_question_params[:feedback_question]) @question.course = @course @@ -37,9 +42,10 @@ def create end end + sig { void } def show @question = FeedbackQuestion.find(params[:id]) - @course = @question.course + @course = T.must(@question.course) @organization = @course.organization authorize! :manage_feedback_questions, @course add_course_breadcrumb @@ -47,9 +53,10 @@ def show add_breadcrumb "Question #{@question.title}" end + sig { void } def update @question = FeedbackQuestion.find(params[:id]) - @course = @question.course + @course = T.must(@question.course) @organization = @course.organization authorize! :manage_feedback_questions, @course @@ -65,9 +72,10 @@ def update end end + sig { void } def destroy @question = FeedbackQuestion.find(params[:id]) - @course = @question.course + @course = T.must(@question.course) @organization = @course.organization authorize! :manage_feedback_questions, @course @@ -82,20 +90,24 @@ def destroy end private + sig { returns(ActionController::Parameters) } def feedback_question_params params.permit({ feedback_question: %i[question title kind] }, :intrange_min, :intrange_max, :commit, :course_id) end + sig { void } def set_course @course = Course.find(params[:course_id]) if params[:course_id] authorize! :read, @course end + sig { params(question: FeedbackQuestion).void } def fix_question_kind(question) return unless question.kind == 'intrange' question.kind += "[#{params[:intrange_min]}..#{params[:intrange_max]}]" end + sig { void } def set_organization @organization = Organization.find_by(slug: params[:organization_id]) end diff --git a/app/controllers/feedback_replies_controller.rb b/app/controllers/feedback_replies_controller.rb index 5e6da6265..3cb143333 100644 --- a/app/controllers/feedback_replies_controller.rb +++ b/app/controllers/feedback_replies_controller.rb @@ -1,7 +1,9 @@ +# typed: strict # frozen_string_literal: true # Handles replying to a feedback answer by e-mail. class FeedbackRepliesController < ApplicationController + sig { void } def create answer = FeedbackAnswer.find(params['answer_id']) authorize! :reply_feedback_answer, answer diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index cc0f5f052..952e2a59d 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true # Shows the files of a submission. @@ -8,6 +9,7 @@ class FilesController < ApplicationController # This exists just to provide comapatability with old files url format # Cannot be redirected in routes, as rack_base_uri cannot be used for redirects. # - Jamox / 12.7.2014 + sig { void } def index redirect_to submission_path(params[:submission_id], anchor: 'files') end diff --git a/app/controllers/full_zip_controller.rb b/app/controllers/full_zip_controller.rb index 8ca87034a..33864d6dd 100644 --- a/app/controllers/full_zip_controller.rb +++ b/app/controllers/full_zip_controller.rb @@ -1,13 +1,15 @@ +# typed: strict # frozen_string_literal: true require 'submission_packager' class FullZipController < ApplicationController + sig { void } def index submission = Submission.find(params[:submission_id]) authorize! :download, submission - exercise = submission.exercise - base_name = "#{submission.user.login}-#{exercise.name}-#{submission.id}" + exercise = T.must(submission.exercise) + base_name = "#{T.must(submission.user).login}-#{exercise.name}-#{submission.id}" data = SubmissionPackager.new.get_full_zip(submission) send_data(data, filename: "#{base_name}_full.zip") end diff --git a/app/controllers/migrate_to_other_course_controller.rb b/app/controllers/migrate_to_other_course_controller.rb index 861b8bedd..13087efb3 100644 --- a/app/controllers/migrate_to_other_course_controller.rb +++ b/app/controllers/migrate_to_other_course_controller.rb @@ -1,21 +1,27 @@ +# typed: strict # frozen_string_literal: true require 'student_submission_migrator' class MigrateToOtherCourseController < ApplicationController + extend T::Sig + sig { void } def show - @old_course = Course.find(params[:course_id]) - @to_course = Course.find(params[:id]) + old_course = Course.find(params[:course_id]) + to_course = Course.find(params[:id]) + @old_course = T.let(old_course, T.nilable(Course)) + @to_course = T.let(to_course, T.nilable(Course)) - authorize! :read, @to_course + authorize! :read, to_course authorize! :read, current_user - @already_migrated = already_migrated - @extra_alert_text = get_extra_text + @already_migrated = T.let(already_migrated, T.nilable(T::Boolean)) + @extra_alert_text = T.let(get_extra_text, T.nilable(String)) return respond_with_error('Please login to continue') if current_user.guest? - respond_with_error('This migration is not allowed') unless StudentSubmissionMigrator.new(@old_course, @to_course, current_user).migration_is_allowed + respond_with_error('This migration is not allowed') unless StudentSubmissionMigrator.new(old_course, to_course, current_user).migration_is_allowed end + sig { void } def migrate @old_course = Course.find(params[:course_id]) @to_course = Course.find(params[:id]) @@ -33,23 +39,27 @@ def migrate end private + sig { returns(T::Boolean) } def check_understanding! - params[:from_course_name].strip == @old_course.name && - params[:to_course_name].strip == @to_course.name && - !!params[:im_sure] && - !already_migrated + return false unless params[:from_course_name].strip == T.must(@old_course).name + return false unless params[:to_course_name].strip == T.must(@to_course).name + return false unless params[:im_sure] + + !already_migrated end + sig { returns(T::Boolean) } def already_migrated - MigratedSubmissions.where(to_course_id: @to_course.id, original_submission_id: current_user.submissions.where(course: @old_course).pluck(:id)).any? + MigratedSubmissions.where(to_course_id: T.must(@to_course).id, original_submission_id: current_user.submissions.where(course: @old_course).pluck(:id)).any? end + sig { returns(T.nilable(String)) } def get_extra_text allowed_migrations = SiteSetting.value(:allow_migrations_between_courses) return nil if allowed_migrations.nil? allowed_migrations.each do |allowed_pair| puts allowed_pair - return allowed_pair['message'] if allowed_pair['from'] == @old_course.id && allowed_pair['to'] == @to_course.id + return allowed_pair['message'] if allowed_pair['from'] == T.must(@old_course).id && allowed_pair['to'] == T.must(@to_course).id end nil end diff --git a/app/controllers/model_solution_token_useds_controller.rb b/app/controllers/model_solution_token_useds_controller.rb index 28d1aa770..0392ebb67 100644 --- a/app/controllers/model_solution_token_useds_controller.rb +++ b/app/controllers/model_solution_token_useds_controller.rb @@ -1,25 +1,31 @@ +# typed: strict # frozen_string_literal: true class ModelSolutionTokenUsedsController < ApplicationController + extend T::Sig before_action :set_model_solution_token_used, only: [:show, :edit, :update, :destroy] before_action :only_admins # GET /model_solution_token_useds + sig { void } def index - @model_solution_token_useds = ModelSolutionTokenUsed.all + @model_solution_token_useds = T.let(ModelSolutionTokenUsed.all, T.nilable(ActiveRecord::Relation)) end # GET /model_solution_token_useds/1 + sig { void } def show end private # Use callbacks to share common setup or constraints between actions. + sig { void } def set_model_solution_token_used - @model_solution_token_used = ModelSolutionTokenUsed.find(params[:id]) + @model_solution_token_used = T.let(ModelSolutionTokenUsed.find(params[:id]), T.nilable(ModelSolutionTokenUsed)) end # Only allow a trusted parameter "white list" through. + sig { returns(ActionController::Parameters) } def model_solution_token_used_params params.require(:model_solution_token_used).permit(:user_id, :course_id, :exercise_name) end diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 5dd27ff9f..3cbeb68a2 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -1,118 +1,142 @@ +# typed: strict # frozen_string_literal: true require 'natsort' class OrganizationsController < ApplicationController + extend T::Sig before_action :set_organization, only: %i[show destroy verify disable disable_reason_input toggle_visibility all_courses] skip_authorization_check only: %i[index new all_courses] + sig { void } def index ordering = Arel.sql('hidden, LOWER(name)') - @organizations = Organization - .accepted_organizations - .with_attached_logo - .order(ordering) - .reject { |org| org.hidden? && !can?(:view_hidden_organizations, nil) || !org.visibility_allowed?(request, current_user) } - @my_organizations = Organization.taught_organizations(current_user).with_attached_logo.select { |org| org.visibility_allowed?(request, current_user) } - @my_organizations |= Organization.assisted_organizations(current_user).with_attached_logo.select { |org| org.visibility_allowed?(request, current_user) } - @my_organizations |= Organization.participated_organizations(current_user).with_attached_logo.select { |org| org.visibility_allowed?(request, current_user) } - @my_organizations.natsort_by!(&:name) - @courses_under_initial_refresh = Course.where(initial_refresh_ready: false) - @pinned_organizations = Organization - .accepted_organizations - .where(pinned: true) - .with_attached_logo - .order(ordering) - .select { |org| org.visibility_allowed?(request, current_user) } - .reject { |org| org.hidden? && !can?(:view_hidden_organizations, nil) } + organizations = Organization + .accepted_organizations + .with_attached_logo + .order(ordering) + .reject { |org| org.hidden? && !can?(:view_hidden_organizations, nil) || !org.visibility_allowed?(request, current_user) } + @organizations = T.let(organizations, T.nilable(T::Array[Organization])) + my_organizations = Organization.taught_organizations(current_user).with_attached_logo.select { |org| org.visibility_allowed?(request, current_user) } + my_organizations |= Organization.assisted_organizations(current_user).with_attached_logo.select { |org| org.visibility_allowed?(request, current_user) } + my_organizations |= Organization.participated_organizations(current_user).with_attached_logo.select { |org| org.visibility_allowed?(request, current_user) } + my_organizations.natsort_by!(&:name) + @my_organizations = T.let(my_organizations, T.nilable(T::Array[Organization])) + @courses_under_initial_refresh = T.let(Course.where(initial_refresh_ready: false), T.nilable(ActiveRecord::Relation)) + pinned_organizations = Organization + .accepted_organizations + .where(pinned: true) + .with_attached_logo + .order(ordering) + .select { |org| org.visibility_allowed?(request, current_user) } + .reject { |org| org.hidden? && !can?(:view_hidden_organizations, nil) } + @pinned_organizations = T.let(pinned_organizations, T.nilable(T::Array[Organization])) render layout: 'landing' end + sig { void } def show add_organization_breadcrumb + organization = T.must(@organization) ordering = Arel.sql('hidden, disabled_status, LOWER(courses.title)') - @my_assisted_courses = Course.assisted_courses(current_user, @organization).order(ordering).select { |c| c.visible_to?(current_user) } - @ongoing_courses = @organization - .courses - .ongoing - .enabled - .where(hidden: false) - .order(ordering) - .select { |c| c.visible_to?(current_user) } - .to_a - if can? :teach, @organization - recently_updated_disabled_courses = @organization.courses + my_assisted_courses = Course.assisted_courses(current_user, organization).order(ordering).select { |c| c.visible_to?(current_user) } + @my_assisted_courses = T.let(my_assisted_courses, T.nilable(T::Array[Course])) + ongoing_courses = organization + .courses + .ongoing + .enabled + .where(hidden: false) + .order(ordering) + .select { |c| c.visible_to?(current_user) } + .to_a + if can? :teach, organization + recently_updated_disabled_courses = organization.courses .ongoing .disabled .where(updated_at: Time.current.all_quarter) .to_a - @ongoing_courses += recently_updated_disabled_courses + ongoing_courses += recently_updated_disabled_courses end - authorize! :read, @ongoing_courses + @ongoing_courses = T.let(ongoing_courses, T.nilable(T::Array[Course])) + authorize! :read, ongoing_courses end + sig { void } def all_courses return respond_forbidden('This feature is only for teachers and administrators.') unless current_user.administrator? || current_user.teacher?(@organization) add_organization_breadcrumb add_breadcrumb 'All Courses' + organization = T.must(@organization) ordering = 'hidden, disabled_status, LOWER(courses.title)' - @my_assisted_courses = Course.assisted_courses(current_user, @organization).order(ordering).select { |c| c.visible_to?(current_user) } - @ongoing_courses = @organization.courses.ongoing.order(ordering).select { |c| c.visible_to?(current_user) } - @expired_courses = @organization.courses.expired.order(ordering).select { |c| c.visible_to?(current_user) } - authorize! :read, @ongoing_courses - authorize! :read, @expired_courses + @my_assisted_courses = Course.assisted_courses(current_user, organization).order(ordering).select { |c| c.visible_to?(current_user) } + ongoing_courses = organization.courses.ongoing.order(ordering).select { |c| c.visible_to?(current_user) } + expired_courses = organization.courses.expired.order(ordering).select { |c| c.visible_to?(current_user) } + @ongoing_courses = ongoing_courses + @expired_courses = T.let(expired_courses, T.nilable(T::Array[Course])) + authorize! :read, ongoing_courses + authorize! :read, expired_courses end + sig { void } def new redirect_to new_setup_organization_path end + sig { void } def list_requests authorize! :view, :unverified_organizations add_breadcrumb 'Unverified organizations' - @unverified_organizations = Organization.pending_organizations + @unverified_organizations = T.let(Organization.pending_organizations, T.nilable(ActiveRecord::Relation)) end + sig { void } def verify authorize! :verify, :unverified_organizations - if !@organization.verified - @organization.verified = true - @organization.verified_at = DateTime.now - @organization.save! - redirect_to organizations_path, notice: "Organization #{@organization.name} is now verified." + organization = T.must(@organization) + if !organization.verified + organization.verified = true + organization.verified_at = Time.current + organization.save! + redirect_to organizations_path, notice: "Organization #{organization.name} is now verified." else - redirect_to organization_path(@organization) + redirect_to organization_path(organization) end end + sig { void } def disable_reason_input authorize! :disable, Organization add_organization_breadcrumb add_breadcrumb 'Disable organization' end + sig { void } def disable authorize! :disable, Organization - if !@organization.disabled - @organization.disabled = true - @organization.disabled_reason = organization_params[:disabled_reason] - @organization.save - redirect_to list_requests_organizations_path, notice: "Organization #{@organization.name} successfully disabled." + organization = T.must(@organization) + if !organization.disabled + organization.disabled = true + organization.disabled_reason = organization_params[:disabled_reason] + organization.save + redirect_to list_requests_organizations_path, notice: "Organization #{organization.name} successfully disabled." else - redirect_to organization_path(@organization) + redirect_to organization_path(organization) end end + sig { void } def toggle_visibility authorize! :toggle_visibility, @organization - @organization.hidden = !@organization.hidden - @organization.save! - redirect_to organization_path, notice: "Organization is now #{@organization.hidden ? 'hidden to users' : 'visible to users'}" + organization = T.must(@organization) + organization.hidden = !organization.hidden + organization.save! + redirect_to organization_path, notice: "Organization is now #{organization.hidden ? 'hidden to users' : 'visible to users'}" end private + sig { params(courses: T.untyped, user: T.untyped).returns(T::Hash[T.untyped, T.untyped]) } def percent_completed_hash(courses, user) percent_completed = {} all_awarded = AwardedPoint.all_awarded(user) @@ -125,11 +149,13 @@ def percent_completed_hash(courses, user) percent_completed end + sig { void } def set_organization @organization = Organization.find_by!(slug: params[:id]) unauthorized! unless @organization.visibility_allowed?(request, current_user) end + sig { returns(ActionController::Parameters) } def organization_params params.require(:organization).permit(:name, :information, :logo, :slug, :contact_information, :phone, :email, :disabled_reason) end diff --git a/app/controllers/participants_controller.rb b/app/controllers/participants_controller.rb index c4a738ebc..3026ed1a4 100644 --- a/app/controllers/participants_controller.rb +++ b/app/controllers/participants_controller.rb @@ -1,11 +1,14 @@ +# typed: strict # frozen_string_literal: true require 'csv' require 'natcmp' class ParticipantsController < ApplicationController + extend T::Sig before_action :set_organization, only: [:index] + sig { void } def index if @organization.nil? authorize! :view, :participants_list @@ -19,36 +22,47 @@ def index end add_breadcrumb 'Participants' - @ordinary_fields = %w[username email] - @extra_fields = UserField.all - valid_fields = @ordinary_fields + @extra_fields.map(&:name) + ['include_administrators'] - - @filter_params = params_starting_with('filter_', valid_fields, remove_prefix: true) - @raw_filter_params = params_starting_with('filter_', valid_fields, remove_prefix: false) - - @column_params = params_starting_with('column_', valid_fields, remove_prefix: true) - @raw_column_params = params_starting_with('column_', valid_fields, remove_prefix: false) - @visible_columns = - if @column_params.empty? - @ordinary_fields + @extra_fields.select(&:show_in_participant_list?).map(&:name) + ordinary_fields = %w[username email] + extra_fields = UserField.all + @ordinary_fields = T.let(ordinary_fields, T.nilable(T::Array[String])) + @extra_fields = T.let(extra_fields, T.nilable(T::Array[UserField])) + valid_fields = ordinary_fields + extra_fields.map(&:name) + ['include_administrators'] + + filter_params = params_starting_with('filter_', valid_fields, remove_prefix: true) + @filter_params = T.let(filter_params, T.nilable(T::Hash[String, T.untyped])) + @raw_filter_params = T.let(params_starting_with('filter_', valid_fields, remove_prefix: false), T.nilable(T::Hash[String, T.untyped])) + + column_params = params_starting_with('column_', valid_fields, remove_prefix: true) + @column_params = T.let(column_params, T.nilable(T::Hash[String, T.untyped])) + @raw_column_params = T.let(params_starting_with('column_', valid_fields, remove_prefix: false), T.nilable(T::Hash[String, T.untyped])) + visible_columns = + if column_params.empty? + ordinary_fields + extra_fields.select(&:show_in_participant_list?).map(&:name) else - @column_params.keys + column_params.keys end + @visible_columns = T.let(visible_columns, T.nilable(T::Array[String])) - @courses = courses.order(:name).to_a + @courses = T.let(courses.order(:name).to_a, T.nilable(T::Array[Course])) + group_completion_course = T.let(nil, T.nilable(Course)) + group_completion = T.let(nil, T.nilable(T::Hash[String, T::Hash[Symbol, T.untyped]])) if params['group_completion_course_id'].present? - @group_completion_course = courses.find(params['group_completion_course_id']) - @group_completion = @group_completion_course.exercise_group_completion_by_user + group_completion_course = courses.find(params['group_completion_course_id']) + group_completion = group_completion_course.exercise_group_completion_by_user end + @group_completion_course = T.let(group_completion_course, T.nilable(Course)) + @group_completion = T.let(group_completion, T.nilable(T::Hash[String, T::Hash[Symbol, T.untyped]])) - @participants = users.filter_by(@filter_params).order(:login) + # filter_by is a User class method, which relations delegate to. + participants = T.unsafe(users).filter_by(filter_params).order(:login) - if @group_completion && params['show_with_no_points'].blank? - @participants = @participants.includes(:awarded_points).to_a.select do |user| - user.awarded_points.to_a.any? { |ap| ap.course_id == @group_completion_course.id } + if group_completion_course && params['show_with_no_points'].blank? + participants = participants.includes(:awarded_points).to_a.select do |user| + user.awarded_points.to_a.any? { |ap| ap.course_id == group_completion_course.id } end end + @participants = T.let(participants, T.nilable(T.any(ActiveRecord::Relation, T::Array[User]))) respond_to do |format| format.html @@ -61,12 +75,14 @@ def index end end + sig { void } def show - @user = User.find(params[:id]) - authorize! :view_participant_information, @user + user = User.find(params[:id]) + @user = T.let(user, T.nilable(User)) + authorize! :view_participant_information, user # TODO: bit ugly -- and now it's even worse! - @awarded_points = - AwardedPoint.where(id: AwardedPoint.all_awarded(@user)) + awarded_points = + AwardedPoint.where(id: AwardedPoint.all_awarded(user)) .to_a .sort! .group_by(&:course_id).transform_values do |course_points| @@ -75,65 +91,74 @@ def show late: course_points.select(&:awarded_after_soft_deadline?).map(&:name) } end - + @awarded_points = T.let(awarded_points, T.nilable(T::Hash[T.nilable(Integer), { awarded: T::Array[String], late: T::Array[String] }])) if current_user.administrator? add_breadcrumb 'Participants', :participants_path - add_breadcrumb @user.username, participant_path(@user) - @app_data = JSON.pretty_generate(JSON.parse(@user.user_app_data.to_json)) - @courses_mooc_fi_status = @user.courses_mooc_fi_migration_status - @courses_mooc_fi_status_label = courses_mooc_fi_status_label(@user, @courses_mooc_fi_status) - @courses_mooc_fi_force_migrate_available = !@user.managed_externally? || courses_mooc_fi_account_missing?(@courses_mooc_fi_status) + add_breadcrumb user.username, participant_path(user) + @app_data = T.let(JSON.pretty_generate(JSON.parse(user.user_app_data.to_json)), T.nilable(String)) + courses_mooc_fi_status = user.courses_mooc_fi_migration_status + @courses_mooc_fi_status = T.let(courses_mooc_fi_status, T.nilable(T::Hash[Symbol, T.untyped])) + @courses_mooc_fi_status_label = T.let(courses_mooc_fi_status_label(user, courses_mooc_fi_status), T.nilable(String)) + @courses_mooc_fi_force_migrate_available = T.let(!user.managed_externally? || courses_mooc_fi_account_missing?(courses_mooc_fi_status), T.nilable(T::Boolean)) else - add_breadcrumb 'My stats', participant_path(@user) + add_breadcrumb 'My stats', participant_path(user) end - @courses = [] - @missing_points = {} - @percent_completed = {} - @group_completion_counts = {} - @group_available_points = {} - for course_id in @awarded_points.keys + courses = T.let([], T::Array[Course]) + missing_points = T.let({}, T::Hash[T.nilable(Integer), T::Array[String]]) + percent_completed = T.let({}, T::Hash[T.nilable(Integer), Numeric]) + group_completion_counts = T.let({}, T::Hash[T.nilable(Integer), T::Hash[String, T::Hash[Symbol, Numeric]]]) + @courses = courses + @missing_points = T.let(missing_points, T.nilable(T::Hash[T.nilable(Integer), T::Array[String]])) + @percent_completed = T.let(percent_completed, T.nilable(T::Hash[T.nilable(Integer), Numeric])) + @group_completion_counts = T.let(group_completion_counts, T.nilable(T::Hash[T.nilable(Integer), T::Hash[String, T::Hash[Symbol, Numeric]]])) + @group_available_points = T.let({}, T.nilable(T::Hash[T.untyped, T.untyped])) + for course_id in awarded_points.keys course = Course.find(course_id) next if course.hide_submissions? - @courses << course + courses << course - awarded = @awarded_points[course.id] + awarded = T.must(awarded_points[course.id]) missing = AvailablePoint.course_points(course).order!.map(&:name) - awarded[:awarded] - awarded[:late] - @missing_points[course_id] = missing + missing_points[course_id] = missing - @percent_completed[course_id] = if awarded[:awarded].size + awarded[:late].size + missing.size > 0 + percent_completed[course_id] = if awarded[:awarded].size + awarded[:late].size + missing.size > 0 100 * ((awarded[:awarded].size.to_f + awarded[:late].size.to_f * course.soft_deadline_point_multiplier) / (awarded[:awarded].size + awarded[:late].size + missing.size)) else 0 end - @group_completion_counts[course_id] = course.exercise_group_completion_counts_for_user(@user) + group_completion_counts[course_id] = course.exercise_group_completion_counts_for_user(user) end - @submissions = if current_user.administrator? || current_user.id == @user.id - @user.submissions.order('created_at DESC').includes(:user).includes(:course) + submissions = if current_user.administrator? || current_user.id == user.id + user.submissions.order('created_at DESC').includes(:user).includes(:course) else # teacher and assistant sees only submissions for own teacherd courses - @user.submissions.order('created_at DESC').includes(:user, :course).where(course: current_user.teaching_in_courses) + user.submissions.order('created_at DESC').includes(:user, :course).where(course: current_user.teaching_in_courses) end - @submission_count = @submissions.count - @submissions = @submissions.limit(100) unless !!params[:view_all] + @submission_count = T.let(submissions.count, T.nilable(Integer)) + submissions = submissions.limit(100) unless !!params[:view_all] + @submissions = T.let(submissions, T.nilable(ActiveRecord::Relation)) - Submission.eager_load_exercises(@submissions) + Submission.eager_load_exercises(submissions) end + sig { void } def me authorize! :view_participant_information, current_user redirect_to participant_path(current_user) end + sig { void } def password_reset_link @user = User.find(params[:id]) authorize! :view_participant_information, @user return respond_forbidden('This feature is disabled for admin accounts') if @user.administrator? - @password_reset_link = @user.generate_password_reset_link + @password_reset_link = T.let(@user.generate_password_reset_link, T.nilable(String)) end + sig { void } def force_migrate_to_courses_mooc_fi @user = User.find(params[:id]) authorize! :view_participant_information, @user @@ -157,10 +182,12 @@ def force_migrate_to_courses_mooc_fi private # nil means the live status is unknown (unreachable/unconfigured) -- trust the local flag # instead of treating the account as missing. + sig { params(status: T.nilable(T::Hash[Symbol, T.untyped])).returns(T::Boolean) } def courses_mooc_fi_account_missing?(status) status.present? && (!status[:shadow_user_exists] || status[:deleted_at].present?) end + sig { params(user: User, status: T.nilable(T::Hash[Symbol, T.untyped])).returns(String) } def courses_mooc_fi_status_label(user, status) return 'Broken: flagged as migrated locally but missing the target id' if user.externally_managed_without_target? if user.managed_externally? @@ -171,12 +198,14 @@ def courses_mooc_fi_status_label(user, status) 'Not migrated' end + sig { returns(T::Hash[Symbol, T.untyped]) } def index_json_data + visible_columns = T.must(@visible_columns) result = [] - @participants.each do |user| - record = { id: user.id, username: user.login, email: user.email } - @extra_fields.each do |field| - if @visible_columns.include?(field.name) + T.must(@participants).each do |user| + record = T.let({ id: user.id, username: user.login, email: user.email }, T::Hash[T.any(Symbol, String), T.untyped]) + T.must(@extra_fields).each do |field| + if visible_columns.include?(field.name) record[field.name] = user.field_ruby_value(field) end end @@ -200,31 +229,37 @@ def index_json_data } end + sig { returns(String) } def index_csv + ordinary_fields = T.must(@ordinary_fields) + extra_fields = T.must(@extra_fields) + visible_columns = T.must(@visible_columns) + group_completion = @group_completion CSV.generate(force_quotes: true) do |csv| - title_row = (@ordinary_fields + @extra_fields.map(&:name)).select { |f| @visible_columns.include?(f) }.map(&:humanize) + title_row = (ordinary_fields + extra_fields.map(&:name)).select { |f| visible_columns.include?(f) }.map(&:humanize) - if @group_completion - completion_cols = @group_completion.keys.sort { |a, b| Natcmp.natcmp(a, b) } + completion_cols = T.let([], T::Array[String]) + if group_completion + completion_cols = group_completion.keys.sort { |a, b| Natcmp.natcmp(a, b) } title_row += completion_cols end csv << title_row - @participants.each do |user| + T.must(@participants).each do |user| row = [] - for field in @ordinary_fields - row << user.send(field) if @visible_columns.include?(field) + for field in ordinary_fields + row << user.send(field) if visible_columns.include?(field) end - for field in @extra_fields - if @visible_columns.include?(field.name) + for field in extra_fields + if visible_columns.include?(field.name) row << user.field_ruby_value(field) end end - if @group_completion + if group_completion for group in completion_cols - group_data = @group_completion[group] + group_data = T.must(group_completion[group]) points = group_data[:points_by_user][user.id] || 0 total = group_data[:available_points] percentage = format('%.3f%%', (points.to_f / total.to_f) * 100) @@ -238,6 +273,7 @@ def index_csv end private + sig { void } def set_organization @organization = Organization.find_by(slug: params[:organization_id]) unless params[:organization_id].nil? end diff --git a/app/controllers/password_reset_keys_controller.rb b/app/controllers/password_reset_keys_controller.rb index 53ff0b359..999d37ce8 100644 --- a/app/controllers/password_reset_keys_controller.rb +++ b/app/controllers/password_reset_keys_controller.rb @@ -1,31 +1,38 @@ +# typed: strict # frozen_string_literal: true class PasswordResetKeysController < ApplicationController + extend T::Sig skip_authorization_check add_breadcrumb 'Forgot password', ->(*_a) { }, only: %i[new show] + sig { void } def new; end + sig { void } def create - @email = params['email'].to_s.strip - if @email.empty? + email = params['email'].to_s.strip + @email = T.let(email, T.nilable(String)) + if email.empty? return redirect_to(new_password_reset_key_path, alert: 'No e-mail address provided') end - user = User.find_by('lower(email) = ?', @email.downcase) + user = User.find_by('lower(email) = ?', email.downcase) unless user return redirect_to(new_password_reset_key_path, alert: 'No such e-mail address registered') end key = ActionToken.generate_password_reset_key_for(user) - PasswordResetKeyMailer.reset_link_email(user, key).deliver + PasswordResetKeyMailer.reset_link_email(user, key).deliver_now end + sig { void } def show find_key_and_user end + sig { void } def destroy find_key_and_user @@ -39,33 +46,35 @@ def destroy return render action: :show, status: :forbidden end - if @user.managed_externally? - success = @user.update_password_via_courses_mooc_fi(nil, params[:password]) + user = T.must(@user) + key = T.must(@key) + if user.managed_externally? + success = user.update_password_via_courses_mooc_fi(nil, params[:password]) if success - @key.destroy + key.destroy flash[:success] = 'Your password has been reset.' redirect_to root_path else flash.now[:alert] = 'Failed to reset password.' render action: :show, status: :forbidden end - elsif @user.externally_managed_without_target? + elsif user.externally_managed_without_target? # Flagged as managed by courses.mooc.fi but with no id to delegate to. Do not fall back to a # local reset (authentication would ignore it); surface the misconfiguration instead. - Rails.logger.error("Password reset for user #{@user.id}: managed by courses.mooc.fi but missing courses_mooc_fi_user_id") + Rails.logger.error("Password reset for user #{user.id}: managed by courses.mooc.fi but missing courses_mooc_fi_user_id") flash.now[:alert] = 'This account cannot be reset right now. Please contact support.' render action: :show, status: :forbidden else - @user.password = params[:password] - if @user.save + user.password = params[:password] + if user.save # Not yet managed by courses.mooc.fi: migrate the user there with the new password - @user.post_new_user_to_courses_mooc_fi(params[:password]) - @key.destroy + user.post_new_user_to_courses_mooc_fi(params[:password]) + key.destroy flash[:success] = 'Your password has been reset.' redirect_to root_path else - flash.now[:alert] = if @user.errors[:password] - 'Password ' + @user.errors[:password].join(', ') + flash.now[:alert] = if user.errors[:password].any? + 'Password ' + user.errors[:password].join(', ') else 'Failed to set password' end @@ -75,10 +84,12 @@ def destroy end private + sig { void } def find_key_and_user token = params['token'] - @key = ActionToken.find_by(token: token) - raise ActiveRecord::RecordNotFound, 'Invalid password reset key' if @key.nil? || @key.expired? - @user = @key.user + key = ActionToken.find_by(token: token) + @key = T.let(key, T.nilable(ActionToken)) + raise ActiveRecord::RecordNotFound, 'Invalid password reset key' if key.nil? || key.expired? + @user = T.let(key.user, T.nilable(User)) end end diff --git a/app/controllers/points_controller.rb b/app/controllers/points_controller.rb index 2d973091c..97f70292b 100644 --- a/app/controllers/points_controller.rb +++ b/app/controllers/points_controller.rb @@ -1,11 +1,14 @@ +# typed: strict # frozen_string_literal: true require 'natsort' # Shows the points summary table and exercise group-specific tables. class PointsController < ApplicationController + extend T::Sig include PointsHelper before_action :set_organization + sig { void } def index @course = Course.find(params[:course_id]) authorize! :see_points, @course @@ -14,7 +17,7 @@ def index add_breadcrumb 'Points' if can?(:teach, @course) - @user_fields = UserField.all.select(&:show_in_participant_list?) + @user_fields = T.let(UserField.all.select(&:show_in_participant_list?), T.nilable(T::Array[UserField])) end only_for_user = User.find_by(login: params[:username]) @@ -23,19 +26,19 @@ def index if only_for_user exercises = @course.exercises.enabled.where(exercises: { hidden: false, hide_submission_results: false }) sheets = @course.gdocs_sheets(exercises).natsort - @summary = summary_hash(@course, exercises, sheets, only_for_user) - sort_summary(@summary, params[:sort_by]) if params[:sort_by] - @summary + summary = summary_hash(@course, exercises, sheets, only_for_user) + @summary = T.let(summary, T.nilable(T::Hash[Symbol, T.untyped])) + sort_summary(summary, params[:sort_by]) if params[:sort_by] else - @summary = Rails.cache.fetch("points_#{@course.id}_admin_#{current_user.administrator?}/", expires_in: 1.minute) do - exercises = @course.exercises.enabled.where(exercises: { hidden: false }) - exercises = exercises.where(hide_submission_results: false) unless current_user.administrator? - sheets = @course.gdocs_sheets(exercises).natsort - @summary = summary_hash(@course, exercises, sheets) - - @summary + course = @course + summary = Rails.cache.fetch("points_#{course.id}_admin_#{current_user.administrator?}/", expires_in: 1.minute) do + visible_exercises = course.exercises.enabled.where(exercises: { hidden: false }) + visible_exercises = visible_exercises.where(hide_submission_results: false) unless current_user.administrator? + visible_sheets = course.gdocs_sheets(visible_exercises).natsort + summary_hash(course, visible_exercises, visible_sheets) end - sort_summary(@summary, params[:sort_by]) if params[:sort_by] + @summary = summary + sort_summary(summary, params[:sort_by]) if params[:sort_by] end respond_to do |format| @@ -47,8 +50,10 @@ def index end end + sig { void } def show - @sheetname = params[:id] + sheetname = T.let(params[:id], String) + @sheetname = T.let(sheetname, T.nilable(String)) @course = Course.find(params[:course_id]) authorize! :see_points, @course return respond_unauthorized('Authentication required') if current_user.guest? @@ -59,20 +64,23 @@ def show add_course_breadcrumb add_breadcrumb 'Points', organization_course_points_path(@organization, @course) - add_breadcrumb @sheetname + add_breadcrumb sheetname - @exercises = Exercise.course_gdocs_sheet_exercises(@course, @sheetname, current_user.administrator?).includes(:available_points).order!(:name) - @users_to_points = AwardedPoint.per_user_in_course_with_sheet(@course, @sheetname, hidden: current_user.administrator?) + exercises = Exercise.course_gdocs_sheet_exercises(@course, sheetname, current_user.administrator?).includes(:available_points).order!(:name) + @exercises = T.let(exercises, T.nilable(ActiveRecord::Relation)) + users_to_points = AwardedPoint.per_user_in_course_with_sheet(@course, sheetname, hidden: current_user.administrator?) + @users_to_points = T.let(users_to_points, T.nilable(T::Hash[String, T::Array[String]])) - @users = @course.users.includes(:user_field_values) + users = @course.users.includes(:user_field_values) if params[:sort_by] == 'points' - @users = @users.sort_by do |u| - [-@users_to_points[u.login].size, u.login.downcase] + users = users.sort_by do |u| + [-users_to_points.fetch(u.login, []).size, u.login.downcase] end else - @users.order! + users.order! end - @users = [current_user] unless can?(:teach, @course) + users = [current_user] unless can?(:teach, @course) + @users = T.let(users, T.nilable(T.any(ActiveRecord::Relation, T::Array[User]))) respond_to do |format| format.html format.json do @@ -86,6 +94,7 @@ def show end private + sig { params(course: Course, visible_exercises: T::Enumerable[Exercise], sheets: T::Array[String], only_for_user: T.nilable(User)).returns(T::Hash[Symbol, T.untyped]) } def summary_hash(course, visible_exercises, sheets, only_for_user = nil) per_user_and_sheet = AwardedPoint.count_per_user_in_course_with_sheet(course, sheets, only_for_user, current_user.administrator?) @@ -118,6 +127,7 @@ def summary_hash(course, visible_exercises, sheets, only_for_user = nil) } end + sig { params(summary: T::Hash[Symbol, T.untyped], sorting: String).void } def sort_summary(summary, sorting) if sorting == 'total_points' summary[:users] = summary[:users].sort_by { |user| [-summary[:total_for_user][user.login].to_i, user.login] } @@ -127,6 +137,7 @@ def sort_summary(summary, sorting) end end + sig { void } def set_organization @organization = Organization.find_by(slug: params[:organization_id]) end diff --git a/app/controllers/positions_controller.rb b/app/controllers/positions_controller.rb index 3bfc331c4..c67b47d4b 100644 --- a/app/controllers/positions_controller.rb +++ b/app/controllers/positions_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true # Handles feedback questions reordering @@ -5,11 +6,12 @@ # This is poorly named. Also, as noted in FeedbackQuestionsController, # the feedback question editor probably shouldn't exist. class PositionsController < ApplicationController + sig { void } def update if params[:feedback_question_id] record = FeedbackQuestion.find(params[:feedback_question_id]) authorize! :manage_feedback_questions, record.course - redirect_dest = organization_course_feedback_questions_path(record.course.organization, record.course) + redirect_dest = organization_course_feedback_questions_path(T.must(record.course).organization, record.course) else return respond_not_found('Unknown resource to move') end diff --git a/app/controllers/results_controller.rb b/app/controllers/results_controller.rb index e11391560..6327374e4 100644 --- a/app/controllers/results_controller.rb +++ b/app/controllers/results_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'test_run_grader' @@ -7,6 +8,7 @@ class ResultsController < ApplicationController skip_authorization_check + sig { void } def create submission = Submission.find(params[:submission_id]) @@ -17,7 +19,7 @@ def create end SandboxResultsSaver.save_results(submission, filtered_params) - Rails.cache.delete("api_v8_core_submission_show_#{submission.id}_user_#{submission.user.id}") + Rails.cache.delete("api_v8_core_submission_show_#{submission.id}_user_#{submission.user_id}") rescue SandboxResultsSaver::InvalidTokenError respond_unauthorized('Invalid or expired token') else diff --git a/app/controllers/reviewed_submissions_controller.rb b/app/controllers/reviewed_submissions_controller.rb index 69310984a..98fd3e074 100644 --- a/app/controllers/reviewed_submissions_controller.rb +++ b/app/controllers/reviewed_submissions_controller.rb @@ -1,7 +1,9 @@ +# typed: strict # frozen_string_literal: true # Shows for admin the list of submissions that have already been reviewed. class ReviewedSubmissionsController < ApplicationController + sig { void } def index @course = Course.find(params[:course_id]) @organization = @course.organization @@ -10,10 +12,11 @@ def index add_breadcrumb 'Code reviews', organization_course_reviews_path(@organization, @course) add_breadcrumb 'Reviewed submissions' - @submissions = @course.submissions - .where(reviewed: true) - .includes(reviews: :reviewer) - .includes(:user) - .order('created_at DESC') + submissions = @course.submissions + .where(reviewed: true) + .includes(reviews: :reviewer) + .includes(:user) + .order('created_at DESC') + @submissions = T.let(submissions, T.nilable(ActiveRecord::Relation)) end end diff --git a/app/controllers/reviews_controller.rb b/app/controllers/reviews_controller.rb index 27ba84ab5..c76cf3e31 100644 --- a/app/controllers/reviews_controller.rb +++ b/app/controllers/reviews_controller.rb @@ -1,19 +1,24 @@ +# typed: strict # frozen_string_literal: true require 'natsort' # Presents the code review UI. class ReviewsController < ApplicationController + extend T::Sig before_action :set_organization, except: %i[new create] + sig { void } def index if params[:course_id] fetch :course - @organization = @course.organization - @my_reviews = @course.submissions - .where(user_id: current_user.id) - .where('requests_review OR requires_review OR reviewed') - .order('created_at DESC') + course = T.must(@course) + @organization = course.organization + my_reviews = course.submissions + .where(user_id: current_user.id) + .where('requests_review OR requires_review OR reviewed') + .order('created_at DESC') + @my_reviews = T.let(my_reviews, T.nilable(ActiveRecord::Relation)) respond_to do |format| format.html do @@ -27,58 +32,66 @@ def index end else fetch :submission, :files - raise "Submission's exercise has been moved or deleted" unless @submission.exercise + submission = T.must(@submission) + raise "Submission's exercise has been moved or deleted" unless submission.exercise - @course = @submission.course - @organization = @course.organization + course = T.must(submission.course) + @course = course + @organization = course.organization respond_to do |format| format.html do add_course_breadcrumb add_exercise_breadcrumb add_submission_breadcrumb - breadcrumb_label = @submission.reviews.count == 1 ? 'Code review' : 'Code reviews' - add_breadcrumb breadcrumb_label, submission_reviews_path(@submission) + breadcrumb_label = submission.reviews.count == 1 ? 'Code review' : 'Code reviews' + add_breadcrumb breadcrumb_label, submission_reviews_path(submission) render 'reviews/submission_index' end end end end + sig { void } def new fetch :submission, :files + submission = T.must(@submission) - @show_page_presence = true + @show_page_presence = T.let(true, T.nilable(T::Boolean)) - @course = @submission.course - @organization = @course.organization + course = T.must(submission.course) + @course = course + @organization = course.organization add_course_breadcrumb - add_breadcrumb 'Code reviews', organization_course_reviews_path(@organization, @course) + add_breadcrumb 'Code reviews', organization_course_reviews_path(@organization, course) add_breadcrumb 'Code review editor' - @new_review = Review.new( - submission_id: @submission.id, + @new_review = T.let(Review.new( + submission_id: submission.id, reviewer_id: current_user.id - ) - authorize! :create_review, @course + ), T.nilable(Review)) + authorize! :create_review, course render 'reviews/submission_index' end + sig { void } def create fetch :submission - @review = Review.new( - submission_id: @submission.id, + submission = T.must(@submission) + review = Review.new( + submission_id: submission.id, reviewer_id: current_user.id, review_body: params[:review][:review_body] ) - authorize! :create_review, @submission.course + @review = review + authorize! :create_review, submission.course begin ActiveRecord::Base.connection.transaction do award_points mark_as_reviewed - @review.submission.save! - @review.save! + T.must(review.submission).save! + review.save! end rescue StandardError ::Rails.logger.error($!) @@ -86,12 +99,14 @@ def create else flash[:success] = 'Code review added.' send_email_about_new_review if params[:send_email] - @course = @submission.course - @organization = @course.organization - redirect_to organization_course_reviews_path(@organization, @course) + course = T.must(submission.course) + @course = course + @organization = course.organization + redirect_to organization_course_reviews_path(@organization, course) end end + sig { void } def update fetch :review authorize! :update, @review @@ -104,21 +119,24 @@ def update end end + sig { void } def destroy fetch :review authorize! :delete, @review - if @review.destroy + review = T.must(@review) + if review.destroy flash[:success] = 'Code review deleted.' - redirect_to new_submission_review_path(@review.submission_id) + redirect_to new_submission_review_path(review.submission_id) else respond_with_error('Failed to delete code review.') end end private + sig { returns(T::Hash[Symbol, T.untyped]) } def course_reviews_json - submissions = @my_reviews.includes(reviews: %i[reviewer submission]) - exercises = @course.exercises.index_by { |e| e.name } + submissions = T.must(@my_reviews).includes(reviews: %i[reviewer submission]) + exercises = T.must(@course).exercises.index_by { |e| e.name } reviews = submissions.map do |s| s.reviews.map do |r| { @@ -133,13 +151,14 @@ def course_reviews_json } end + sig { params(exercises: T::Hash[T.nilable(String), Exercise], review: Review).returns(T::Hash[Symbol, T.untyped]) } def review_json(exercises, review) - available_points = exercises[review.submission.exercise_name].available_points.where(requires_review: true).map(&:name) + available_points = T.must(exercises[T.must(review.submission).exercise_name]).available_points.where(requires_review: true).map(&:name) points_not_awarded = available_points - review.points_list { id: review.id, marked_as_read: review.marked_as_read, - reviewer_name: review.reviewer.display_name, + reviewer_name: T.must(review.reviewer).display_name, review_body: review.review_body, points: review.points_list.natsort, points_not_awarded: points_not_awarded.natsort, @@ -150,18 +169,20 @@ def review_json(exercises, review) } end + sig { params(read: T::Boolean).void } def mark_as_read(read) which = read ? 'read' : 'unread' fetch :review authorize! (read ? :mark_as_read : :mark_as_unread), @review + review = T.must(@review) - @review.marked_as_read = read - if @review.save + review.marked_as_read = read + if review.save respond_to do |format| format.html do flash[:success] = "Code review marked as #{which}." - redirect_to submission_reviews_path(@review.submission) + redirect_to submission_reviews_path(review.submission) end format.json do render json: { status: 'OK' } @@ -172,27 +193,30 @@ def mark_as_read(read) end end + sig { void } def update_review fetch :review authorize! :update, @review - @review.review_body = params[:review][:review_body] + review = T.must(@review) + review.review_body = params[:review][:review_body] begin mark_as_reviewed award_points - @review.submission.save! - @review.save! + T.must(review.submission).save! + review.save! rescue StandardError ::Rails.logger.error($!) respond_with_error('Failed to save code review.') else flash[:success] = 'Code review edited. (No notification sent).' - redirect_to new_submission_review_path(@review.submission_id) + redirect_to new_submission_review_path(review.submission_id) end end + sig { void } def mark_as_reviewed - sub = @review.submission + sub = T.must(T.must(@review).submission) sub.reviewed = true sub.review_dismissed = false sub.of_same_kind @@ -201,6 +225,7 @@ def mark_as_reviewed .update_all(newer_submission_reviewed: true) end + sig { params(stuff: Symbol).void } def fetch(*stuff) if stuff.include? :course @course = Course.find(params[:course_id]) @@ -211,21 +236,24 @@ def fetch(*stuff) authorize! :read, @submission end if stuff.include? :review - @review = Review.find(params[:id]) + @review = T.let(Review.find(params[:id]), T.nilable(Review)) authorize! :read, @review end - @files = SourceFileList.for_submission(@submission) if stuff.include? :files + @files = T.let(SourceFileList.for_submission(T.must(@submission)), T.nilable(SourceFileList)) if stuff.include? :files end + sig { void } def send_email_about_new_review - ReviewMailer.review_email(@review).deliver + ReviewMailer.review_email(T.must(@review)).deliver_now end + sig { void } def award_points - submission = @review.submission + review = T.must(@review) + submission = T.must(review.submission) exercise = submission.exercise - course = exercise.course raise 'Exercise of submission has been moved or deleted' unless exercise + course = T.must(exercise.course) available_points = exercise.available_points.where(requires_review: true).map(&:name) previous_points = course.awarded_points.where(user_id: submission.user_id, name: available_points).map(&:name) @@ -248,11 +276,12 @@ def award_points end end - @review.points = (@review.points_list + new_points + previous_points).uniq.natsort.join(' ') + review.points = (review.points_list + new_points + previous_points).uniq.natsort.join(' ') submission.points = (submission.points_list + new_points + previous_points).uniq.natsort.join(' ') end private + sig { void } def set_organization @organization = Organization.find_by(slug: params[:organization_id]) end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 57d2b3034..718002ffa 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,9 +1,11 @@ +# typed: strict # frozen_string_literal: true # Handles login and logout. class SessionsController < ApplicationController skip_authorization_check + sig { void } def new session[:return_to] ||= params[:return_to] if signed_in? @@ -12,6 +14,7 @@ def new end end + sig { void } def create begin clear_expired_sessions @@ -22,7 +25,7 @@ def create case status when :accepted - sign_in user + sign_in T.must(user) try_to_redirect_back when :unavailable try_to_redirect_incorrect_login(alert: 'Login is temporarily unavailable. Please try again shortly.') @@ -33,12 +36,14 @@ def create end end + sig { void } def destroy sign_out try_to_redirect_back(notice: 'Goodbye') end private + sig { params(redirect_params: T::Hash[Symbol, T.untyped]).void } def try_to_redirect_back(redirect_params = {}) if session[:return_to].present? return_to = session.delete(:return_to) @@ -52,6 +57,7 @@ def try_to_redirect_back(redirect_params = {}) end end + sig { params(redirect_params: T::Hash[Symbol, T.untyped]).void } def try_to_redirect_incorrect_login(redirect_params = {}) if request.referer.present? redirect_to request.referer, redirect_params @@ -62,6 +68,7 @@ def try_to_redirect_incorrect_login(redirect_params = {}) end end + sig { void } def clear_expired_sessions Session.delete_expired end diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index c874603f0..c8fa5ac1c 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -1,33 +1,39 @@ +# typed: strict # frozen_string_literal: true class SettingsController < ApplicationController + extend T::Sig skip_authorization_check before_action :set_user + sig { void } def show authorize! :read, @user end + sig { void } def update authorize! :update, @user + user = T.must(@user) User.transaction do - @email_before = @user.email + email_before = user.email + @email_before = T.let(email_before, T.nilable(String)) set_email - password_changed = maybe_update_password(@user, params[:user]) + password_changed = maybe_update_password(user, params[:user]) set_user_fields - if @user.errors.empty? && @user.save + if user.errors.empty? && user.save # Password changed locally: migrate the user to courses.mooc.fi - @user.post_new_user_to_courses_mooc_fi(params[:user][:password]) if password_changed && !@user.managed_externally? - RecentlyChangedUserDetail.email_changed.create!(old_value: @email_before, new_value: @user.email, username: @user.login, user_id: @user.id) unless @email_before.casecmp(@user.email).zero? + user.post_new_user_to_courses_mooc_fi(params[:user][:password]) if password_changed && !user.managed_externally? + RecentlyChangedUserDetail.email_changed.create!(old_value: email_before, new_value: user.email, username: user.login, user_id: user.id) unless T.must(email_before.casecmp(user.email)).zero? flash[:notice] = if password_changed 'Changes saved and password changed' else 'Changes saved' end - redirect_to participant_settings_path(@user) + redirect_to participant_settings_path(user) else flash.now[:error] = 'Failed to save profile' render action: :show, status: :forbidden @@ -35,6 +41,7 @@ def update end end + sig { void } def dangerously_destroy_user @user = authenticate_current_user_destroy if @user.submissions.length != 0 @@ -54,39 +61,46 @@ def dangerously_destroy_user redirect_to root_url, notice: "The account #{username} (#{email}) has been permanently destroyed." end + sig { void } def verify_dangerously_destroying_user @user = authenticate_current_user_destroy end + sig { void } def user_has_submissions @user = authenticate_current_user_destroy end private + sig { returns(User) } def authenticate_current_user_destroy user = User.find(params[:participant_id]) authorize! :destroy, user user end + sig { void } def set_user - @user = User.find(params[:participant_id]) + @user = T.let(User.find(params[:participant_id]), T.nilable(User)) end + sig { void } def set_email + user = T.must(@user) user_params = params[:user] - return if !@user.new_record? && user_params[:email_repeat].blank? + return if !user.new_record? && user_params[:email_repeat].blank? if user_params[:email].blank? - @user.errors.add(:email, 'needed') + user.errors.add(:email, 'needed') elsif user_params[:email] != user_params[:email_repeat] - @user.errors.add(:email_repeat, 'did not match') + user.errors.add(:email_repeat, 'did not match') else - @user.email = user_params[:email].strip + user.email = user_params[:email].strip end end + sig { params(user: User, user_params: T.untyped).returns(T::Boolean) } def maybe_update_password(user, user_params) if user_params[:old_password].present? || user_params[:password].present? if user.managed_externally? @@ -116,11 +130,12 @@ def maybe_update_password(user, user_params) end end + sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) } def set_user_fields return if params[:user_field].nil? changes = {} UserField.all.select { |f| f.visible_to?(current_user) }.each do |field| - value_record = @user.field_value_record(field) + value_record = T.must(@user).field_value_record(field) old_value = value_record.ruby_value value_record.set_from_form(params[:user_field][field.name]) new_value = value_record.ruby_value diff --git a/app/controllers/setup/course_assistants_controller.rb b/app/controllers/setup/course_assistants_controller.rb index e2f4a94df..61b64cef6 100644 --- a/app/controllers/setup/course_assistants_controller.rb +++ b/app/controllers/setup/course_assistants_controller.rb @@ -1,57 +1,64 @@ +# typed: strict # frozen_string_literal: true class Setup::CourseAssistantsController < Setup::SetupController before_action :set_course + sig { void } def index authorize! :modify_assistants, @course - @setup_in_progress = setup_in_progress? + course = T.must(@course) + @setup_in_progress = T.let(setup_in_progress?, T.nilable(T::Boolean)) - @assistants = @course.assistants - @assistantship = Assistantship.new + @assistants = T.let(course.assistants, T.nilable(ActiveRecord::Relation)) + @assistantship = T.let(Assistantship.new, T.nilable(Assistantship)) if setup_in_progress? print_setup_phases(3) else - add_breadcrumb("Assistants for course #{@course.title}") + add_breadcrumb("Assistants for course #{course.title}") end end + sig { void } def create authorize! :modify_assistants, @course + course = T.must(@course) if params[:commit] == 'Add new assistant' new_assistant = User.find_by('lower(email) = ?', assistant_params[:email].downcase) - @assistantship = Assistantship.new(user: new_assistant, course: @course) + @assistantship = Assistantship.new(user: new_assistant, course: course) if @assistantship.save - redirect_to setup_organization_course_course_assistants_path, notice: "Assistant #{new_assistant.email} added" + redirect_to setup_organization_course_course_assistants_path, notice: "Assistant #{T.must(new_assistant).email} added" else @setup_in_progress = setup_in_progress? - @assistants = @course.assistants + @assistants = course.assistants if setup_in_progress? print_setup_phases(3) else - add_breadcrumb("Assistants for course #{@course.title}") + add_breadcrumb("Assistants for course #{course.title}") end render :index end elsif params[:commit] == 'Continue' redirect_to setup_organization_course_course_finisher_index_path else - redirect_to organization_course_path(@organization, @course) + redirect_to organization_course_path(@organization, course) end end + sig { void } def destroy authorize! :modify_assistants, @course @assistantship = Assistantship.find(params[:id]) - destroyed_email = @assistantship.user.email + destroyed_email = T.must(@assistantship.user).email @assistantship.destroy! redirect_to setup_organization_course_course_assistants_path, notice: "Assistant #{destroyed_email} removed from course." end private + sig { returns(ActionController::Parameters) } def assistant_params params.permit(:email) end diff --git a/app/controllers/setup/course_chooser_controller.rb b/app/controllers/setup/course_chooser_controller.rb index 1e65d0800..a67a37c88 100644 --- a/app/controllers/setup/course_chooser_controller.rb +++ b/app/controllers/setup/course_chooser_controller.rb @@ -1,17 +1,21 @@ +# typed: strict # frozen_string_literal: true class Setup::CourseChooserController < Setup::SetupController + extend T::Sig before_action :set_course_from_session + sig { void } def index authorize! :teach, @organization save_wizard_to_session(1) print_setup_phases(1) - @course_templates = CourseTemplate.available.order(Arel.sql('LOWER(title)')) - @setup_in_progress = setup_in_progress? + @course_templates = T.let(CourseTemplate.available.order(Arel.sql('LOWER(title)')), T.nilable(ActiveRecord::Relation)) + @setup_in_progress = T.let(setup_in_progress?, T.nilable(T::Boolean)) end private + sig { void } def set_course_from_session if setup_in_progress? && !session[:ongoing_course_setup][:course_id].nil? @course = Course.find(session[:ongoing_course_setup][:course_id]) diff --git a/app/controllers/setup/course_details_controller.rb b/app/controllers/setup/course_details_controller.rb index f710770d4..2752b7334 100644 --- a/app/controllers/setup/course_details_controller.rb +++ b/app/controllers/setup/course_details_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'course_refresh_database_updater' @@ -5,50 +6,56 @@ class Setup::CourseDetailsController < Setup::SetupController before_action :set_course, except: %i[new create] + sig { void } def new authorize! :teach, @organization - @course_template = CourseTemplate.find(params[:template_id]) - authorize! :clone, @course_template + course_template = CourseTemplate.find(params[:template_id]) + @course_template = T.let(course_template, T.nilable(CourseTemplate)) + authorize! :clone, course_template print_setup_phases(2) - @course = Course.new_from_template(@course_template) + @course = Course.new_from_template(course_template) @course.organization = @organization end + sig { void } def custom authorize! :create_custom_course, @organization print_setup_phases(2) @course = Course.new @course.organization = @organization - @custom = true + @custom = T.let(true, T.nilable(T::Boolean)) render 'new' end + sig { void } def create authorize! :teach, @organization custom = params[:course][:course_template_id].blank? authorize! :create_custom_course, @organization if custom + organization = T.must(@organization) + create_params = custom ? course_params_for_create_custom : course_params_for_create_from_template input_name = create_params[:name] - create_params[:name] = @organization.slug + '-' + input_name + create_params[:name] = T.must(organization.slug) + '-' + input_name @course = Course.new(create_params) @course.organization = @organization if @course.save # Do refresh if custom course and course_template first course - if custom || !@course.course_template.cache_exists? + if custom || !T.must(@course.course_template).cache_exists? refresh_course(@course) else - template_refresh = @course.course_template.course_template_refreshes.last + template_refresh = T.must(T.must(@course.course_template).course_template_refreshes.last) CourseRefreshDatabaseUpdater.new.refresh_course(@course, template_refresh[:langs_refresh_output]) end update_setup_course(@course.id) - redirect_to setup_organization_course_course_assistants_path(@organization.slug, @course.id) + redirect_to setup_organization_course_course_assistants_path(organization.slug, @course.id) else @course_template = @course.course_template unless custom @course.name = input_name @@ -58,9 +65,10 @@ def create end end + sig { void } def edit authorize! :teach, @organization - @setup_in_progress = setup_in_progress? + @setup_in_progress = T.let(setup_in_progress?, T.nilable(T::Boolean)) if setup_in_progress? print_setup_phases(2) else @@ -69,14 +77,17 @@ def edit end end + sig { void } def update authorize! :teach, @organization - if @course.update(course_params) + organization = T.must(@organization) + course = T.must(@course) + if course.update(course_params) if setup_in_progress? - redirect_to setup_organization_course_course_assistants_path(@organization.slug, @course.id), + redirect_to setup_organization_course_course_assistants_path(organization.slug, course.id), notice: 'Course details updated.' else - redirect_to organization_course_path(@organization, @course), notice: 'Course details updated.' + redirect_to organization_course_path(organization, course), notice: 'Course details updated.' end else render :edit @@ -84,20 +95,24 @@ def update end private + sig { params(course: Course).returns(CourseTemplateRefresh) } def refresh_course(course) course.refresh(current_user.id) end + sig { returns(ActionController::Parameters) } def course_params_for_create_from_template params.require(:course).permit(:name, :title, :description, :material_url, :course_template_id, :moocfi_id) end + sig { returns(ActionController::Parameters) } def course_params_for_create_custom params.require(:course).permit(:name, :title, :description, :material_url, :source_url, :git_branch, :source_backend, :moocfi_id) end + sig { returns(ActionController::Parameters) } def course_params - if @course.custom? + if T.must(@course).custom? params.require(:course).permit(:title, :description, :material_url, :source_url, :git_branch, :external_scoreboard_url, :moocfi_id) else params.require(:course).permit(:title, :description, :material_url, :external_scoreboard_url, :moocfi_id) diff --git a/app/controllers/setup/course_finisher_controller.rb b/app/controllers/setup/course_finisher_controller.rb index 519c788db..a6a2ef19e 100644 --- a/app/controllers/setup/course_finisher_controller.rb +++ b/app/controllers/setup/course_finisher_controller.rb @@ -1,8 +1,10 @@ +# typed: strict # frozen_string_literal: true class Setup::CourseFinisherController < Setup::SetupController before_action :set_course + sig { void } def index authorize! :teach, @organization unless setup_in_progress? @@ -11,18 +13,20 @@ def index print_setup_phases(4) end + sig { void } def create authorize! :teach, @organization + course = T.must(@course) if params[:commit] == 'Publish now' - @course.enabled! - @course.save! + course.enabled! + course.save! elsif params[:commit] == 'Finish and publish later' - @course.disabled! - @course.save! + course.disabled! + course.save! end reset_setup_session - redirect_to organization_course_path(@organization, @course) + redirect_to organization_course_path(@organization, course) end end diff --git a/app/controllers/setup/course_timings_controller.rb b/app/controllers/setup/course_timings_controller.rb index bd965f849..6bc40d4f5 100644 --- a/app/controllers/setup/course_timings_controller.rb +++ b/app/controllers/setup/course_timings_controller.rb @@ -1,13 +1,15 @@ +# typed: strict # frozen_string_literal: true # Deprecated class Setup::CourseTimingsController < Setup::SetupController before_action :set_course + sig { void } def show authorize! :teach, @organization - @setup_in_progress = setup_in_progress? + @setup_in_progress = T.let(setup_in_progress?, T.nilable(T::Boolean)) if setup_in_progress? print_setup_phases(3) else @@ -15,9 +17,10 @@ def show add_breadcrumb('Timing') end - @group_array = groups_as_array + @group_array = T.let(groups_as_array, T.nilable(T::Array[String])) end + sig { void } def update authorize! :teach, @organization @@ -76,8 +79,10 @@ def update end private + sig { void } def save_unlocks authorize! :manage_unlocks, @course + course = T.must(@course) groups = group_params groups.each do |name, unlock_data| @@ -86,66 +91,76 @@ def save_unlocks elsif unlock_data[:_unlock_option] == 'percentage_from' unlock_condition = "#{unlock_data[:_percentage_required]}% from #{unlock_data[:_unlock_groupname]}" end - @course.exercise_group_by_name(name).group_unlock_conditions = Array(unlock_condition).to_json - UncomputedUnlock.create_all_for_course(@course) + T.must(course.exercise_group_by_name(name)).group_unlock_conditions = Array(unlock_condition).to_json + UncomputedUnlock.create_all_for_course(course) end end + sig { void } def clear_all_unlocks authorize! :manage_unlocks, @course - @course.exercise_groups.each do |eg| + T.must(@course).exercise_groups.each do |eg| eg.group_unlock_conditions = [''].to_json end end + sig { params(percentage: T.any(String, Integer)).void } def unlocks_previous_set_completed(percentage = 80) authorize! :manage_unlocks, @course - prevname = nil - @course.exercise_groups.each do |eg| + prevname = T.let(nil, T.nilable(String)) + T.must(@course).exercise_groups.each do |eg| eg.group_unlock_conditions = Array("#{percentage}% from #{prevname}").to_json unless prevname.nil? prevname = eg.name end end + sig { void } def save_deadlines authorize! :manage_deadlines, @course + course = T.must(@course) groups = group_params groups.each do |name, deadlines| hard_deadlines = [deadlines[:hard][:static], ''].to_json - @course.exercise_group_by_name(name).hard_group_deadline = hard_deadlines + T.must(course.exercise_group_by_name(name)).hard_group_deadline = hard_deadlines end end + sig { void } def clear_all_deadlines authorize! :manage_deadlines, @course - @course.exercise_groups.each do |eg| + T.must(@course).exercise_groups.each do |eg| eg.hard_group_deadline = ['', ''].to_json end end + # first_date: the first_set_date param, a one-element array of a date string. + sig { params(first_date: T.untyped, days: Integer).void } def fill_deadlines_with_interval(first_date, days = 7) authorize! :manage_deadlines, @course date = first_date - @course.exercise_groups.each do |eg| + T.must(@course).exercise_groups.each do |eg| eg.hard_group_deadline = date.to_json date = Array((DateTime.parse(date[0]) + days.days).strftime('%Y-%m-%d')) end end + sig { params(date: T.untyped).void } def fill_all_deadlines_with(date) authorize! :manage_deadlines, @course - @course.exercise_groups.each do |eg| + T.must(@course).exercise_groups.each do |eg| eg.hard_group_deadline = date.to_json end end private + sig { returns(T::Array[String]) } def groups_as_array - @course.exercise_groups.each_with_object(['']) do |group, array| + T.must(@course).exercise_groups.each_with_object(['']) do |group, array| array << group.name end end + sig { returns(T.any(ActionController::Parameters, T::Hash[T.untyped, T.untyped])) } def group_params sliced = params.slice(:group, :empty_group) groups = sliced[:group] || {} diff --git a/app/controllers/setup/organizations_controller.rb b/app/controllers/setup/organizations_controller.rb index c979c907d..7eac58282 100644 --- a/app/controllers/setup/organizations_controller.rb +++ b/app/controllers/setup/organizations_controller.rb @@ -1,18 +1,23 @@ +# typed: strict # frozen_string_literal: true class Setup::OrganizationsController < Setup::SetupController + extend T::Sig skip_authorization_check only: %i[index new] + sig { void } def index redirect_to setup_start_index_path end + sig { void } def new return respond_unauthorized('Please log in first to create new organization') unless can? :request, :organization add_breadcrumb 'Create new organization' @organization = Organization.new end + sig { void } def create authorize! :request, :organization @organization = Organization.init(organization_params, current_user) @@ -26,19 +31,21 @@ def create end end + sig { void } def edit authorize! :edit, @organization add_organization_breadcrumb add_breadcrumb 'Edit details' - @cant_edit_slug = !current_user.administrator? + @cant_edit_slug = T.let(!current_user.administrator?, T.nilable(T::Boolean)) end + sig { void } def update authorize! :edit, @organization authorize! :edit_slug, @organization unless organization_params[:slug].nil? - if @organization.update(organization_params) + if T.must(@organization).update(organization_params) redirect_to organization_path(@organization), notice: 'Organization was successfully updated.' else add_organization_breadcrumb @@ -49,10 +56,12 @@ def update end private + sig { void } def set_organization @organization = Organization.find_by(slug: params[:id]) unless params[:id].nil? end + sig { returns(ActionController::Parameters) } def organization_params params.require(:organization).permit(:name, :information, :website, :logo, :slug, :contact_information, :phone, :email, :disabled_reason) end diff --git a/app/controllers/setup/setup_controller.rb b/app/controllers/setup/setup_controller.rb index 5e5c78669..2cae2023f 100644 --- a/app/controllers/setup/setup_controller.rb +++ b/app/controllers/setup/setup_controller.rb @@ -1,9 +1,11 @@ +# typed: strict # frozen_string_literal: true class Setup::SetupController < ApplicationController + extend T::Sig before_action :set_organization, :add_setup_breadcrumb - STEPS = + STEPS = T.let( [ { # step_number: 1, @@ -31,8 +33,11 @@ class Setup::SetupController < ApplicationController title: 'Finish', path: :setup_organization_course_course_finisher_index_path } - ].freeze + ].freeze, + T::Array[{ title: String, path: Symbol }] + ) + sig { params(title: String).returns(T.nilable(Integer)) } def step_number(title) found = 0 STEPS.each do |st| @@ -42,15 +47,18 @@ def step_number(title) nil end + sig { params(step_number: Integer).returns(Symbol) } def link_to_next_step(step_number) - STEPS[step_number][:path] + STEPS.fetch(step_number)[:path] end + sig { void } def add_setup_breadcrumb add_breadcrumb 'Setup', setup_start_index_path add_breadcrumb 'Create new course' if controller_name.starts_with?('course_') && setup_in_progress? end + sig { params(phase: Integer).void } def print_setup_phases(phase = 0) update_setup_phase(phase) unless phase == 2 maxphase = setup_in_progress? ? session[:ongoing_course_setup][:phase] : phase @@ -66,20 +74,24 @@ def print_setup_phases(phase = 0) end options = {} options = { pass_parameters: true } if setup_in_progress? && course_choosed? - add_phase (i + 1).to_s + '. ' + STEPS[i][:title], type, path, options + add_phase (i + 1).to_s + '. ' + st[:title], type, path, options end end + # url: a route helper name, evaluated here with the current organization and course when + # options[:pass_parameters] is set. + sig { params(name: String, type: String, url: T.nilable(T.any(String, Symbol)), options: T::Hash[Symbol, T.untyped]).void } def add_phase(name, type, url = '', options = {}) - @course_setup_phases ||= [] + phases = @course_setup_phases ||= T.let([], T.nilable(T::Array[T::Hash[Symbol, T.untyped]])) if options[:pass_parameters] - url = url.to_s + "('#{@organization.slug}', #{@course.id})" + url = url.to_s + "('#{T.must(@organization).slug}', #{T.must(@course).id})" end url = eval(url.to_s) if url =~ /_path|_url|@/ - @course_setup_phases << { name: name, url: url, type: type } + phases << { name: name, url: url, type: type } end private + sig { params(phase: Integer).void } def save_wizard_to_session(phase = 1) return if setup_in_progress? session[:ongoing_course_setup] = { @@ -89,6 +101,7 @@ def save_wizard_to_session(phase = 1) } end + sig { returns(T::Boolean) } def setup_in_progress? return false if session[:ongoing_course_setup].nil? if !session[:ongoing_course_setup][:course_id].nil? && !@course.nil? @@ -98,34 +111,40 @@ def setup_in_progress? end end + sig { returns(T::Boolean) } def course_choosed? return false if session[:ongoing_course_setup].nil? !session[:ongoing_course_setup][:course_id].nil? end + sig { void } def reset_setup_session session[:ongoing_course_setup] = nil end + sig { params(phase: Integer).void } def update_setup_phase(phase) if setup_in_progress? session[:ongoing_course_setup][:phase] = phase if session[:ongoing_course_setup][:phase] < phase end end + sig { params(id: T.nilable(Integer)).void } def update_setup_course(id = nil) return unless setup_in_progress? session[:ongoing_course_setup][:course_id] = if id.nil? - @course.id + T.must(@course).id else id end end + sig { void } def set_organization @organization = Organization.find_by(slug: params[:organization_id]) end + sig { void } def set_course @course = Course.find(params[:course_id]) unless params[:course_id].nil? end diff --git a/app/controllers/setup/start_controller.rb b/app/controllers/setup/start_controller.rb index 5cff9e290..75e9c07c8 100644 --- a/app/controllers/setup/start_controller.rb +++ b/app/controllers/setup/start_controller.rb @@ -1,10 +1,14 @@ +# typed: strict # frozen_string_literal: true class Setup::StartController < Setup::SetupController + extend T::Sig skip_authorization_check only: [:index] + sig { void } def index - @my_organizations = Organization.taught_organizations(current_user) - @organization = @my_organizations.first if @my_organizations.count == 1 + my_organizations = Organization.taught_organizations(current_user) + @my_organizations = T.let(my_organizations, T.nilable(ActiveRecord::Relation)) + @organization = my_organizations.first if my_organizations.count == 1 end end diff --git a/app/controllers/solutions_controller.rb b/app/controllers/solutions_controller.rb index b3cf3770b..9d2474ea0 100644 --- a/app/controllers/solutions_controller.rb +++ b/app/controllers/solutions_controller.rb @@ -1,17 +1,19 @@ +# typed: strict # frozen_string_literal: true # Returns the suggestion solution as a ZIP. class SolutionsController < ApplicationController + sig { void } def show @exercise = Exercise.find(params[:exercise_id]) - @course = @exercise.course + @course = T.must(@exercise.course) @organization = @course.organization add_course_breadcrumb add_exercise_breadcrumb add_breadcrumb 'Suggested solution' - @solution = @exercise.solution + @solution = T.let(@exercise.solution, T.nilable(Solution)) begin authorize! :read, @solution rescue CanCan::AccessDenied diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index cf6c64ed9..df7816351 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -1,10 +1,13 @@ +# typed: strict # frozen_string_literal: true # Shows the various statistics under /stats. class StatsController < ApplicationController + extend T::Sig skip_authorization_check except: [:organization_stats_index] before_action :set_organization + sig { void } def index get_vars if @course @@ -21,6 +24,7 @@ def index end end + sig { void } def show get_vars page = params[:id] @@ -36,25 +40,29 @@ def show end private + sig { void } def get_vars @course = Course.find(params[:course_id]) if params[:course_id] end + sig { void } def course_stats_index respond_to do |format| format.html { render template: 'courses/stats/index' } end end + sig { void } def organization_stats_index authorize! :view_statistics, @organization - @stats = Stats.courses(@organization) + @stats = T.let(Stats.courses(@organization), T.nilable(T::Hash[Symbol, T.untyped])) respond_to do |format| format.html { render } format.json { render json: @stats, callback: params[:jsonp] } end end + sig { void } def general_stats_index @stats = Stats.courses respond_to do |format| @@ -63,6 +71,7 @@ def general_stats_index end end + sig { params(page: String).void } def course_stats_show(page) case page when 'submissions' @@ -74,46 +83,50 @@ def course_stats_show(page) end end + sig { void } def course_stats_show_submissions - return respond_not_found('No submissions yet') if @course.submissions.empty? + course = T.must(@course) + return respond_not_found('No submissions yet') if course.submissions.empty? - @start_time = + start_time = if params[:start_time] then Time.zone.parse(params[:start_time]) - else @course.time_of_first_submission.to_date.in_time_zone + else T.must(course.time_of_first_submission).to_date.in_time_zone end - @end_time = + end_time = if params[:end_time] then Time.zone.parse(params[:end_time]) - else @course.time_of_last_submission.to_date.in_time_zone + else T.must(course.time_of_last_submission).to_date.in_time_zone end - @time_unit = param_as_one_of(:time_unit, [nil, 'minute', 'hour', 'day']) - @time_unit = 'day' if @time_unit.nil? + time_unit = param_as_one_of(:time_unit, [nil, 'minute', 'hour', 'day']) || 'day' + @start_time = T.let(start_time, T.nilable(ActiveSupport::TimeWithZone)) + @end_time = T.let(end_time, T.nilable(ActiveSupport::TimeWithZone)) + @time_unit = T.let(time_unit, T.nilable(String)) respond_to do |format| format.html { render template: 'courses/stats/submissions', layout: 'bare' } format.json do - records = @course.submissions - .select(['COUNT(*) c', "date_trunc('#{@time_unit}', #{expr_for_time_in_time_zone('created_at')}) t"]) - .group('t') - .where('created_at >= ?', @start_time) - .where(user: User.legitimate_students) - .where('created_at < ?', @end_time) + records = course.submissions + .select(['COUNT(*) c', "date_trunc('#{time_unit}', #{expr_for_time_in_time_zone('created_at')}) t"]) + .group('t') + .where('created_at >= ?', start_time) + .where(user: User.legitimate_students) + .where('created_at < ?', end_time) date_format = '%Y-%m-%d %H:%M:%S' # query returns in this format, without timezone # date_format = '%FT%T.%LZ' # query returns in this format, without timezone lookup = {} for r in records - lookup[r.t.strftime(date_format)] = r.c.to_i + lookup[r['t'].strftime(date_format)] = r['c'].to_i end lookup.default = 0 result = [] - time = @start_time - while time < @end_time + time = start_time + while time < end_time result << lookup[time.strftime(date_format)] - time += 1.send(@time_unit) + time += 1.send(time_unit) end render json: result @@ -121,20 +134,22 @@ def course_stats_show_submissions end end + sig { void } def course_stats_show_submission_times - return respond_not_found('No submissions yet') if @course.submissions.empty? + course = T.must(@course) + return respond_not_found('No submissions yet') if course.submissions.empty? respond_to do |format| format.html { render template: 'courses/stats/submission_times', layout: 'bare' } format.json do - records = @course.submissions.where(user: User.legitimate_students).select([ + records = course.submissions.where(user: User.legitimate_students).select([ 'COUNT(*) c', "EXTRACT(HOUR FROM #{expr_for_time_in_time_zone('created_at')}) h" ]).group('h').order('h ASC') lookup = {} for r in records - lookup[r.h.to_i] = r.c.to_i + lookup[r['h'].to_i] = r['c'].to_i end lookup.default = 0 @@ -148,15 +163,18 @@ def course_stats_show_submission_times end end + sig { params(field: String).returns(String) } def expr_for_time_in_time_zone(field) connection = ActiveRecord::Base.connection "((#{field} AT TIME ZONE 'UTC') AT TIME ZONE #{connection.quote(Time.zone.name)})" end + sig { params(_page: String).void } def general_stats_show(_page) respond_not_found('No such stats page') end + sig { params(name: Symbol, valid_values: T::Array[T.nilable(String)]).returns(T.nilable(String)) } def param_as_one_of(name, valid_values) if valid_values.include?(params[name]) params[name] @@ -166,6 +184,7 @@ def param_as_one_of(name, valid_values) end private + sig { void } def set_organization @organization = Organization.find_by(slug: params[:organization_id]) end diff --git a/app/controllers/status_controller.rb b/app/controllers/status_controller.rb index 983689fce..1a900a95b 100644 --- a/app/controllers/status_controller.rb +++ b/app/controllers/status_controller.rb @@ -1,12 +1,14 @@ +# typed: strict # frozen_string_literal: true # Shows the various statistics under /stats. class StatusController < ApplicationController + sig { void } def index authorize! :read_instance_state, nil - @stats = Rails.cache.fetch('submission-stats-cache') - @stats = JSON.parse(@stats) if @stats - @sandboxes = Rails.cache.fetch('sandbox-status-cache') - @sandboxes = JSON.parse(@sandboxes) if @sandboxes + stats_json = Rails.cache.fetch('submission-stats-cache') + @stats = T.let(stats_json && JSON.parse(stats_json), T.nilable(T::Hash[String, T.untyped])) + sandboxes_json = Rails.cache.fetch('sandbox-status-cache') + @sandboxes = T.let(sandboxes_json && JSON.parse(sandboxes_json), T.nilable(T::Array[T::Hash[String, T.untyped]])) end end diff --git a/app/controllers/submissions_controller.rb b/app/controllers/submissions_controller.rb index af8b7e550..988aed5af 100644 --- a/app/controllers/submissions_controller.rb +++ b/app/controllers/submissions_controller.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'submission_processor' @@ -5,13 +6,16 @@ # Receives submissions and presents the full submission list and submission view. # Also handles rerun requests. class SubmissionsController < ApplicationController + extend T::Sig around_action :course_transaction before_action :get_course_and_exercise # Manually checked for #show and index skip_authorization_check only: %i[show index difference_with_solution] + sig { void } def index + course = T.must(@course) respond_to do |format| format.json do if params[:row_format] == 'datatables' @@ -21,20 +25,24 @@ def index end end format.html do # uses AJAX - respond_forbidden if !current_user.administrator? && @course.hide_submissions? - @organization = @course.organization + respond_forbidden if !current_user.administrator? && course.hide_submissions? + @organization = course.organization add_course_breadcrumb add_breadcrumb 'All submissions' end end end + sig { void } def show - @course ||= @submission.course - @exercise ||= @submission.exercise - @organization = @course.organization + submission = T.must(@submission) + @course ||= submission.course + @exercise ||= submission.exercise + course = T.must(@course) + exercise = T.must(@exercise) + @organization = course.organization - @model_solution_token_used = ModelSolutionTokenUsed.where(course: @course, exercise_name: @exercise.name, user: @submission.user) + @model_solution_token_used = T.let(ModelSolutionTokenUsed.where(course: course, exercise_name: exercise.name, user: submission.user), T.nilable(ActiveRecord::Relation)) add_course_breadcrumb add_exercise_breadcrumb @@ -42,48 +50,48 @@ def show respond_to do |format| format.html do - respond_forbidden if !current_user.administrator? && @course.hide_submissions? - @files = SourceFileList.for_submission(@submission) + respond_forbidden if !current_user.administrator? && course.hide_submissions? + @files = T.let(SourceFileList.for_submission(submission), T.nilable(T.any(SourceFileList, T::Array[T::Hash[Symbol, String]]))) end format.zip do - respond_forbidden if !current_user.administrator? && @course.hide_submissions? - send_data(@submission.return_file, filename: "#{@submission.user.login}-#{@exercise.name}-#{@submission.id}.zip") + respond_forbidden if !current_user.administrator? && course.hide_submissions? + send_data(submission.return_file, filename: "#{T.must(submission.user).login}-#{exercise.name}-#{submission.id}.zip") end format.json do output = { api_version: ApiVersion::API_VERSION, - all_tests_passed: @submission.all_tests_passed?, - user_id: @submission.user_id, - login: @submission.user.login, - course: @course.name, - exercise_name: @submission.exercise.name, - status: @submission.status(current_user), - points: @submission.points_list, - validations: @submission.validations, - valgrind: @submission.valgrind, - solution_url: @exercise.solution.visible_to?(current_user) ? view_context.exercise_solution_url(@exercise) : nil, - submitted_at: @submission.created_at, - processing_time: @submission.processing_time, - reviewed: @submission.reviewed?, - requests_review: @submission.requests_review?, - paste_url: @submission.paste_available ? paste_url(@submission.paste_key) : nil, - message_for_paste: @submission.paste_available ? @submission.message_for_paste : nil, - missing_review_points: @exercise.missing_review_points_for(@submission.user) + all_tests_passed: submission.all_tests_passed?, + user_id: submission.user_id, + login: T.must(submission.user).login, + course: course.name, + exercise_name: T.must(submission.exercise).name, + status: submission.status(current_user), + points: submission.points_list, + validations: submission.validations, + valgrind: submission.valgrind, + solution_url: exercise.solution.visible_to?(current_user) ? view_context.exercise_solution_url(exercise) : nil, + submitted_at: submission.created_at, + processing_time: submission.processing_time, + reviewed: submission.reviewed?, + requests_review: submission.requests_review?, + paste_url: submission.paste_available ? paste_url(submission.paste_key) : nil, + message_for_paste: submission.paste_available ? submission.message_for_paste : nil, + missing_review_points: exercise.missing_review_points_for(T.must(submission.user)) } output = output.merge( - case @submission.status(current_user) + T.must(case submission.status(current_user) when :processing then { - submissions_before_this: @submission.unprocessed_submissions_before_this, + submissions_before_this: submission.unprocessed_submissions_before_this, total_unprocessed: Submission.unprocessed_count } when :ok then { - test_cases: @submission.test_case_records, - feedback_questions: @course.feedback_questions.order(:position).map(&:record_for_api), - feedback_answer_url: submission_feedback_answers_url(@submission, format: :json) + test_cases: submission.test_case_records, + feedback_questions: course.feedback_questions.order(:position).map(&:record_for_api), + feedback_answer_url: submission_feedback_answers_url(submission, format: :json) } when :fail then { - test_cases: @submission.test_case_records + test_cases: submission.test_case_records } when :hidden then { all_tests_passed: nil, @@ -93,13 +101,13 @@ def show valgrind: nil } when :error then { - error: @submission.pretest_error + error: submission.pretest_error } - end + end) ) output[:status] = :ok if output[:status] == :hidden if !!params[:include_files] - output[:files] = SourceFileList.for_submission(@submission).map { |f| { path: f.path, contents: f.contents } } + output[:files] = SourceFileList.for_submission(submission).map { |f| { path: f.path, contents: f.contents } } end render json: output @@ -107,12 +115,14 @@ def show end end + sig { void } def create if !params[:submission] || !params[:submission][:file] return respond_not_found('No ZIP file selected or failed to receive it') end - unless @exercise.submittable_by?(current_user) + exercise = T.must(@exercise) + unless exercise.submittable_by?(current_user) return respond_forbidden('Submissions for this exercise are no longer accepted.') end @@ -134,7 +144,7 @@ def create @submission = Submission.new( user: current_user, course: @course, - exercise: @exercise, + exercise: exercise, return_file: file_contents, params_json: submission_params.to_json, requests_review: !!params[:request_review], @@ -162,7 +172,7 @@ def create redirect_to(submission_path(@submission), notice: 'Submission received.') else - redirect_to(exercise_path(@exercise), + redirect_to(exercise_path(exercise), alert: errormsg) end end @@ -177,8 +187,9 @@ def create end end + sig { void } def update - submission = Submission.find(params[:id]) || respond_not_found + submission = Submission.find(params[:id]) authorize! :update, submission if params[:rerun] authorize! :rerun, submission @@ -193,32 +204,37 @@ def update end end + sig { void } def update_by_exercise - for submission in @exercise.submissions + exercise = T.must(@exercise) + for submission in exercise.submissions schedule_for_rerun(submission, -2) end - redirect_to exercise_path(@exercise), notice: 'Reruns scheduled' + redirect_to exercise_path(exercise), notice: 'Reruns scheduled' end + sig { void } def difference_with_solution - @course ||= @submission.course + submission = T.must(@submission) + @course ||= submission.course authorize! :teach, @course - @exercise ||= @submission.exercise - @organization = @course.organization + @exercise ||= submission.exercise + @organization = T.must(@course).organization add_course_breadcrumb add_exercise_breadcrumb add_submission_breadcrumb add_breadcrumb 'Difference with model solution' - submission_files = SourceFileList.for_submission(@submission) - solution_files = SourceFileList.for_solution(@exercise.solution) + submission_files = SourceFileList.for_submission(submission) + solution_files = SourceFileList.for_solution(T.must(@exercise).solution) files_in_list = Set.new - @files = [] + files = T.let([], T::Array[T::Hash[Symbol, String]]) + @files = files submission_files.each do |file| # TODO: In some exercises files may be named differently. Some kind of # similarity metric would be nice here model = solution_files.find { |solution_file| file.path == solution_file.path } - @files << { + files << { path: file.path, submission_contents: file.contents, model_contents: (model.nil? ? '' : model.contents) @@ -227,7 +243,7 @@ def difference_with_solution end solution_files.each do |file| next if files_in_list.include?(file.path) - @files << { + files << { path: file.path, submission_contents: '', model_contents: file.contents @@ -236,11 +252,13 @@ def difference_with_solution end private + sig { params(block: T.proc.void).void } def course_transaction(&block) Course.transaction(requires_new: true, &block) end # Ugly manual access control :/ + sig { void } def get_course_and_exercise submission_id = params[:id] || params[:submission_id] if submission_id @@ -250,14 +268,14 @@ def get_course_and_exercise @exercise = @submission.exercise elsif params[:exercise_id] @exercise = Exercise.find(params[:exercise_id]) - @course = Course.lock('FOR SHARE').find(@exercise.course_id) + @course = Course.lock('FOR SHARE').find(T.must(@exercise.course_id)) authorize! :read, @course authorize! :read, @exercise elsif params[:paste_key] @submission = Submission.find_by!(paste_key: params[:paste_key]) @exercise = @submission.exercise - @course = @exercise.course - @is_paste = true + @course = T.must(@exercise).course + @is_paste = T.let(true, T.nilable(T::Boolean)) check_access! elsif params[:course_id] @course = Course.lock('FOR SHARE').find(params[:course_id]) @@ -268,14 +286,16 @@ def get_course_and_exercise end end + sig { params(submission: Submission, priority: Integer).void } def schedule_for_rerun(submission, priority) submission.set_to_be_reprocessed!(priority) end + sig { void } def index_json return respond_forbidden unless current_user.administrator? - submissions = @course.submissions + submissions = T.must(@course).submissions if params[:user_id] submissions = submissions.where(user_id: params[:user_id]) end @@ -288,8 +308,9 @@ def index_json } end + sig { void } def index_json_datatables - submissions = @course.submissions + submissions = T.must(@course).submissions unless current_user.administrator? || can?(:teach, @course) submissions = submissions.where(user_id: current_user.id) @@ -306,38 +327,44 @@ def index_json_datatables render json: { remaining: remaining, max_id: params[:max_id].to_i, - last_id: submissions_limited.empty? ? nil : submissions_limited.last.id.to_i, + last_id: submissions_limited.empty? ? nil : T.must(submissions_limited.last).id.to_i, rows: view_context.submissions_for_datatables(submissions_limited) } end + sig { void } def check_access! if current_user.guest? raise CanCan::AccessDenied end - paste_visible = @submission.paste_visible_for?(current_user) + submission = T.must(@submission) + exercise = T.must(@exercise) + course = T.must(@course) - paste_visibility = @exercise.paste_visibility - paste_visibility ||= @course.paste_visibility + paste_visible = submission.paste_visible_for?(current_user) + + paste_visibility = exercise.paste_visibility + paste_visibility ||= course.paste_visibility paste_visibility ||= 'open' case paste_visibility when 'protected', 'secured' - respond_forbidden unless can?(:teach, @course) || @submission.user_id.to_s == current_user.id.to_s + respond_forbidden unless can?(:teach, course) || submission.user_id.to_s == current_user.id.to_s when 'no-tests-public' - respond_forbidden unless can?(:teach, @course) || @submission.created_at > 2.hours.ago || @submission.user_id.to_s == current_user.id.to_s + respond_forbidden unless can?(:teach, course) || T.must(submission.created_at) > 2.hours.ago || submission.user_id.to_s == current_user.id.to_s when 'completed-only' - respond_forbidden("You cannot see this paste because you haven't completed this exercise.") unless can?(:teach, @course) || @submission.user_id.to_s == current_user.id.to_s || @submission.exercise.completed_by?(current_user) || current_user.submissions.where(exercise_name: @exercise.name, pretest_error: nil, all_tests_passed: true).any? + respond_forbidden("You cannot see this paste because you haven't completed this exercise.") unless can?(:teach, course) || submission.user_id.to_s == current_user.id.to_s || exercise.completed_by?(current_user) || current_user.submissions.where(exercise_name: exercise.name, pretest_error: nil, all_tests_passed: true).any? when 'everyone' nil else - return if can?(:teach, @course) || @submission.user_id.to_s == current_user.id.to_s - if @submission.created_at > 2.hours.ago + return if can?(:teach, course) || submission.user_id.to_s == current_user.id.to_s + if T.must(submission.created_at) > 2.hours.ago respond_forbidden("You cannot see this paste because all tests passed and you haven't completed this exercise.") unless paste_visible return else unless paste_visible - if @submission.exercise && !@submission.exercise.completed_by?(current_user) + submission_exercise = submission.exercise + if submission_exercise && !submission_exercise.completed_by?(current_user) respond_forbidden("You cannot see this paste because you haven't completed this exercise.") return else @@ -346,8 +373,6 @@ def check_access! return end end - - respond_forbidden('You cannot see this paste because all tests passed.') unless paste_visible end end end diff --git a/app/controllers/teachers_controller.rb b/app/controllers/teachers_controller.rb index 349fbb568..6f086941b 100644 --- a/app/controllers/teachers_controller.rb +++ b/app/controllers/teachers_controller.rb @@ -1,17 +1,21 @@ +# typed: strict # frozen_string_literal: true class TeachersController < ApplicationController + extend T::Sig before_action :set_organization + sig { void } def index authorize! :teach, @organization ordering = Arel.sql('LOWER(login)') - @teachers = @organization.teachers.order(ordering) - @teachership = Teachership.new + @teachers = T.let(T.must(@organization).teachers.order(ordering), T.nilable(ActiveRecord::Relation)) + @teachership = T.let(Teachership.new, T.nilable(Teachership)) add_organization_breadcrumb add_breadcrumb 'Manage teachers' end + sig { void } def create authorize! :teach, @organization @@ -19,26 +23,29 @@ def create @teachership = Teachership.new(user: user, organization: @organization) if @teachership.save - redirect_to organization_teachers_path, notice: "Teacher #{user.email} added to organization" + redirect_to organization_teachers_path, notice: "Teacher #{T.must(user).email} added to organization" else - @teachers = @organization.teachers + @teachers = T.must(@organization).teachers render :index end end + sig { void } def destroy authorize! :remove_teacher, @organization @teachership = Teachership.find(params[:id]) - destroyed_username = @teachership.user.login + destroyed_username = T.must(@teachership.user).login @teachership.destroy! redirect_to organization_teachers_path, notice: "Teacher #{destroyed_username} removed from organization" end private + sig { void } def set_organization @organization = Organization.find_by(slug: params[:organization_id]) end + sig { returns(ActionController::Parameters) } def teacher_params params.permit(:email) end diff --git a/app/controllers/unlocks_controller.rb b/app/controllers/unlocks_controller.rb index 223a7bb82..8971cc5ab 100644 --- a/app/controllers/unlocks_controller.rb +++ b/app/controllers/unlocks_controller.rb @@ -1,12 +1,15 @@ +# typed: strict # frozen_string_literal: true # Receives explicit unlock requests and shows a web UI for making them. class UnlocksController < ApplicationController + extend T::Sig + sig { void } def show @course = Course.find(params[:course_id]) authorize! :read, @course @organization = Organization.find_by(slug: params[:organization_id]) - @exercises = @course.unlockable_exercises_for(current_user) + @exercises = T.let(@course.unlockable_exercises_for(current_user), T.nilable(T::Array[Exercise])) respond_to do |format| format.html do @@ -16,6 +19,7 @@ def show end end + sig { void } def create @course = Course.find(params[:course_id]) authorize! :read, @course diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 518a28c73..8b06e54b9 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,17 +1,21 @@ +# typed: strict # frozen_string_literal: true # Presents the "register user" and "edit profile" views. class UsersController < ApplicationController + extend T::Sig skip_authorization_check after_action :remove_x_frame_options_header_when_bare_layout, only: %i[new create show] + sig { void } def index raise CanCan::AccessDenied if current_user.guest? respond_forbidden unless current_user.administrator? - @users = User.search(params[:search]) + @users = T.let(User.search(params[:search]), T.nilable(ActiveRecord::Relation)) end + sig { void } def new authorize! :create, User alternative_location = SiteSetting.all_settings['signup_location'] @@ -22,10 +26,11 @@ def new # Logged in from this page. No need to be here, so redirect away redirect_to root_path else - @user = User.new + @user = T.let(User.new, T.nilable(User)) end end + sig { void } def create authorize! :create, User @@ -62,6 +67,7 @@ def create end end + sig { void } def show add_breadcrumb 'My account', user_path @@ -72,10 +78,12 @@ def show end end + sig { void } def update User.transaction do @user = current_user - @email_before = @user.email + email_before = @user.email + @email_before = T.let(email_before, T.nilable(String)) set_email password_changed = maybe_update_password(@user, params[:user]) @@ -84,7 +92,7 @@ def update if @user.errors.empty? && @user.save # Password changed locally: migrate the user to courses.mooc.fi @user.post_new_user_to_courses_mooc_fi(params[:user][:password]) if password_changed && !@user.managed_externally? - RecentlyChangedUserDetail.email_changed.create!(old_value: @email_before, new_value: @user.email, username: @user.login, user_id: @user.id) unless @email_before.casecmp(@user.email).zero? + RecentlyChangedUserDetail.email_changed.create!(old_value: email_before, new_value: @user.email, username: @user.login, user_id: @user.id) unless T.must(email_before.casecmp(@user.email)).zero? flash[:notice] = if password_changed 'Changes saved and password changed' else @@ -98,6 +106,7 @@ def update end end + sig { void } def confirm_email language = params[:language] VerificationToken.unscoped.email.find_by!(user_id: params[:user_id], token: params[:id]) @@ -109,6 +118,7 @@ def confirm_email redirect_to redirect_path, notice: 'Your email address has been verified!', allow_other_host: true end + sig { void } def send_verification_email user = User.find(params[:user_id]) raise 'Access denied' if user != current_user && !current_user.administrator? @@ -117,11 +127,13 @@ def send_verification_email redirect_to root_path, notice: "Verification email sent to #{user.email}." end + sig { void } def verify_destroying_user @user = authenticate_current_user_destroy VerificationToken.delete_user.find_by!(user: @user, token: params[:id]) end + sig { void } def destroy_user im_sure = params[:im_sure] if im_sure != '1' @@ -146,6 +158,7 @@ def destroy_user redirect_to root_url, notice: 'Your account has been permanently destroyed.' end + sig { void } def send_destroy_email user = authenticate_current_user_destroy UserMailer.destroy_confirmation(user).deliver_now @@ -153,12 +166,14 @@ def send_destroy_email end private + sig { returns(User) } def authenticate_current_user_destroy user = User.find(params[:user_id]) authorize! :destroy, user user end + sig { params(status: T.anything).returns(String) } def failed_authentication_alert(status) case status when :unavailable @@ -170,33 +185,38 @@ def failed_authentication_alert(status) end end + sig { void } def set_email + user = T.must(@user) user_params = params[:user] - return if !@user.new_record? && user_params[:email_repeat].blank? + return if !user.new_record? && user_params[:email_repeat].blank? if user_params[:email].blank? - @user.errors.add(:email, 'needed') + user.errors.add(:email, 'needed') elsif user_params[:email] != user_params[:email_repeat] - @user.errors.add(:email_repeat, 'did not match') + user.errors.add(:email_repeat, 'did not match') else - @user.email = user_params[:email].strip + user.email = user_params[:email].strip end end + sig { void } def set_password + user = T.must(@user) user_params = params[:user] if user_params[:password].blank? - @user.errors.add(:password, 'needed') + user.errors.add(:password, 'needed') elsif user_params[:password].length > 1000 - @user.errors.add(:password, 'cannot be over 1000 characters') + user.errors.add(:password, 'cannot be over 1000 characters') elsif user_params[:password] != user_params[:password_repeat] - @user.errors.add(:password_repeat, 'did not match') + user.errors.add(:password_repeat, 'did not match') else - @user.password = user_params[:password] + user.password = user_params[:password] end end + sig { params(user: User, user_params: T.untyped).returns(T::Boolean) } def maybe_update_password(user, user_params) if user_params[:old_password].present? || user_params[:password].present? if user.managed_externally? @@ -226,11 +246,12 @@ def maybe_update_password(user, user_params) end end + sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) } def set_user_fields return if params[:user_field].nil? changes = {} UserField.all.select { |f| f.visible_to?(current_user) }.each do |field| - value_record = @user.field_value_record(field) + value_record = T.must(@user).field_value_record(field) old_value = value_record.ruby_value value_record.set_from_form(params[:user_field][field.name]) new_value = value_record.ruby_value diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index acdc9ccef..b991b6102 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,12 +1,16 @@ +# typed: strict # frozen_string_literal: true require 'tailoring' module ApplicationHelper + extend T::Sig + sig { returns(Tailoring) } def tailoring Tailoring.get end + sig { params(name: String, path: String, options: T::Hash[Symbol, T.untyped]).returns(ActiveSupport::SafeBuffer) } def navigation_link(name, path, options = {}) class_name = options[:class] || '' class_addition = request.path.start_with?(path) ? 'nav-link active' : 'nav-link' @@ -14,6 +18,7 @@ def navigation_link(name, path, options = {}) link_to name, path, options end + sig { params(name: T.nilable(String), path: String, options: T::Hash[Symbol, T.untyped]).returns(ActiveSupport::SafeBuffer) } def active_on_current_path_link_to(name, path, options = {}) if request.path == path classes = options[:class] || '' @@ -23,6 +28,15 @@ def active_on_current_path_link_to(name, path, options = {}) link_to(name, path, options) end + # `tags` may be omitted and the options hash passed in its place. + sig do + params( + label: String, + tags: T.nilable(T.any(String, T::Hash[Symbol, T.untyped])), + options: T::Hash[Symbol, T.untyped], + block: T.nilable(T.proc.returns(T.untyped)) + ).returns(ActiveSupport::SafeBuffer) + end def labeled(label, tags = nil, options = {}, &block) if tags.is_a?(Hash) && options.empty? options = tags @@ -38,7 +52,7 @@ def labeled(label, tags = nil, options = {}, &block) tags = tags.html_safe if tags =~ /id\s*=\s*"([^"]+)"/ - target = ' for="' + Regexp.last_match(1) + '"' + target = " for=\"#{Regexp.last_match(1)}\"" else raise 'Cannot label a tag without an id' end @@ -62,6 +76,14 @@ def labeled(label, tags = nil, options = {}, &block) end end + sig do + params( + label: String, + tags: T.nilable(T.any(String, T::Hash[Symbol, T.untyped])), + options: T::Hash[Symbol, T.untyped], + block: T.nilable(T.proc.returns(T.untyped)) + ).returns(ActiveSupport::SafeBuffer) + end def labeled_field(label, tags = nil, options = {}, &block) cls = ['field'] cls << options[:super_class].split(' ') if options[:super_class] @@ -69,6 +91,7 @@ def labeled_field(label, tags = nil, options = {}, &block) raw("
" + labeled(label, tags, options, &block) + '
') end + sig { params(label: String, field: String, options: T::Hash[Symbol, T.untyped]).returns(ActiveSupport::SafeBuffer) } def bs_labeled_field(label, field, options = {}) type = options[:type] || :text @@ -87,6 +110,7 @@ def bs_labeled_field(label, field, options = {}) raw(str) end + sig { params(table_selector: String, options: T::Hash[Symbol, T.untyped]).returns(ActiveSupport::SafeBuffer) } def use_datatables(table_selector, options = {}) options = { bJQueryUI: true, @@ -104,10 +128,12 @@ def use_datatables(table_selector, options = {}) raw(script) end + sig { returns(ActiveSupport::SafeBuffer) } def link_back raw('') end + sig { returns(T.nilable(String)) } def return_to_link return nil if request.path == '/' request.path diff --git a/app/helpers/authorize_collection_helper.rb b/app/helpers/authorize_collection_helper.rb index e70b6f09a..bc283a789 100644 --- a/app/helpers/authorize_collection_helper.rb +++ b/app/helpers/authorize_collection_helper.rb @@ -1,10 +1,14 @@ +# typed: strict # frozen_string_literal: true module AuthorizeCollectionHelper + extend T::Sig + # This method allows to authorize collections of items # TODO: Has to be tested with empty collections and other edge cases + sig { params(action: Symbol, collection: T::Enumerable[T.untyped]).void } def authorize_collection(action, collection) - @_authorized = true + @_authorized = T.let(true, T.nilable(T::Boolean)) collection.each { |col| authorize! action, col } end end diff --git a/app/helpers/bad_utf8_helper.rb b/app/helpers/bad_utf8_helper.rb index 823d87a10..54a730c78 100644 --- a/app/helpers/bad_utf8_helper.rb +++ b/app/helpers/bad_utf8_helper.rb @@ -1,7 +1,11 @@ +# typed: strict # frozen_string_literal: true module BadUtf8Helper + extend T::Sig + + sig { params(str: String).returns(String) } def force_utf8_violently(str) if str.encoding == Encoding.find('UTF-8') && str.valid_encoding? str diff --git a/app/helpers/bootstrap_flash_helper.rb b/app/helpers/bootstrap_flash_helper.rb index 97030de85..a732f5f0e 100644 --- a/app/helpers/bootstrap_flash_helper.rb +++ b/app/helpers/bootstrap_flash_helper.rb @@ -1,8 +1,11 @@ +# typed: strict # frozen_string_literal: true module BootstrapFlashHelper + extend T::Sig ALERT_TYPES = %i[error info success danger].freeze + sig { returns(ActiveSupport::SafeBuffer) } def bootstrap_flash flash_messages = [] flash.each do |type, message| diff --git a/app/helpers/course_timings_helper.rb b/app/helpers/course_timings_helper.rb index 24e28a08c..47c452446 100644 --- a/app/helpers/course_timings_helper.rb +++ b/app/helpers/course_timings_helper.rb @@ -1,6 +1,9 @@ +# typed: strict # frozen_string_literal: true module CourseTimingsHelper + extend T::Sig + sig { params(condition: String).returns(T.nilable(Integer)) } def parse_percentage_from_unlock_condition(condition) if condition =~ /^(\d+)[%]\s+(?:in|of|from)\s+(\S+)$/ percentage = Integer(Regexp.last_match(1)) @@ -8,15 +11,19 @@ def parse_percentage_from_unlock_condition(condition) percentage end + sig { params(condition: String).returns(T.nilable(String)) } def parse_group_from_unlock_condition(condition) condition.split.last if condition =~ /^(\d+)[%]\s+(?:in|of|from)\s+(\S+)$/ end + sig { params(group: ExerciseGroup).returns(T::Boolean) } def complex_unlock_conditions?(group) - return false if group.group_unlock_conditions.empty? - return true if group.group_unlock_conditions.length > 1 - return false if group.group_unlock_conditions.first.empty? - return true unless group.group_unlock_conditions.first =~ /^(\d+)[%]\s+(?:in|of|from)\s+(\S+)$/ + # Nil for a parent group without exercises of its own, which crashes the timings page. + conditions = T.must(group.group_unlock_conditions) + return false if conditions.empty? + return true if conditions.length > 1 + return false if conditions.first.empty? + return true unless conditions.first =~ /^(\d+)[%]\s+(?:in|of|from)\s+(\S+)$/ false end end diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index bc1291559..8b795f413 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -1,8 +1,10 @@ +# typed: strict # frozen_string_literal: true module CoursesHelper + extend T::Sig + sig { params(body: T.untyped).returns(String) } def response_body_for(body) - return "You wrote:\n\n#{body}\n\n---\n\n" - body.to_s + "You wrote:\n\n#{body}\n\n---\n\n" end end diff --git a/app/helpers/embeddable_helper.rb b/app/helpers/embeddable_helper.rb deleted file mode 100644 index b305f997b..000000000 --- a/app/helpers/embeddable_helper.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -module EmbeddableHelper - def remove_x_frame_options_header_when_bare_layout - response.headers.except! 'X-Frame-Options' if @bare_layout - end -end diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index 8184000bf..5a1f7255b 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -1,18 +1,24 @@ +# typed: strict # frozen_string_literal: true module ExercisesHelper + extend T::Sig + sig { params(e: Exercise).returns(String) } def exercise_zip_url(e) exercise_url(e, format: 'zip').to_s end + sig { params(e: Exercise).returns(String) } def exercise_solution_zip_url(e) exercise_solution_url(e, format: 'zip').to_s end + sig { params(percentage: T.nilable(Integer)).returns(Integer) } def green(percentage) percentage || 0 end + sig { params(percentage_of_green: T.nilable(Integer)).returns(Integer) } def red(percentage_of_green) 100 - (percentage_of_green || 100) end diff --git a/app/helpers/extra_field_helper.rb b/app/helpers/extra_field_helper.rb index 3a1d6c401..4c9290388 100644 --- a/app/helpers/extra_field_helper.rb +++ b/app/helpers/extra_field_helper.rb @@ -1,8 +1,13 @@ +# typed: strict # frozen_string_literal: true module ExtraFieldHelper + extend T::Sig + + sig { params(field_value: UserFieldValue, method_options: T::Hash[Symbol, T.untyped]).returns(String) } def extra_field(field_value, method_options) - field = field_value.field + # The value record is looked up by a configured field, so its field exists. + field = T.must(field_value.field) return '' if field.options[:hidden] return raw(field.label) if field.field_type == :html @@ -14,7 +19,6 @@ def extra_field(field_value, method_options) common_attrs[:disabled] = 'disabled' if field.options[:disabled] existing_value = field_value.value - existing_value = field.default if existing_value.nil? field_tag = case field.field_type @@ -37,6 +41,8 @@ def extra_field(field_value, method_options) bs_labeled_field(raw(field.label), field_tag, order: label_order, type: field.field_type) end + # `value` is the raw filter param. + sig { params(prefix: String, field: UserField, value: T.untyped).returns(String) } def extra_field_filter(prefix, field, value) return '' if field.field_type == :html @@ -63,6 +69,7 @@ def extra_field_filter(prefix, field, value) bs_labeled_field(raw(field.name.humanize), field_tag, order: label_order) end + sig { params(prefix: String, field: UserField, value: T::Boolean).returns(String) } def extra_field_checkbox(prefix, field, value) return '' if field.field_type == :html field_name = prefix + field.name @@ -70,8 +77,9 @@ def extra_field_checkbox(prefix, field, value) labeled_field(raw(field.name.humanize), field_tag, order: :label_last, super_class: 'checkbox') end + sig { params(value_record: UserFieldValue).returns(String) } def extra_field_value(value_record) - field = value_record.field + field = T.must(value_record.field) case field.field_type when :boolean value_record.value.blank? ? 'No' : 'Yes' diff --git a/app/helpers/feedback_answers_helper.rb b/app/helpers/feedback_answers_helper.rb index 89bd91254..b4f80671e 100644 --- a/app/helpers/feedback_answers_helper.rb +++ b/app/helpers/feedback_answers_helper.rb @@ -1,14 +1,19 @@ +# typed: strict # frozen_string_literal: true module FeedbackAnswersHelper + extend T::Sig + sig { params(answer: FeedbackAnswer).returns(String) } def render_feedback_answer(answer) - if answer.feedback_question.intrange? - answer.answer + '/' + answer.feedback_question.intrange.max.to_s + question = T.must(answer.feedback_question) + if question.intrange? + answer.answer + '/' + question.intrange.max.to_s else simple_format(answer.answer) end end + sig { params(question: FeedbackQuestion).void } def feedback_statistics_for_question(question) stats = {} stats[:count] = question.feedback_answers.count @@ -19,6 +24,7 @@ def feedback_statistics_for_question(question) # TODO end + sig { params(action: String, answer: FeedbackAnswer).returns(String) } def name_for(action, answer) "#{action} #{pluralize(answer.reply_to_feedback_answers.count, 'reply').sub(/\d+\s/, '')}" end diff --git a/app/helpers/flash_block_helper.rb b/app/helpers/flash_block_helper.rb index cc23aaed4..08f00170a 100644 --- a/app/helpers/flash_block_helper.rb +++ b/app/helpers/flash_block_helper.rb @@ -1,6 +1,10 @@ +# typed: strict # frozen_string_literal: true module FlashBlockHelper + extend T::Sig + + sig { returns(ActiveSupport::SafeBuffer) } def flash_block output = '' flash.each do |type, message| @@ -10,6 +14,8 @@ def flash_block raw(output) end + # Flash values come back from the session as whatever a controller stored. + sig { params(type: String, message: T.untyped).returns(ActiveSupport::SafeBuffer) } def flash_container(type, message) raw(content_tag(:div, class: "alert alert-#{type}") do content_tag(:a, raw('×'), class: 'close', data: { dismiss: 'alert' }) + diff --git a/app/helpers/paste_helper.rb b/app/helpers/paste_helper.rb index 7fb296fcb..523a514cd 100644 --- a/app/helpers/paste_helper.rb +++ b/app/helpers/paste_helper.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module PasteHelper diff --git a/app/helpers/points_helper.rb b/app/helpers/points_helper.rb index 91348bbee..880625b67 100644 --- a/app/helpers/points_helper.rb +++ b/app/helpers/points_helper.rb @@ -1,14 +1,18 @@ +# typed: strict # frozen_string_literal: true require 'natsort' module PointsHelper + extend T::Sig + sig { params(url: T.nilable(String)).returns(T.nilable(String)) } def github_repo_url_to_project_page_url(url) if url =~ /github.com[:\/]([^\/]*)\/([^\/]*)\.git/ "https://github.com/#{Regexp.last_match(1)}/#{Regexp.last_match(2)}" end end + sig { params(points: T::Enumerable[String]).returns(ActiveSupport::SafeBuffer) } def points_list(points) points.to_a.natsort.map { |pt| h(pt) }.join('  ').html_safe end diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb index 5fe3b2f08..5ee221505 100644 --- a/app/helpers/sessions_helper.rb +++ b/app/helpers/sessions_helper.rb @@ -1,15 +1,21 @@ +# typed: strict # frozen_string_literal: true module SessionsHelper + extend T::Sig + sig { params(user: User).returns(User) } def sign_in(user) session[:user_id] = user.id - @current_user = user + @current_user = T.let(user, T.nilable(User)) + user end + sig { returns(User) } def current_user - @current_user ||= user_from_basic_auth || user_from_session || Guest.new + @current_user ||= T.let(user_from_basic_auth || user_from_session || Guest.new, T.nilable(User)) end + sig { params(user: User).void } def current_user=(user) if user.guest? sign_out @@ -18,10 +24,12 @@ def current_user=(user) end end + sig { returns(T::Boolean) } def signed_in? !current_user.guest? end + sig { void } def sign_out session[:user_id] = nil @current_user = Guest.new @@ -29,10 +37,12 @@ def sign_out end private + sig { returns(T.nilable(User)) } def user_from_session User.find_by(id: session[:user_id]) end + sig { returns(T.nilable(User)) } def user_from_basic_auth if request&.authorization username, password = ActionController::HttpAuthentication::Basic.user_name_and_password(request) diff --git a/app/helpers/submissions_helper.rb b/app/helpers/submissions_helper.rb index d1c90de64..fb644422e 100644 --- a/app/helpers/submissions_helper.rb +++ b/app/helpers/submissions_helper.rb @@ -1,6 +1,9 @@ +# typed: strict # frozen_string_literal: true module SubmissionsHelper + extend T::Sig + sig { params(submissions: T::Enumerable[Submission], options: T::Hash[Symbol, T.untyped]).returns(ActiveSupport::SafeBuffer) } def show_submission_list(submissions, options = {}) locals = { submissions: submissions, @@ -17,11 +20,13 @@ def show_submission_list(submissions, options = {}) render partial: 'submissions/list', locals: locals end + sig { params(submission: Submission).returns(ActiveSupport::SafeBuffer) } def submission_status(submission) status = submission.status(current_user) raw("#{status.to_s.capitalize}") end + sig { params(submission: Submission).returns(T.nilable(String)) } def submission_review_column(submission) if submission.reviewed? if can? :create_review, submission.course @@ -58,6 +63,8 @@ def submission_review_column(submission) end end + # `exception` is the decoded exception JSON of a test case run. + sig { params(exception: T.untyped).returns(String) } def format_exception_chain(exception) return '' if exception.nil? return handle_langs_chain(exception) if exception.is_a?(Array) @@ -71,6 +78,7 @@ def format_exception_chain(exception) result end + sig { params(exception: T::Array[T.untyped]).returns(ActiveSupport::SafeBuffer) } def handle_langs_chain(exception) result = ActiveSupport::SafeBuffer.new('') exception.each do |line| @@ -80,15 +88,17 @@ def handle_langs_chain(exception) result end + sig { params(submissions: T::Enumerable[Submission]).returns(T::Array[T::Array[T.untyped]]) } def submissions_for_datatables(submissions) submissions.map do |sub| - user_col = if can? :read, sub.user - link_to sub.user.email, participant_path(sub.user) + user = T.must(sub.user) + user_col = if can? :read, user + link_to user.email, participant_path(user) else 'user' end [ - sub.created_at.strftime('%Y-%m-%d %H:%M'), + T.must(sub.created_at).strftime('%Y-%m-%d %H:%M'), user_col, link_to_submission_exericse(sub), submission_status(sub), @@ -99,10 +109,12 @@ def submissions_for_datatables(submissions) end end + sig { params(submission: Submission, text: T.nilable(String), missing_text: String).returns(String) } def link_to_submission_exericse(submission, text = nil, missing_text = '') - if submission.exercise - text = submission.exercise.name if text.nil? - link_to text, exercise_path(submission.exercise) + exercise = submission.exercise + if exercise + text = exercise.name if text.nil? + link_to text, exercise_path(exercise) else missing_text end diff --git a/app/helpers/twitter_breadcrumbs_helper.rb b/app/helpers/twitter_breadcrumbs_helper.rb index b212f6309..b254a3a1b 100644 --- a/app/helpers/twitter_breadcrumbs_helper.rb +++ b/app/helpers/twitter_breadcrumbs_helper.rb @@ -1,6 +1,10 @@ +# typed: strict # frozen_string_literal: true module TwitterBreadcrumbsHelper + extend T::Sig + + sig { params(divider: String).returns(ActiveSupport::SafeBuffer) } def render_breadcrumbs(divider = '/') render partial: 'twitter-bootstrap/breadcrumbs', locals: { divider: divider } end diff --git a/app/mailers/course_notification_mailer.rb b/app/mailers/course_notification_mailer.rb index 643dbd4be..e724bc55b 100644 --- a/app/mailers/course_notification_mailer.rb +++ b/app/mailers/course_notification_mailer.rb @@ -1,14 +1,20 @@ +# typed: strict # frozen_string_literal: true class CourseNotificationMailer < ActionMailer::Base + extend T::Sig include ActionView::Helpers::SanitizeHelper + + # `params` keys: :reply_to, :to, :topic, :message. + sig { params(params: T::Hash[Symbol, T.nilable(String)]).void } def notification_email(params = {}) from = SiteSetting.value('emails')['from'] reply_to = params[:reply_to] subject = params[:topic] - @html_mailbody = params[:message].gsub("\n", '
') - @text_mailbody = strip_tags(params[:message]) + message = T.must(params[:message]) + @html_mailbody = T.let(message.gsub("\n", '
'), T.nilable(String)) + @text_mailbody = T.let(strip_tags(message), T.nilable(String)) to = params[:to] mail(from: from, reply_to: reply_to, to: to, subject: subject) diff --git a/app/mailers/feedback_reply_mailer.rb b/app/mailers/feedback_reply_mailer.rb index 2743a2212..a635edd58 100644 --- a/app/mailers/feedback_reply_mailer.rb +++ b/app/mailers/feedback_reply_mailer.rb @@ -1,10 +1,13 @@ +# typed: strict # frozen_string_literal: true class FeedbackReplyMailer < ActionMailer::Base + extend T::Sig + sig { params(reply_to: String, to: T.nilable(String), body: T.nilable(String), exercise_name: String).void } def feedback_email(reply_to, to, body, exercise_name) from = SiteSetting.value('emails')['from'] subject = "[TMC] Reply to your feedback for exercise #{exercise_name}" - @mailbody = body + @mailbody = T.let(body, T.nilable(String)) mail(from: from, reply_to: reply_to, to: to, subject: subject) end end diff --git a/app/mailers/new_organization_request_mailer.rb b/app/mailers/new_organization_request_mailer.rb index 3356765a6..f8f14fd0b 100644 --- a/app/mailers/new_organization_request_mailer.rb +++ b/app/mailers/new_organization_request_mailer.rb @@ -1,13 +1,16 @@ +# typed: strict # frozen_string_literal: true class NewOrganizationRequestMailer < ActionMailer::Base + extend T::Sig + sig { params(organization: Organization).void } def request_email(organization) email = SiteSetting.value('administrative_email') if email.empty? Rails.logger.warn 'Not sending a notification on a new organization because administrative_email is not defined. ' end - @organization = organization - @creator = organization.creator + @organization = T.let(organization, T.nilable(Organization)) + @creator = T.let(organization.creator, T.nilable(User)) mail(from: SiteSetting.value('emails')['from'], to: email, subject: "New TestMyCode Organization Request: #{organization.name}") end end diff --git a/app/mailers/password_reset_key_mailer.rb b/app/mailers/password_reset_key_mailer.rb index 06dde6819..17f780116 100644 --- a/app/mailers/password_reset_key_mailer.rb +++ b/app/mailers/password_reset_key_mailer.rb @@ -1,13 +1,16 @@ +# typed: strict # frozen_string_literal: true class PasswordResetKeyMailer < ActionMailer::Base + extend T::Sig + sig { params(user: User, key: ActionToken, origin: T.nilable(String)).void } def reset_link_email(user, key, origin = nil) - @user = user - @origin = origin + @user = T.let(user, T.nilable(User)) + @origin = T.let(origin, T.nilable(String)) settings = SiteSetting.value('emails') subject = 'Reset your mooc.fi account password' - @url = settings['baseurl'].sub(/\/+$/, '') + '/reset_password/' + key.token + @url = T.let(settings['baseurl'].sub(/\/+$/, '') + '/reset_password/' + key.token, T.nilable(String)) mail(from: settings['from'], to: user.email, subject: subject) end end diff --git a/app/mailers/review_mailer.rb b/app/mailers/review_mailer.rb index 1357a7b7c..0c8ae8497 100644 --- a/app/mailers/review_mailer.rb +++ b/app/mailers/review_mailer.rb @@ -1,14 +1,19 @@ +# typed: strict # frozen_string_literal: true class ReviewMailer < ActionMailer::Base + extend T::Sig + sig { params(review: Review).void } def review_email(review) settings = SiteSetting.value('emails') + # belongs_to associations are required, so a saved review has both. + submission = T.must(review.submission) subject = '[TMC] Code Review' - @review = review - @url = settings['baseurl'].sub(/\/+$/, '') + "/submissions/#{review.submission.id}/reviews" + @review = T.let(review, T.nilable(Review)) + @url = T.let(settings['baseurl'].sub(/\/+$/, '') + "/submissions/#{submission.id}/reviews", T.nilable(String)) from = settings['from'] - reply_to = review.reviewer.email - mail(from: from, reply_to: reply_to, to: review.submission.user.email, subject: subject) + reply_to = T.must(review.reviewer).email + mail(from: from, reply_to: reply_to, to: T.must(submission.user).email, subject: subject) end end diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index f75cccd13..b4c3abd75 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -1,17 +1,20 @@ +# typed: strict # frozen_string_literal: true require 'cgi' class UserMailer < ActionMailer::Base + extend T::Sig + sig { params(user: User, origin: T.nilable(String), language: T.nilable(String)).void } def email_confirmation(user, origin = nil, language = nil) # For the Elements course, emails often bounce because the course does not mention mooc.fi handles the technical implementation of the course. # To protect our delivery rates we temporaily disable sending this email. return if origin && origin.downcase.include?('elements') - @origin = origin - @user = user + @origin = T.let(origin, T.nilable(String)) + @user = T.let(user, T.nilable(User)) token = user.verification_tokens.email.create! - @url = confirm_email_url(@user.id, token.token, language: language) + @url = T.let(confirm_email_url(user.id, token.token, language: language), T.nilable(String)) subject = 'Confirm your mooc.fi account email address' if language == 'en' || language == 'en-lu' || language == 'en-ie' subject = 'Vahvista mooc.fi-tilisi sähköpostiosoite' if language == 'fi' subject = 'Bekräfta e-postadressen för ditt mooc.fi-konto' if language == 'se' @@ -40,7 +43,7 @@ def email_confirmation(user, origin = nil, language = nil) if origin origin_name = origin.downcase.tr(' ', '_').gsub(/[.\/]/, '') origin_name += "_#{language}" if language - @url = confirm_email_url(@user.id, token.token, language: language, origin: CGI.escape(origin_name)) + @url = confirm_email_url(user.id, token.token, language: language, origin: CGI.escape(origin_name)) template_path = Rails.root.join('config', 'email_templates', 'user_mailer', 'email_confirmation') html_template_path = template_path.join("#{origin_name}.html.erb") text_template_path = template_path.join("#{origin_name}.text.erb") @@ -57,18 +60,20 @@ def email_confirmation(user, origin = nil, language = nil) mail(from: SiteSetting.value('emails')['from'], to: user.email, subject: subject) end + sig { params(user: User).void } def destroy_confirmation(user) - @user = user + @user = T.let(user, T.nilable(User)) token = user.verification_tokens.delete_user.create! - @url = verify_destroying_user_url(@user.id, token.token) + @url = T.let(verify_destroying_user_url(user.id, token.token), T.nilable(String)) mail(from: SiteSetting.value('emails')['from'], to: user.email, subject: 'Confirm deleting your mooc.fi account') end private + sig { returns(String) } def base_url - @base_url ||= begin + @base_url ||= T.let(begin settings = SiteSetting.value('emails') settings['baseurl'].sub(/\/+$/, '') - end + end, T.nilable(String)) end end diff --git a/app/models/ability.rb b/app/models/ability.rb index 812fc015b..44d4e7900 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -1,13 +1,16 @@ +# typed: strict # frozen_string_literal: true # CanCan ability definitions. # # See: https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities class Ability + extend T::Sig include CanCan::Ability # +auth_source+ is :courses_mooc_fi_token when the user authenticated with a courses.mooc.fi # access token; account changes are then denied to everyone, administrators included. + sig { params(user: User, auth_source: T.nilable(Symbol)).void } def initialize(user, auth_source: nil) if user.administrator? can :manage, :all diff --git a/app/models/action_token.rb b/app/models/action_token.rb index f75db4e9e..9e2105835 100644 --- a/app/models/action_token.rb +++ b/app/models/action_token.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'securerandom' @@ -8,6 +9,7 @@ # may be used once to set a new password. # A password reset key is valid for a limited time and may safely be left unused. class ActionToken < ApplicationRecord + extend T::Sig belongs_to :user validates :user_id, presence: true, uniqueness: true validates :token, uniqueness: true # this going wrong should be extremely unlikely @@ -16,6 +18,7 @@ class ActionToken < ApplicationRecord enum action: %i[confirm_email reset_password enroll_course] + sig { params(user: User).returns(ActionToken) } def self.generate_password_reset_key_for(user) old_key = user.password_reset_key old_key&.destroy @@ -25,11 +28,13 @@ def self.generate_password_reset_key_for(user) key end + sig { returns(T::Boolean) } def expired? - expires_at < Time.now + T.must(expires_at) < Time.now end private + sig { void } def randomize_token self.token = SecureRandom.urlsafe_base64 end diff --git a/app/models/api_version.rb b/app/models/api_version.rb index 80a8ae34a..f0d5dbf84 100644 --- a/app/models/api_version.rb +++ b/app/models/api_version.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true module ApiVersion diff --git a/app/models/application_record.rb b/app/models/application_record.rb index 71fbba5b3..f758b63e7 100644 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true class ApplicationRecord < ActiveRecord::Base diff --git a/app/models/assistantship.rb b/app/models/assistantship.rb index 109a56acc..5f49e2e45 100644 --- a/app/models/assistantship.rb +++ b/app/models/assistantship.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true class Assistantship < ApplicationRecord diff --git a/app/models/available_point.rb b/app/models/available_point.rb index 9a17b6636..54684d49c 100644 --- a/app/models/available_point.rb +++ b/app/models/available_point.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'point_comparison' @@ -7,6 +8,7 @@ # these are recreated every time a course is refreshed. # Instead they are always searched for (course_id, name). class AvailablePoint < ApplicationRecord + extend T::Sig include PointComparison include Swagger::Blocks @@ -26,6 +28,7 @@ class AvailablePoint < ApplicationRecord validates :name, presence: true validate :name_must_not_contain_whitespace + sig { params(course: Course, included_exercises: T::Enumerable[Exercise], hidden: T::Boolean).returns(Integer) } def self.course_points_of_exercises(course, included_exercises, hidden = false) available_points = AvailablePoint.arel_table exercises = Exercise.arel_table @@ -46,22 +49,26 @@ def self.course_points_of_exercises(course, included_exercises, hidden = false) end end + sig { params(course: Course, exercises: T::Enumerable[Exercise]).returns(ActiveRecord::Relation) } def self.course_points_of_exercises_list(course, exercises) course_points(course).where(exercise_id: exercises.map(&:id)) end + sig { params(course: Course).returns(ActiveRecord::Relation) } def self.course_points(course) joins(:exercise) .where(exercises: { course_id: course.id, hidden: false, hide_submission_results: false, disabled_status: 0 }) end # Selects all points for list of courses (with course_id for convenience) + sig { params(courses: T::Enumerable[Course]).returns(ActiveRecord::Relation) } def self.courses_points(courses) select('available_points.*, exercises.course_id') .joins(:exercise) .where(exercises: { course_id: courses.map(&:id), hide_submission_results: false }) end + sig { params(course: Course, sheetnames: T.any(String, T::Array[String])).returns(T::Hash[String, Integer]) } def self.course_sheet_points(course, sheetnames) available_points = AvailablePoint.arel_table exercises = Exercise.arel_table @@ -72,22 +79,24 @@ def self.course_sheet_points(course, sheetnames) .where(exercises[:hide_submission_results].eq(false)) .group(exercises[:gdocs_sheet]) - res = {} + res = T.let({}, T::Hash[String, Integer]) ActiveRecord::Base.connection.execute(query.to_sql).each do |record| res[record['gdocs_sheet']] = record['count'].to_i end res end + sig { params(course: Course, sheet: T.nilable(String)).returns(ActiveRecord::Relation) } def self.course_sheet_points_list(course, sheet) joins(:exercise) .where(exercises: { course_id: course.id, gdocs_sheet: sheet }) end + sig { params(user: User, submission: T.nilable(Submission)).returns(T.nilable(AwardedPoint)) } def award_to(user, submission = nil) point_awarded_at = submission ? submission.created_at : Time.zone.now AwardedPoint.create!( - course_id: exercise.course_id, + course_id: T.must(exercise).course_id, name: name, user_id: user.id, submission: submission, @@ -97,6 +106,7 @@ def award_to(user, submission = nil) end private + sig { void } def name_must_not_contain_whitespace errors.add(:name, "can't contain whitespace") if /\s+/ =~ name end diff --git a/app/models/awarded_point.rb b/app/models/awarded_point.rb index c4873d112..e7597afa6 100644 --- a/app/models/awarded_point.rb +++ b/app/models/awarded_point.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'point_comparison' @@ -8,6 +9,7 @@ # reference can be nil if the submission has been deleted. class AwardedPoint < ApplicationRecord + extend T::Sig include PointComparison include Swagger::Blocks @@ -22,6 +24,7 @@ class AwardedPoint < ApplicationRecord property :created_at, type: :string, example: '2016-10-17T11:10:17.295+03:00' end + sig { returns(T::Hash[String, T.untyped]) } def point_as_json as_json only: %i[ id @@ -42,10 +45,11 @@ def point_as_json property :exercise_id, type: :integer, example: 1 end - def self.as_json_with_exercise_ids(related_exercises) - related_exercises = related_exercises.map { |e| ["#{e.course_id}-#{e.name}", e.id] }.to_h - all.map do |p| - { awarded_point: p.point_as_json, exercise_id: related_exercises["#{p.course_id}-#{p.submission.exercise_name}"] } + sig { params(points: T::Enumerable[AwardedPoint], related_exercises: T::Enumerable[Exercise]).returns(T::Array[T::Hash[Symbol, T.untyped]]) } + def self.as_json_with_exercise_ids(points, related_exercises) + exercise_ids = related_exercises.map { |e| ["#{e.course_id}-#{e.name}", e.id] }.to_h + points.map do |p| + { awarded_point: p.point_as_json, exercise_id: exercise_ids["#{p.course_id}-#{T.must(p.submission).exercise_name}"] } end end @@ -57,6 +61,7 @@ def self.as_json_with_exercise_ids(related_exercises) after_save :kafka_update_points after_destroy :kafka_update_points + sig { params(exercise: Exercise, user: User).returns(ActiveRecord::Relation) } def self.exercise_user_points(exercise, user) return none if exercise.hide_submission_results where(course_id: exercise.course_id, user_id: user.id) @@ -65,10 +70,12 @@ def self.exercise_user_points(exercise, user) exercise.course_id, exercise.name) end + sig { params(course: Course, user: User).returns(ActiveRecord::Relation) } def self.course_user_points(course, user) where(course_id: course.id, user_id: user.id) end + sig { params(course: Course, include_admins: T::Boolean, hidden: T::Boolean, only_for_user: T.nilable(User)).returns(Integer) } def self.course_points(course, include_admins = false, hidden = false, only_for_user = nil) awarded_points = AwardedPoint.arel_table users = User.arel_table @@ -104,6 +111,7 @@ def self.course_points(course, include_admins = false, hidden = false, only_for_ end end + sig { params(course: Course, user: User, sheetname: String).returns(ActiveRecord::Relation) } def self.course_user_sheet_points(course, user, sheetname) course_user_points(course, user) .joins('INNER JOIN available_points ON available_points.name = awarded_points.name') @@ -112,6 +120,7 @@ def self.course_user_sheet_points(course, user, sheetname) .group('awarded_points.id') end + sig { params(course: Course, sheetnames: T.any(String, T::Array[String]), include_admins: T::Boolean, only_for_user: T.nilable(User)).returns(T::Hash[String, Integer]) } def self.course_sheet_points(course, sheetnames, include_admins = false, only_for_user = nil) awarded_points = AwardedPoint.arel_table available_points = AvailablePoint.arel_table @@ -134,7 +143,7 @@ def self.course_sheet_points(course, sheetnames, include_admins = false, only_fo query.join(users).on(users[:id].eq(awarded_points[:user_id])).where(users[:id].eq(only_for_user.id)) end - res = {} + res = T.let({}, T::Hash[String, Integer]) ActiveRecord::Base.connection.execute(query.to_sql).map do |record| res[record['gdocs_sheet']] = record['count'].to_i end @@ -142,6 +151,7 @@ def self.course_sheet_points(course, sheetnames, include_admins = false, only_fo end # Loads users that have any points for the course/sheet + sig { params(course: Course, sheetname: String).returns(ActiveRecord::Relation) } def self.users_in_course_with_sheet(course, sheetname) users = User.arel_table @@ -154,6 +164,7 @@ def self.users_in_course_with_sheet(course, sheetname) end # Gets a hash of user to array of point names awarded for exercises of the given sheet + sig { params(course: Course, sheetname: String, opts: T::Hash[Symbol, T::Boolean]).returns(T::Hash[String, T::Array[String]]) } def self.per_user_in_course_with_sheet(course, sheetname, opts = {}) users = User.arel_table awarded_points = AwardedPoint.arel_table @@ -162,10 +173,9 @@ def self.per_user_in_course_with_sheet(course, sheetname, opts = {}) .project([users[:login].as('username'), awarded_points[:name].as('name')]) .to_sql - result = {} + result = T.let({}, T::Hash[String, T::Array[String]]) ActiveRecord::Base.connection.execute(sql).each do |record| - result[record['username']] ||= [] - result[record['username']] << record['name'] + (result[record['username']] ||= []) << record['name'] end result.default = [] result @@ -173,6 +183,7 @@ def self.per_user_in_course_with_sheet(course, sheetname, opts = {}) # Gets a hash of user to count of points awarded for exercises of the given sheet # TODO find users, shttename -> sheetnames + sig { params(course: Course, sheetnames: T.any(String, T::Array[String]), only_for_user: T.nilable(User), hidden: T::Boolean).returns(T::Hash[String, T::Hash[String, Integer]]) } def self.count_per_user_in_course_with_sheet(course, sheetnames, only_for_user = nil, hidden = false) users = User.arel_table exercises = Exercise.arel_table @@ -183,15 +194,14 @@ def self.count_per_user_in_course_with_sheet(course, sheetnames, only_for_user = query.where(users[:id].eq(only_for_user.id)) if only_for_user - result = {} + result = T.let({}, T::Hash[String, T::Hash[String, Integer]]) ActiveRecord::Base.connection.execute(query.to_sql).each do |record| - result[record['username']] ||= {} - result[record['username']][record['gdocs_sheet']] ||= 0 - result[record['username']][record['gdocs_sheet']] = record['count'].to_i + (result[record['username']] ||= {})[record['gdocs_sheet']] = record['count'].to_i end result end + sig { params(user: User).returns(T::Array[Integer]) } def self.all_awarded(user) awarded_points = AwardedPoint.arel_table exercises = Exercise.arel_table @@ -211,10 +221,12 @@ def self.all_awarded(user) ActiveRecord::Base.connection.execute(awarded_query.to_sql).to_a.map { |h| h['id'] } end + sig { params(query: ActiveRecord::Relation).returns(ActiveRecord::Relation) } private_class_method def self.without_admins(query) query.joins('INNER JOIN users ON users.id = awarded_points.user_id').where(users: { administrator: false }) end + sig { params(course: Course, sheetnames: T.any(String, T::Array[String]), hidden: T.nilable(T.any(T::Boolean, T::Hash[Symbol, T::Boolean]))).returns(Arel::SelectManager) } private_class_method def self.per_user_in_course_with_sheet_query(course, sheetnames, hidden = false) users = User.arel_table awarded_points = AwardedPoint.arel_table @@ -237,15 +249,17 @@ def self.all_awarded(user) end private + sig { void } def kafka_update_points - return if !self.course.moocfi_id || self.course.moocfi_id.blank? - exercise = self.submission.exercise - KafkaBatchUpdatePoints.create!(course_id: self.course_id, user_id: self.user_id, exercise_id: exercise.id, task_type: 'user_progress') - KafkaBatchUpdatePoints.create!(course_id: self.course_id, user_id: self.user_id, exercise_id: exercise.id, task_type: 'user_points') + return if !T.must(self.course).moocfi_id || T.must(self.course).moocfi_id.blank? + exercise = T.must(self.submission).exercise + KafkaBatchUpdatePoints.create!(course_id: self.course_id, user_id: self.user_id, exercise_id: T.must(exercise).id, task_type: 'user_progress') + KafkaBatchUpdatePoints.create!(course_id: self.course_id, user_id: self.user_id, exercise_id: T.must(exercise).id, task_type: 'user_points') end + sig { void } def create_organization_membership - organization = self.course.organization + organization = T.must(T.must(self.course).organization) user = self.user OrganizationMembership.create!(user: user, organization: organization) unless organization.member?(user) end diff --git a/app/models/banned_email.rb b/app/models/banned_email.rb index 27a7f5335..c2bcfa4db 100644 --- a/app/models/banned_email.rb +++ b/app/models/banned_email.rb @@ -1,9 +1,12 @@ +# typed: strict # frozen_string_literal: true class BannedEmail < ApplicationRecord + extend T::Sig validates :email, presence: true, uniqueness: { case_sensitive: false } # Returns true if the given email is banned. Handles emails with +prefiexes by removing the prefix and checking if that address is banned. + sig { params(email: String).returns(T::Boolean) } def self.banned?(email) email = email.strip email = email.gsub(/\+.*@/, '@').downcase diff --git a/app/models/certificate.rb b/app/models/certificate.rb index 875854195..824be3b6f 100644 --- a/app/models/certificate.rb +++ b/app/models/certificate.rb @@ -1,27 +1,30 @@ +# typed: strict # frozen_string_literal: true require 'pdfkit' class Certificate < ApplicationRecord + extend T::Sig belongs_to :user belongs_to :course validates :name, :course, :user, presence: true before_save :generate + sig { void } def generate visible_exercises, available_points = visible_exercises_and_points_for data = File.read(File.join(path, 'certificate.html')) - awarded_points = AwardedPoint.course_user_points(course, user).reject do |p| + awarded_points = AwardedPoint.course_user_points(T.must(course), T.must(user)).reject do |p| exercise = p.submission.exercise exercise.nil? ? false : p.submission.exercise.hide_submission_results? end data %= { time: Time.zone.now.to_f * 1000, name: name, - course: course.formal_name || course.title, - weeks: course.exercise_groups.count, + course: T.must(course).formal_name || T.must(course).title, + weeks: T.must(course).exercise_groups.count, exercises: visible_exercises.count, points: awarded_points.count, point_names: awarded_points.map(&:name).join(','), @@ -44,14 +47,16 @@ def generate image_dpi: 300).to_pdf end + sig { returns(String) } def path - File.join(course.clone_path, 'certificate') + File.join(T.must(course).clone_path, 'certificate') end private + sig { returns([T::Array[Exercise], Integer]) } def visible_exercises_and_points_for - visible_exercises = course.exercises.select { |e| e.points_visible_to?(user) } - total_available = AvailablePoint.course_points_of_exercises(course, visible_exercises, hidden: true) + visible_exercises = T.must(course).exercises.select { |e| e.points_visible_to?(T.must(user)) } + total_available = AvailablePoint.course_points_of_exercises(T.must(course), visible_exercises, true) [visible_exercises, total_available] end end diff --git a/app/models/course.rb b/app/models/course.rb index d3f1cba54..ae7feb0e0 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -1,9 +1,11 @@ +# typed: strict # frozen_string_literal: true require 'system_commands' require 'date_and_time_utils' class Course < ApplicationRecord + extend T::Sig include SystemCommands include Swagger::Blocks @@ -66,6 +68,7 @@ class Course < ApplicationRecord end end + sig { returns(T::Hash[Symbol, T.untyped]) } def course_as_json { name: name, @@ -120,6 +123,7 @@ def course_as_json property :title, type: :string, example: 'testcourse' end + sig { params(view_context: ActionView::Base).returns(T::Hash[String, T.untyped]) } def links_as_json(view_context) { id: id, @@ -190,6 +194,7 @@ def links_as_json(view_context) enum disabled_status: %i[enabled disabled] enum paste_visibility: %i[open secured no-tests-public everyone completed-only] + sig { void } def destroy # Optimization: delete dependent objects quickly. # Rails' :dependent => :delete_all is very slow. @@ -216,6 +221,7 @@ def destroy .group('courses.id') end + sig { params(course_template: CourseTemplate).returns(Course) } def self.new_from_template(course_template) Course.new(name: course_template.name, title: course_template.title, @@ -239,7 +245,10 @@ def self.new_from_template(course_template) delegate :source_backend=, to: :course_template_obj + sig { params(user: User).returns(T::Boolean) } def visible_to?(user) + hide_after = self.hide_after + hidden_if_registered_after = self.hidden_if_registered_after user.administrator? || user.teacher?(organization) || user.assistant?(self) || ( @@ -255,15 +264,19 @@ def visible_to?(user) ) end + sig { params(x: T.untyped).void } def hide_after=(x) - super(DateAndTimeUtils.to_time(x, prefer_end_of_day: true)) + # Active Record casts any Time to TimeWithZone; Tapioca types the writer as TimeWithZone only. + super(T.unsafe(DateAndTimeUtils.to_time(x, prefer_end_of_day: true))) end + sig { params(x: T.untyped).void } def hidden_if_registered_after=(x) - super(DateAndTimeUtils.to_time(x, prefer_end_of_day: false)) + super(T.unsafe(DateAndTimeUtils.to_time(x, prefer_end_of_day: false))) end # This could eventually be made a hstore + sig { params(new_options: T::Hash[String, T.untyped]).void } def options=(new_options) self.hide_after = new_options['hide_after'].presence @@ -286,11 +299,13 @@ def options=(new_options) self.certificate_unlock_spec = new_options['certificate_unlock_spec'].presence end + sig { params(exercises: T.nilable(T::Enumerable[Exercise])).returns(T::Array[String]) } def gdocs_sheets(exercises = nil) exercises ||= self.exercises.select { |ex| !ex.hidden? && ex.published? } - exercises.map(&:gdocs_sheet).reject(&:nil?).uniq + exercises.map(&:gdocs_sheet).compact.uniq end + sig { returns(String) } def self.cache_root "#{FileStore.root}/course" end @@ -300,10 +315,12 @@ def self.cache_root delegate :cache_path, to: :course_template_obj # Holds a clone of the course repository + sig { returns(String) } def clone_path "#{cache_path}/clone" end + sig { returns(T.nilable(String)) } def git_revision Dir.chdir clone_path do output = `git rev-parse --verify HEAD` @@ -313,44 +330,50 @@ def git_revision nil end + sig { returns(String) } def solution_path "#{cache_path}/solution" end + sig { returns(String) } def stub_path "#{cache_path}/stub" end + sig { returns(String) } def stub_zip_path "#{cache_path}/stub_zip" end + sig { returns(String) } def solution_zip_path "#{cache_path}/solution_zip" end + sig { params(force_reload: T::Boolean).returns(T::Array[ExerciseGroup]) } def exercise_groups(force_reload = false) - @groups = nil if force_reload - @groups ||= begin + @groups = T.let(nil, T.nilable(T::Array[ExerciseGroup])) if force_reload + @groups ||= T.let(begin result = exercises.all.map(&:exercise_group_name).uniq .map { |gname| ExerciseGroup.new(self, gname) } - new_parents = [] begin - all_parents = result.map(&:parent_name).reject(&:nil?) + all_parents = result.map(&:parent_name).compact new_parents = all_parents.reject { |pn| result.any? { |eg| eg.name == pn } }.uniq result += new_parents.map { |pn| ExerciseGroup.new(self, pn) } end until new_parents.empty? result.sort - end + end, T.nilable(T::Array[ExerciseGroup])) end + sig { params(name: String, force_reload: T::Boolean).returns(T.nilable(ExerciseGroup)) } def exercise_group_by_name(name, force_reload = false) exercise_groups(force_reload).find { |eg| eg.name == name } end # Returns exercises in group `name`, or whose full name is `name`. + sig { params(name: String, force_reload: T::Boolean).returns(T::Array[Exercise]) } def exercises_by_name_or_group(name, force_reload = false) group = exercise_group_by_name(name, force_reload) exercises.to_a.select { |ex| ex.name == name || (group && ex.belongs_to_exercise_group?(group)) } @@ -358,6 +381,7 @@ def exercises_by_name_or_group(name, force_reload = false) # Set of names of the exercises in `exercises_to_check` the user may open, including those that need no unlock. # Batched form of Exercise#unlocked_for? without resolving pending unlocks. + sig { params(user: User, exercises_to_check: T::Enumerable[Exercise]).returns(T::Set[T.nilable(String)]) } def unlocked_exercise_names_for(user, exercises_to_check) from_rows = unlocks.where(user_id: user.id).where('valid_after IS NULL OR valid_after < ?', Time.now).pluck(:exercise_name).to_set exercises_to_check.select do |ex| @@ -371,43 +395,52 @@ def unlocked_exercise_names_for(user, exercises_to_check) end.to_set(&:name) end + sig { params(user: User).returns(T::Array[Exercise]) } def unlockable_exercises_for(user) UncomputedUnlock.resolve(self, user) unlocked = unlocks.where(user_id: user.id).pluck(:exercise_name) exercises.to_a.select { |ex| !unlocked.include?(ex.name) && ex.unlockable_for?(user) } end + sig { returns(NilClass) } def reload super @groups = nil end + sig { params(current_user_id: Integer).returns(CourseTemplateRefresh) } def refresh(current_user_id) CourseTemplateRefresh.create!(user_id: current_user_id, course_template_id: self.course_template_id) end + sig { void } def delete_cache FileUtils.rm_rf cache_path if custom? end + sig { returns(T::Array[String]) } def self.valid_source_backends ['git'] end + sig { returns(String) } def self.default_source_backend 'git' end + sig { returns(T.nilable(ActiveSupport::TimeWithZone)) } def time_of_first_submission sub = submissions.order('created_at ASC').limit(1).first sub&.created_at end + sig { returns(T.nilable(ActiveSupport::TimeWithZone)) } def time_of_last_submission sub = submissions.order('created_at DESC').limit(1).first sub&.created_at end + sig { returns(ActiveRecord::Relation) } def reviews_required submissions.where( requires_review: true, @@ -417,6 +450,7 @@ def reviews_required ) end + sig { returns(ActiveRecord::Relation) } def reviews_requested submissions.where( requests_review: true, @@ -426,10 +460,12 @@ def reviews_requested ) end + sig { returns(ActiveRecord::Relation) } def submissions_to_review submissions.where('(requests_review OR requires_review) AND NOT reviewed AND NOT newer_submission_reviewed AND NOT review_dismissed') end + sig { params(user: User).returns(T::Boolean) } def certificate_downloadable_for?(user) user.administrator? || user.teacher?(organization) || ( @@ -439,6 +475,7 @@ def certificate_downloadable_for?(user) UnlockSpec.new(self, ActiveSupport::JSON.decode(certificate_unlock_spec)).permits_unlock_for?(user))) end + sig { void } def toggle_submission_result_visiblity self.hide_submission_results = !hide_submission_results save! @@ -448,6 +485,7 @@ def toggle_submission_result_visiblity # :available_points => number of available points, # :points_by_user => {user_id => number_of_points} # } + sig { returns(T::Hash[String, T::Hash[Symbol, T.untyped]]) } def exercise_group_completion_by_user # TODO: clean up exercise group discovery @@ -455,10 +493,10 @@ def exercise_group_completion_by_user .where(disabled_status: 0) .select(&:_fast_visible?) .map(&:name) - .map { |name| name =~ /^(.+)-[^-]+$/ ? Regexp.last_match(1) : '' } + .map { |name| name =~ /^(.+)-[^-]+$/ ? T.must(Regexp.last_match(1)) : '' } .uniq - result = {} + result = T.let({}, T::Hash[String, T::Hash[Symbol, T.untyped]]) for group in groups conn = ActiveRecord::Base.connection @@ -485,13 +523,14 @@ def exercise_group_completion_by_user # Returns a hash of exercise group => { # { awarded: double, late: double } # } + sig { params(user: User).returns(T::Hash[String, T::Hash[Symbol, Numeric]]) } def exercise_group_completion_counts_for_user(user) # TODO: clean up exercise group discovery - groups = exercises.enabled.map(&:name).map { |name| name =~ /^(.+)-[^-]+$/ ? Regexp.last_match(1) : '' }.uniq.sort + groups = exercises.enabled.map(&:name).map { |name| name =~ /^(.+)-[^-]+$/ ? T.must(Regexp.last_match(1)) : '' }.uniq.sort conn = ActiveRecord::Base.connection - groups.each_with_object({}) do |group, result| + groups.each_with_object(T.let({}, T::Hash[String, T::Hash[Symbol, Numeric]])) do |group, result| available_points = ExerciseGroup.new(self, group).available_point_names next if available_points.empty? @@ -517,50 +556,61 @@ def exercise_group_completion_counts_for_user(user) end end + sig { returns(T::Boolean) } def refreshed? !refreshed_at.nil? end + sig { params(user: User).returns(T::Boolean) } def taught_by?(user) user.teacher?(organization) end + sig { params(user: User).returns(T::Boolean) } def assistant?(user) assistants.exists?(user.id) end + sig { returns(T::Boolean) } def contains_unlock_deadlines? exercise_groups.any?(&:contains_unlock_deadlines?) end + sig { params(material: T.nilable(String)).void } def material_url=(material) return super('') if material.blank? return super("http://#{material}") unless /^https?:\/\//.match?(material) super(material) end + sig { returns(T::Boolean) } def custom? course_template_obj.dummy? end + sig { params(url: T.nilable(String)).void } def external_scoreboard_url=(url) return super("http://#{url}") unless url =~ /^(https?:\/\/|$)/ super(url) end + sig { returns(T::Boolean) } def has_external_scoreboard_url? external_scoreboard_url.present? end + sig { params(organization: Organization, course: Course, user: User).returns(String) } def parsed_external_scoreboard_url(organization, course, user) - format(external_scoreboard_url, user: user.username, course: course.id.to_s, org: organization.slug) + format(T.must(external_scoreboard_url), user: user.username, course: course.id.to_s, org: organization.slug) end private + sig { void } def set_cached_version self.cached_version = course_template_obj.cached_version end + sig { void } def save_template course_template_obj.save! rescue StandardError => e @@ -569,35 +619,40 @@ def save_template end end + sig { returns(CourseTemplate) } def course_template_obj self.course_template ||= CourseTemplate.new_dummy(self) end + sig { void } def check_name_length # If name starts with organization slug (org-course1), then check that # the actual name (course1) is within range (for backward compatibility). - test_range = if !name.nil? && name.start_with?("#{organization.slug}-") + test_range = if !name.nil? && T.must(name).start_with?("#{T.must(organization).slug}-") name_range_with_slug else name_range end - unless !name.nil? && test_range.include?(name.length) + unless !name.nil? && test_range.include?(T.must(name).length) errors.add(:name, "must be between #{name_range} characters") end end + sig { returns(T::Range[Integer]) } def name_range 1..40 end + sig { returns(T::Range[Integer]) } def name_range_with_slug - add_length = organization.slug.length + 1 + add_length = T.must(T.must(organization).slug).length + 1 (name_range.first + add_length)..(name_range.last + add_length) end + sig { void } def check_external_scoreboard_url - format(external_scoreboard_url, user: '', course: '', org: '') if external_scoreboard_url.present? + format(T.must(external_scoreboard_url), user: '', course: '', org: '') if external_scoreboard_url.present? rescue StandardError errors.add(:external_scoreboard_url, 'contains invalid keys') end diff --git a/app/models/course_notification.rb b/app/models/course_notification.rb index 88b43915a..23cc73f45 100644 --- a/app/models/course_notification.rb +++ b/app/models/course_notification.rb @@ -1,7 +1,16 @@ +# typed: strict # frozen_string_literal: true class CourseNotification < ApplicationRecord - attr_accessor :topic, :message, :user, :course + extend T::Sig + + # These shadow the columns and associations of the same names, so they are never persisted. + sig { returns(T.nilable(String)) } + attr_accessor :topic, :message + sig { returns(T.nilable(User)) } + attr_accessor :user + sig { returns(T.nilable(Course)) } + attr_accessor :course belongs_to :course belongs_to :user end diff --git a/app/models/course_template.rb b/app/models/course_template.rb index 9cae1c46c..4e489dd4b 100644 --- a/app/models/course_template.rb +++ b/app/models/course_template.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true # Course stub to be copied by teachers for their own organisations @@ -6,6 +7,7 @@ require 'system_commands' class CourseTemplate < ApplicationRecord + extend T::Sig include SystemCommands validates :name, @@ -38,6 +40,7 @@ class CourseTemplate < ApplicationRecord after_save :update_courses_sourcedata + sig { params(course: Course, options: T::Hash[Symbol, T.nilable(String)]).returns(CourseTemplate) } def self.new_dummy(course, options = {}) CourseTemplate.new(dummy: true, name: course.name, @@ -49,6 +52,7 @@ def self.new_dummy(course, options = {}) source_backend: options[:source_backend] || 'git') end + sig { void } def valid_git_repo? result = sh!('git', 'ls-remote', '--exit-code', source_url, git_branch, timeout: 10) result[:status].success? @@ -56,26 +60,33 @@ def valid_git_repo? errors.add(:base, 'Cannot clone repository. Error: ' + e.to_s) end + sig { void } def valid_source_backend? errors.add(:source_backend, '"not git') unless source_backend == 'git' end + sig { void } def set_default_source_backend - self.source_backend ||= CourseTemplate.default_source_backend + self.source_backend = CourseTemplate.default_source_backend if T.let(source_backend, T.nilable(String)).nil? end + sig { returns(String) } def self.default_source_backend 'git' end + sig { returns(T::Boolean) } def clonable? + expires_at = self.expires_at !hidden? && (expires_at.nil? || expires_at > Time.now) && !dummy? end + sig { returns(String) } def cache_path File.join(Course.cache_root, "#{name}-#{cached_version}") end + sig { void } def increment_cached_version self.cached_version += 1 courses.each do |course| @@ -83,15 +94,18 @@ def increment_cached_version end end + sig { params(current_user_id: Integer).returns(CourseTemplateRefresh) } def refresh(current_user_id) CourseTemplateRefresh.create!(user_id: current_user_id, course_template_id: self.id) end + sig { returns(T::Boolean) } def cache_exists? File.exist?(cache_path) end private + sig { void } def update_courses_sourcedata courses.each do |c| c.cached_version = cached_version diff --git a/app/models/course_template_refresh.rb b/app/models/course_template_refresh.rb index beb0e7fd1..d59b56455 100644 --- a/app/models/course_template_refresh.rb +++ b/app/models/course_template_refresh.rb @@ -1,6 +1,8 @@ +# typed: strict # frozen_string_literal: true class CourseTemplateRefresh < ApplicationRecord + extend T::Sig belongs_to :user, optional: true belongs_to :course_template has_many :course_template_refresh_phases, dependent: :delete_all @@ -9,11 +11,13 @@ class CourseTemplateRefresh < ApplicationRecord enum status: %i[not_started in_progress complete crashed] + sig { params(phase_name: T.untyped, time_ms: T.untyped).returns(CourseTemplateRefreshPhase) } def create_phase(phase_name, time_ms) CourseTemplateRefreshPhase.create(course_template_refresh: self, phase_name: phase_name, time_ms: time_ms) end private + sig { void } def create_first_course_template_refresh_phase CourseTemplateRefreshPhase.create(course_template_refresh: self, phase_name: 'Refresh initialized', time_ms: 0) end diff --git a/app/models/course_template_refresh_phase.rb b/app/models/course_template_refresh_phase.rb index 1692e606f..5741df1b7 100644 --- a/app/models/course_template_refresh_phase.rb +++ b/app/models/course_template_refresh_phase.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true class CourseTemplateRefreshPhase < ApplicationRecord diff --git a/app/models/course_template_refresh_report.rb b/app/models/course_template_refresh_report.rb index 70a7f816e..d42f9f65e 100644 --- a/app/models/course_template_refresh_report.rb +++ b/app/models/course_template_refresh_report.rb @@ -1,18 +1,16 @@ +# typed: strict # frozen_string_literal: true class CourseTemplateRefreshReport < ApplicationRecord + extend T::Sig belongs_to :course_template_refresh serialize :refresh_errors, class: Array, coder: JSON serialize :refresh_warnings, class: Array, coder: JSON serialize :refresh_notices, class: Array, coder: JSON serialize :refresh_timings, class: Hash, coder: JSON - attr_reader :refresh_errors - attr_reader :refresh_warnings - attr_reader :refresh_notices - attr_reader :refresh_timings - + sig { returns(T::Boolean) } def successful? - :refresh_errors.empty? + refresh_errors.blank? end end diff --git a/app/models/deadline_spec.rb b/app/models/deadline_spec.rb index fe9eabd39..a29ab8e77 100644 --- a/app/models/deadline_spec.rb +++ b/app/models/deadline_spec.rb @@ -1,14 +1,19 @@ +# typed: strict # frozen_string_literal: true require 'date_and_time_utils' # Parses and abstracts specification in the "deadline" field of a `metadata.yml` file. class DeadlineSpec # (the name of this class is unfortunate as it confuses IDEs when jumping to tests) + extend T::Sig class InvalidSyntaxError < StandardError; end + # specs is a decoded JSON array. + sig { params(exercise: Exercise, specs: T::Array[T.untyped]).void } def initialize(exercise, specs) @exercise = exercise - @specs = [] + @specs = T.let([], T::Array[SingleSpec]) + @depends_on_unlock_time = T.let(false, T::Boolean) for i in 0...specs.size begin spec = specs[i].to_s.strip @@ -21,51 +26,79 @@ def initialize(exercise, specs) end end + sig { returns(T.nilable(String)) } def universal_description if @specs.empty? nil elsif @specs.size == 1 - @specs.first.universal_description + T.must(@specs.first).universal_description else @specs.map(&:universal_description).join(' or ') + ', whichever comes first' end end + sig { params(user: User).returns(String) } def description_for(user) min_spec(user)&.personal_describer&.call(user) || 'none' end + sig { params(user: User).returns(T.nilable(T.any(Time, ActiveSupport::TimeWithZone, DateTime))) } def deadline_for(user) @specs.map { |s| s.timefun.call(user) }.reject(&:nil?).min end + sig { returns(T::Boolean) } def depends_on_unlock_time? !!@depends_on_unlock_time end + sig { returns(T.nilable(String)) } def static_deadline_spec @specs.select { |n| !n.nil? && DateAndTimeUtils.looks_like_date_or_time(n.raw_spec) }.map(&:raw_spec).first end + sig { returns(T.nilable(String)) } def unlock_deadline_spec @specs.select { |n| !n.nil? && !DateAndTimeUtils.looks_like_date_or_time(n.raw_spec) }.map(&:raw_spec).first end private + sig { params(user: User).returns(T.nilable(SingleSpec)) } def min_spec(user) - @specs.map { |s| [s.timefun.call(user), s] }.reject { |p| p.first.nil? }.min_by(&:first)&.map(&:second) + timed_specs = @specs.filter_map do |s| + time = s.timefun.call(user) + [time, s] if time + end + timed_specs.min_by(&:first)&.last end class SingleSpec + extend T::Sig + + sig do + params( + spec: String, + timefun: T.proc.params(user: User).returns(T.nilable(T.any(Time, ActiveSupport::TimeWithZone, DateTime))), + universal_description: String, + personal_describer: T.proc.params(user: User).returns(String) + ).void + end def initialize(spec, timefun, universal_description, personal_describer) @raw_spec = spec @timefun = timefun @universal_description = universal_description @personal_describer = personal_describer end - attr_accessor :raw_spec, :timefun, :universal_description, :personal_describer + + sig { returns(String) } + attr_accessor :raw_spec, :universal_description + sig { returns(T.proc.params(user: User).returns(T.nilable(T.any(Time, ActiveSupport::TimeWithZone, DateTime)))) } + attr_accessor :timefun + sig { returns(T.proc.params(user: User).returns(String)) } + attr_accessor :personal_describer end + sig { params(spec: String).void } def parse_spec(spec) # A spec is a proc that takes a user and returns a Time object or nil if DateAndTimeUtils.looks_like_date_or_time(spec) @@ -77,7 +110,7 @@ def parse_spec(spec) elsif spec =~ /^unlock\s*[+]\s*(\d+)\s+(minutes?|hours?|days?|weeks?|months?|years?)$/ time_scalar = Regexp.last_match(1) time_unit = Regexp.last_match(2) - time_delta = time_scalar.to_i.send(time_unit) + time_delta = time_scalar.to_i.send(T.must(time_unit)) @depends_on_unlock_time = true timefun = lambda do |user| unlock_time = @exercise.time_unlocked_for(user) diff --git a/app/models/exercise.rb b/app/models/exercise.rb index 8cb93fbf5..c427a4b7f 100644 --- a/app/models/exercise.rb +++ b/app/models/exercise.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'shellwords' @@ -5,6 +6,7 @@ require 'date_and_time_utils' class Exercise < ApplicationRecord + extend T::Sig self.include_root_in_json = false include Swagger::Blocks @@ -124,270 +126,324 @@ class Exercise < ApplicationRecord enum disabled_status: %i[enabled disabled] enum paste_visibility: %i[open secured no-tests-public everyone completed-only] + sig { returns(String) } def relative_path - name.tr('-', '/') + T.must(name).tr('-', '/') end + sig { returns(T.nilable(ExerciseGroup)) } def exercise_group - course.exercise_group_by_name(exercise_group_name) + T.must(course).exercise_group_by_name(exercise_group_name) end + sig { returns(String) } def exercise_group_name - parts = name.split('-') + parts = T.must(name).split('-') parts.pop parts.join('-') end + sig { returns(Integer) } def part - exercise.group_name.tr('^0-9', '').to_i + T.unsafe(self).exercise.group_name.tr('^0-9', '').to_i rescue 0 end + sig { params(group: ExerciseGroup).returns(T::Boolean) } def belongs_to_exercise_group?(group) group.course.id == course_id && (exercise_group_name + '-').start_with?(group.name + '-') end + sig { returns(String) } def clone_path - "#{course.clone_path}/#{relative_path}" + "#{T.must(course).clone_path}/#{relative_path}" end + sig { returns(String) } def solution_path - "#{course.solution_path}/#{relative_path}" + "#{T.must(course).solution_path}/#{relative_path}" end + sig { returns(String) } def stub_path - "#{course.stub_path}/#{relative_path}" + "#{T.must(course).stub_path}/#{relative_path}" end + sig { returns(String) } def stub_zip_file_path - "#{course.stub_zip_path}/#{name}.zip" + "#{T.must(course).stub_zip_path}/#{name}.zip" end + sig { returns(String) } def solution_zip_file_path - "#{course.solution_zip_path}/#{name}.zip" + "#{T.must(course).solution_zip_path}/#{name}.zip" end + sig { returns(Solution) } def solution Solution.new(self) end + sig { params(user: User, value: T::Array[Submission]).void } def set_submissions_by!(user, value) - @submissions_by ||= {} - @submissions_by[user.id] = value + submissions_by_user_id[user.id] = value end + sig { params(user: User).returns(T::Array[Submission]) } def submissions_by(user) - @submissions_by ||= {} - @submissions_by[user.id] ||= submissions.where(user_id: user.id).to_a + submissions_by_user_id[user.id] ||= submissions.where(user_id: user.id).to_a end + sig { returns(T::Hash[T.nilable(Integer), T::Array[Submission]]) } def reload super @submissions_by = {} end # Whether a user may make submissions + sig { params(user: User).returns(T::Boolean) } def submittable_by?(user) returnable? && - (user.administrator? || user.teacher?(course.organization) || user.assistant?(course) || + (user.administrator? || user.teacher?(T.must(course).organization) || user.assistant?(T.must(course)) || (!expired_for?(user) && !hidden? && published? && !disabled? && !user.guest? && unlocked_for?(user))) end # Whether a user may see all metadata about the exercise + sig { params(user: User).returns(T::Boolean) } def visible_to?(user) - user.administrator? || user.teacher?(course.organization) || user.assistant?(course) || + user.administrator? || user.teacher?(T.must(course).organization) || user.assistant?(T.must(course)) || _fast_visible? && (unlocked_for?(user) || unlock_spec_obj.permits_unlock_for?(user)) end + sig { returns(T::Boolean) } def _fast_visible? !hidden? && !disabled? && published? end # Whether the user may see the scoreboard for the exercise + sig { params(user: User).returns(T::Boolean) } def points_visible_to?(user) user.administrator? || - user.teacher?(course.organization) || + user.teacher?(T.must(course).organization) || ( !hidden? && published? && !disabled? && - (course.locked_exercise_points_visible? || unlock_spec_obj.permits_unlock_for?(user)) && + (T.must(course).locked_exercise_points_visible? || unlock_spec_obj.permits_unlock_for?(user)) && !hide_submission_results && - !course.hide_submission_results + !T.must(course).hide_submission_results ) end # Whether the user may download the exercise ZIP file + sig { params(user: User).returns(T::Boolean) } def downloadable_by?(user) - user.administrator? || user.teacher?(course.organization) || user.assistant?(course) || + user.administrator? || user.teacher?(T.must(course).organization) || user.assistant?(T.must(course)) || visible_to?(user) && unlocked_for?(user) end # Whether the exercise has been published (it may still be hidden) + sig { returns(T::Boolean) } def published? + publish_time = self.publish_time !publish_time || publish_time <= Time.now end delegate :deadline_for, to: :deadline_spec_obj + sig { params(user: User).returns(T.nilable(T.any(Time, ActiveSupport::TimeWithZone, DateTime))) } def soft_deadline_for(user) soft_deadline_spec_obj.deadline_for(user) end # Whether the deadline has passed + sig { params(user: User).returns(T::Boolean) } def expired_for?(user) Exercise.deadline_expired?(deadline_for(user)) end + sig { params(user: User).returns(T::Boolean) } def soft_deadline_expired_for?(user) Exercise.deadline_expired?(soft_deadline_for(user)) end # Whether a user has made a submission for this exercise + sig { params(user: User).returns(T::Boolean) } def attempted_by?(user) submissions_by(user).any?(&:processed) end # Whether a user has made a submission with all test cases passing + sig { params(user: User).returns(T::Boolean) } def completed_by?(user) submissions_by(user).any? do |s| s.pretest_error.nil? && s.all_tests_passed? end end + sig { returns(T::Boolean) } def requires_review? !available_review_points.empty? end # Whether a code review for this exercise exists for a submission made by 'user'. + sig { params(user: User).returns(T::Boolean) } def reviewed_for?(user) submissions_by(user).any?(&:reviewed) end # Returns all reviewed submissions for this exercise for 'user' + sig { params(user: User).returns(T::Array[Submission]) } def reviewed_submissions_for(user) submissions_by(user).select(&:reviewed) end # Whether all of the required code review points have been given. # Returns true if the exercise doesn't require code review. + sig { params(user: User).returns(T::Boolean) } def all_review_points_given_for?(user) arp = available_review_points return true if arp.empty? # optimization - user.has_points?(course, arp) + user.has_points?(T.must(course), arp) end + sig { returns(T::Array[String]) } def available_review_points # use 'select' instead of 'where' to use cached value of available_points available_points.to_a.select(&:requires_review).map(&:name) end + sig { params(user: User).returns(T::Array[String]) } def points_for(user) AwardedPoint.exercise_user_points(self, user).map(&:name) end + sig { params(user: User).returns(T::Array[String]) } def missing_review_points_for(user) available_review_points - points_for(user) end + sig { params(spec: T.nilable(String)).void } def unlock_spec=(spec) check_is_json_array_of_strings(spec) - @unlock_spec_obj = UnlockSpec.from_str(course, spec) - super(@unlock_spec_obj.empty? ? nil : spec) + unlock_spec_obj = UnlockSpec.from_str(course, spec) + @unlock_spec_obj = T.let(unlock_spec_obj, T.nilable(UnlockSpec)) + super(unlock_spec_obj.empty? ? nil : spec) end + sig { returns(UnlockSpec) } def unlock_spec_obj - @unlock_spec_obj ||= UnlockSpec.from_str(course, unlock_spec) + @unlock_spec_obj ||= T.let(UnlockSpec.from_str(course, unlock_spec), T.nilable(UnlockSpec)) end + sig { returns(T::Array[T.untyped]) } def unlock_conditions unlock_spec_obj.raw_spec end + sig { params(spec: T.nilable(String)).void } def deadline_spec=(spec) check_is_json_array_of_strings(spec) super(spec) - @deadline_spec_obj = DeadlineSpec.new(self, ActiveSupport::JSON.decode(spec)) + @deadline_spec_obj = T.let(DeadlineSpec.new(self, ActiveSupport::JSON.decode(spec)), T.nilable(DeadlineSpec)) end + sig { params(spec: T.nilable(String)).void } def soft_deadline_spec=(spec) check_is_json_array_of_strings(spec) super(spec) - @soft_deadline_spec_obj = DeadlineSpec.new(self, ActiveSupport::JSON.decode(spec)) + @soft_deadline_spec_obj = T.let(DeadlineSpec.new(self, ActiveSupport::JSON.decode(spec)), T.nilable(DeadlineSpec)) end + sig { returns(DeadlineSpec) } def deadline_spec_obj - @deadline_spec_obj ||= new_deadline_spec_obj(deadline_spec) + @deadline_spec_obj ||= T.let(new_deadline_spec_obj(deadline_spec), T.nilable(DeadlineSpec)) end + sig { returns(DeadlineSpec) } def soft_deadline_spec_obj - @soft_deadline_spec_obj ||= new_deadline_spec_obj(soft_deadline_spec) + @soft_deadline_spec_obj ||= T.let(new_deadline_spec_obj(soft_deadline_spec), T.nilable(DeadlineSpec)) end + sig { returns(T.nilable(String)) } def static_deadline deadline_spec_obj.static_deadline_spec end + sig { returns(T.nilable(String)) } def unlock_deadline deadline_spec_obj.unlock_deadline_spec end + sig { returns(T.nilable(String)) } def soft_static_deadline soft_deadline_spec_obj.static_deadline_spec end + sig { returns(T.nilable(String)) } def soft_unlock_deadline soft_deadline_spec_obj.unlock_deadline_spec end + sig { returns(T::Boolean) } def has_unlock_deadline? unlock_deadline.present? || soft_unlock_deadline.present? end + sig { returns(T::Boolean) } def requires_unlock? !unlock_spec.nil? end + sig { returns(T::Boolean) } def requires_explicit_unlock? deadline_spec_obj.depends_on_unlock_time? end # Date-only unlocks are decided by the clock, not by unlock rows: a user without rows must not stay locked. # Explicit-unlock exercises are excluded because their unlock row starts the deadline timer. + sig { returns(T::Boolean) } def unlocked_by_date? UnlockSpec.date_only?(unlock_spec) && !requires_explicit_unlock? end # Returns when the exercise unlocked for the user, or nil if it is locked or needs no unlock. + sig { params(user: User, resolve_unlocks: T::Boolean).returns(T.nilable(T.any(Time, ActiveSupport::TimeWithZone, DateTime))) } def time_unlocked_for(user, resolve_unlocks = true) return unlock_time_by_date if unlocked_by_date? - UncomputedUnlock.resolve(course, user) if resolve_unlocks + UncomputedUnlock.resolve(T.must(course), user) if resolve_unlocks unlocks.where(user_id: user).find_by('valid_after IS NULL OR valid_after < ?', Time.now)&.created_at end # The unlock date of a date-only exercise once it has passed; nil before it. + sig { returns(T.nilable(T.any(Time, ActiveSupport::TimeWithZone, DateTime))) } def unlock_time_by_date - unlock_date = unlock_spec_obj.valid_after + unlock_date = T.must(unlock_spec_obj.valid_after) unlock_date <= Time.now ? unlock_date : nil end + sig { params(user: User, resolve_unlocks: T::Boolean).returns(T::Boolean) } def unlocked_for?(user, resolve_unlocks = true) res = !requires_unlock? || time_unlocked_for(user, resolve_unlocks) !!res end + sig { params(user: User).returns(T::Boolean) } def unlockable_for?(user) requires_explicit_unlock? && !unlocked_for?(user) && unlock_spec_obj.permits_unlock_for?(user) end + sig { params(new_value: T.untyped).void } def solution_visible_after=(new_value) - super(DateAndTimeUtils.to_time(new_value, prefer_end_of_day: true)) + # Active Record casts any Time to TimeWithZone; Tapioca types the writer as TimeWithZone only. + super(T.unsafe(DateAndTimeUtils.to_time(new_value, prefer_end_of_day: true))) end # Ignore some options if already set; to keep changes done in UI. # metadata.yml support removed, should these be removed from database + sig { params(new_options: T::Hash[String, T.untyped]).void } def options=(new_options) new_options = self.class.default_options.merge(new_options) @@ -407,30 +463,36 @@ def options=(new_options) # Whether this exercise accepts submissions at all. # TMC may be used to distribute exercise templates without tests. + sig { returns(T::Boolean) } def returnable? - if !returnable_forced.nil? - returnable_forced # may be true or false + forced = returnable_forced + if !forced.nil? + forced else - has_tests? && course.initial_refresh_ready? + has_tests? && T.must(course).initial_refresh_ready? end end # The memory limit in megabytes or nil if not set. # Limited by the global limit in site.yml (if any). # Not configurable per-exercise yet but possibly in the future. + sig { returns(T.nilable(Integer)) } def memory_limit global_limit = SiteSetting.value('memory_limit') global_limit&.to_i end + sig { returns(T::Array[String]) } def runtime_params_array ActiveSupport::JSON.decode(runtime_params) end + sig { returns(T::Boolean) } def code_review_requests_enabled? - course.code_review_requests_enabled? && self[:code_review_requests_enabled] + T.must(course).code_review_requests_enabled? && self[:code_review_requests_enabled] end + sig { returns(T::Hash[String, T.untyped]) } def self.default_options { 'deadline' => nil, @@ -448,10 +510,12 @@ def self.default_options } end + sig { returns(ActiveRecord::Relation) } def submissions_having_feedback submissions.where('EXISTS (SELECT 1 FROM feedback_answers WHERE feedback_answers.submission_id = submissions.id)') end + sig { params(users: T.any(ActiveRecord::Relation, T::Array[User]), exercises: T.any(ActiveRecord::Relation, T::Array[Exercise])).returns(Integer) } def self.count_completed(users, exercises) return 0 if exercises.empty? @@ -474,16 +538,24 @@ def self.count_completed(users, exercises) end end + sig { void } def toggle_submission_result_visiblity self.hide_submission_results = !hide_submission_results save! end + sig { params(deadline: T.nilable(T.any(Time, ActiveSupport::TimeWithZone, DateTime)), time: T.any(Time, ActiveSupport::TimeWithZone)).returns(T::Boolean) } def self.deadline_expired?(deadline, time = Time.now) - !deadline.nil? && deadline < time + !deadline.nil? && deadline.to_time < time.to_time end private + sig { returns(T::Hash[T.nilable(Integer), T::Array[Submission]]) } + def submissions_by_user_id + @submissions_by ||= T.let({}, T.nilable(T::Hash[T.nilable(Integer), T::Array[Submission]])) + end + + sig { params(spec: T.nilable(String)).returns(DeadlineSpec) } def new_deadline_spec_obj(spec) if spec DeadlineSpec.new(self, ActiveSupport::JSON.decode(spec)) @@ -492,17 +564,20 @@ def new_deadline_spec_obj(spec) end end + sig { params(enabled: T.untyped, sheetname: T.untyped).returns(T.nilable(String)) } def new_gdocs_sheet(enabled, sheetname) return nil unless enabled return sheetname.to_s if sheetname.present? name_to_gdocs_sheet end + sig { returns(String) } def name_to_gdocs_sheet - sheetname = name.split('-')[0..-2].join('-') + sheetname = T.must(T.must(name).split('-')[0..-2]).join('-') sheetname.empty? ? 'root' : sheetname end + sig { params(value: T.untyped).returns(String) } def to_json_array(value) if !value.nil? value = [value] unless value.is_a?(Array) @@ -512,6 +587,7 @@ def to_json_array(value) end end + sig { params(str: T.nilable(String)).void } def check_is_json_array_of_strings(str) return if str.nil? array = ActiveSupport::JSON.decode(str) @@ -519,6 +595,7 @@ def check_is_json_array_of_strings(str) raise 'JSON array of strings expected' if array.any? { |a| !a.is_a?(String) } end + sig { params(raw_params: T.untyped).returns(String) } def parse_runtime_params(raw_params) if raw_params.nil? '[]' diff --git a/app/models/exercise_group.rb b/app/models/exercise_group.rb index 57422c55b..c33a77cb5 100644 --- a/app/models/exercise_group.rb +++ b/app/models/exercise_group.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'natcmp' @@ -6,30 +7,39 @@ # # Obtainable from Course.exercise_groups and other methods there. class ExerciseGroup + extend T::Sig include Comparable + sig { params(course: Course, name: String).void } def initialize(course, name) @course = course @name = name + @parent_name = T.let(nil, T.nilable(String)) end + sig { returns(Course) } attr_reader :course + sig { returns(String) } attr_reader :name + sig { returns(T.nilable(ExerciseGroup)) } def parent - course.exercise_group_by_name(parent_name) if parent_name + group_name = parent_name + course.exercise_group_by_name(group_name) if group_name end + sig { returns(T.nilable(String)) } def parent_name - @parent_name ||= begin + @parent_name ||= T.let(begin parts = name.split('-') if parts.size > 1 parts.pop parts.join('-') end - end + end, T.nilable(String)) end + sig { params(recursively: T::Boolean).returns(T::Array[Exercise]) } def exercises(recursively) if recursively course.exercises.to_a.select { |e| e.exercise_group_name.start_with?(name) } @@ -38,55 +48,67 @@ def exercises(recursively) end end + sig { returns(T::Array[ExerciseGroup]) } def children course.exercise_groups.select { |eg| eg.name.start_with?(name) && eg != self } end + sig { params(other: ExerciseGroup).returns(Integer) } def <=>(other) Natcmp.natcmp(name, other.name) end + sig { returns(String) } def inspect "" end + sig { returns(T.nilable(DeadlineSpec)) } def hard_group_deadline group_deadline(:deadline_spec_obj) end + sig { returns(T.nilable(DeadlineSpec)) } def soft_group_deadline group_deadline(:soft_deadline_spec_obj) end # Returns true if all exercises in this group have the same deadline + sig { returns(T::Boolean) } def uniform_group_deadlines? exercises(false).map do |e| [e.static_deadline, e.unlock_deadline, e.soft_static_deadline, e.soft_unlock_deadline] end.uniq.length == 1 end + sig { returns(T::Boolean) } def contains_unlock_deadlines? exercises(false).any?(&:has_unlock_deadline?) end + sig { params(deadline: T.nilable(String)).void } def hard_group_deadline=(deadline) set_group_deadline(:deadline_spec=, deadline) end + sig { params(deadline: T.nilable(String)).void } def soft_group_deadline=(deadline) set_group_deadline(:soft_deadline_spec=, deadline) end + sig { returns(T.nilable(T::Array[T.untyped])) } def group_unlock_conditions exercises(false).map(&:unlock_conditions).first end # The group's exercises keyed by raw unlock spec (nil for none); more than one key means # `group_unlock_conditions` shows only the first exercise's conditions. + sig { returns(T::Hash[T.nilable(String), T::Array[Exercise]]) } def exercises_by_unlock_spec exercises(false).group_by(&:unlock_spec) end + sig { params(unlock_conditions: T.nilable(String)).void } def group_unlock_conditions=(unlock_conditions) group_exercises = exercises(false) # Rows granted under other conditions keep their date: fast refresh never revokes them, so moving it would open them early. @@ -99,9 +121,11 @@ def group_unlock_conditions=(unlock_conditions) e.unlock_spec = unlock_conditions e.save! end - update_unlock_dates(group_exercises.first, rows_to_move) unless group_exercises.empty? + first_exercise = group_exercises.first + update_unlock_dates(first_exercise, rows_to_move) if first_exercise end + sig { returns(T::Array[String]) } def available_point_names conn = ActiveRecord::Base.connection @@ -122,16 +146,19 @@ def available_point_names private # Unlock rows copy the date at creation; keep existing rows in step when the date is edited. + sig { params(exercise: Exercise, exercise_names: T::Array[T.nilable(String)]).void } def update_unlock_dates(exercise, exercise_names) spec = exercise.unlock_spec_obj return if spec.empty? Unlock.where(course_id: course.id, exercise_name: exercise_names).update_all(valid_after: spec.valid_after) end + sig { params(method: Symbol).returns(T.nilable(DeadlineSpec)) } def group_deadline(method) exercises(false).map { |n| n.send(method) }.first end + sig { params(method: Symbol, deadline: T.nilable(String)).void } def set_group_deadline(method, deadline) exercises(false).each do |e| e.send(method, deadline) diff --git a/app/models/extra_field.rb b/app/models/extra_field.rb index c3e166922..8fdc3c964 100644 --- a/app/models/extra_field.rb +++ b/app/models/extra_field.rb @@ -1,68 +1,94 @@ +# typed: strict # frozen_string_literal: true # An abstract base for classes representing extra fields on a record. # # See UserField for an example. module ExtraField + extend T::Sig extend ActiveSupport::Concern - included do - def self.extra_field_kind - name.underscore.gsub(/_field$/, '').to_sym + extend T::Helpers + requires_ancestor { UserField } + + module ClassMethods + extend T::Sig + extend T::Helpers + requires_ancestor { T.class_of(UserField) } + + sig { returns(Symbol) } + def extra_field_kind + T.must(name).underscore.gsub(/_field$/, '').to_sym end - def self.all - @all ||= ExtraField.by_kind(extra_field_kind) + sig { returns(T::Array[UserField]) } + def all + @all ||= T.let(ExtraField.by_kind(extra_field_kind), T.nilable(T::Array[UserField])) end - def self.groups + sig { returns(T::Array[T.nilable(String)]) } + def groups all.map(&:group).uniq end - def self.by_group(group) + sig { params(group: T.nilable(String)).returns(T::Array[UserField]) } + def by_group(group) all.select { |field| field.group == group } end end + mixes_in_class_methods(ClassMethods) + # Option values come from the Ruby DSL in config/extra_fields. + sig { params(options: T::Hash[Symbol, T.untyped]).void } def initialize(options = {}) - @options = default_options.merge(options) + @options = T.let(default_options.merge(options), T::Hash[Symbol, T.untyped]) raise 'Name missing' unless @options[:name] - @value_class = Object.const_get(self.class.name + 'Value') + @value_class = T.let(Object.const_get(T.must(self.class.name) + 'Value'), T.class_of(UserFieldValue)) end + sig { returns(T::Hash[Symbol, T.untyped]) } def options @options.clone end + sig { returns(String) } def name @options[:name] end + sig { returns(T.nilable(String)) } def group @options[:group] end + sig { returns(Symbol) } def field_type @options[:field_type].to_sym end + sig { returns(String) } def label @options[:label] || @options[:name] end + sig { returns(T::Boolean) } def should_save? !@options[:hidden] && !@options[:disabled] && @options[:field_type] != :html end + sig { returns(T.class_of(UserFieldValue)) } attr_reader :value_class + sig { returns(ActiveRecord::Relation) } def values value_class.where(kind: kind) end + sig { returns(Symbol) } def kind - self.class.extra_field_kind + T.cast(self.class, T.class_of(UserField)).extra_field_kind end + sig { returns(T::Hash[Symbol, T.untyped]) } def default_options { hidden: false, @@ -71,19 +97,66 @@ def default_options } end + @fields = T.let(nil, T.nilable(T::Hash[Symbol, T::Array[UserField]])) + + sig { params(kind: T.any(String, Symbol)).returns(T::Array[UserField]) } def self.by_kind(kind) - unless @fields - kinds = config_files.map { |file| File.basename(file, '_fields.rb') } - @fields = Hash[kinds.zip(config_files).map { |k, f| [k.to_sym, load_fields(k, f)] }] + fields = @fields ||= config_files.to_h do |file| + file_kind = File.basename(file, '_fields.rb') + [file_kind.to_sym, load_fields(file_kind, file)] end - @fields[kind.to_sym] || [] + fields[kind.to_sym] || [] end + class ConfigDsl + extend T::Sig + sig { returns(T::Array[UserField]) } + attr_reader :fields + + sig { params(field_class: T.class_of(UserField)).void } + def initialize(field_class) + @field_class = field_class + @fields = T.let([], T::Array[UserField]) + @html_count = T.let(0, Integer) + @group = T.let(nil, T.nilable(String)) + end + + sig { params(group_name: String, block: T.proc.void).void } + def group(group_name, &block) + raise "Don't nest groups" if @group + @group = group_name + begin + yield + ensure + @group = nil + end + end + + sig { params(options: T::Hash[Symbol, T.untyped]).void } + def field(options) + @fields << @field_class.new({ group: @group }.merge(options)) + end + + sig { params(text: String, options: T::Hash[Symbol, T.untyped]).void } + def html(text, options = {}) + @html_count += 1 + @fields << @field_class.new({ + name: "html#{@html_count}", + group: @group, + field_type: :html, + label: text + }.merge(options)) + end + end + private_constant :ConfigDsl + private + sig { returns(T::Array[String]) } def self.config_files Dir.glob("#{::Rails.root}/config/extra_fields/*_fields.rb") end + sig { params(kind: T.any(String, Symbol), config_file_path: String).returns(T::Array[UserField]) } def self.load_fields(kind, config_file_path) return [] unless File.exist?(config_file_path) @@ -94,38 +167,8 @@ def self.load_fields(kind, config_file_path) cls = Object.const_get(cls_name) raise "Field class not found: #{cls}" if cls.nil? - dsl = Object.new - dsl.instance_variable_set('@cls', cls) - dsl.instance_variable_set('@fields', []) - dsl.instance_variable_set('@html_count', 0) - - class << dsl - def group(group_name) - raise "Don't nest groups" if @group - @group = group_name - begin - yield - ensure - @group = nil - end - end - - def field(options) - @fields << @cls.new({ group: @group }.merge(options)) - end - - def html(text, options = {}) - @html_count += 1 - @fields << @cls.new({ - name: "html#{@html_count}", - group: @group, - field_type: :html, - label: text - }.merge(options)) - end - end - + dsl = ConfigDsl.new(cls) dsl.instance_eval(File.read(config_file_path)) - dsl.instance_variable_get('@fields') + dsl.fields end end diff --git a/app/models/extra_field_value.rb b/app/models/extra_field_value.rb index 419d2e8bc..b4d370da4 100644 --- a/app/models/extra_field_value.rb +++ b/app/models/extra_field_value.rb @@ -1,27 +1,34 @@ +# typed: strict # frozen_string_literal: true # An abstract base for active record classes representing values for 'ExtraField's. # # See UserFieldValue for an example. module ExtraFieldValue + extend T::Sig extend ActiveSupport::Concern + extend T::Helpers + requires_ancestor { UserFieldValue } included do validates :field_name, uniqueness: { scope: :user_id } end + sig { returns(T.nilable(UserField)) } def field - @field ||= ExtraField.by_kind(field_kind).find { |f| f.name == field_name } + @field ||= T.let(ExtraField.by_kind(field_kind).find { |f| f.name == field_name }, T.nilable(UserField)) end + sig { returns(Symbol) } def field_kind - @field_kind ||= self.class.name.underscore.gsub(/_field_value$/, '').to_sym + @field_kind ||= T.let(T.must(self.class.name).underscore.gsub(/_field_value$/, '').to_sym, T.nilable(Symbol)) end # Unfortunately, value is actually a string that can be put directly in a form. # May want to refactor some day. + sig { returns(T.any(String, T::Boolean)) } def ruby_value - case field.field_type + case T.must(field).field_type when :boolean value.blank? || value == '0' ? false : true else @@ -29,8 +36,9 @@ def ruby_value end end + sig { params(new_value: T.untyped).void } def set_from_form(new_value) - if field.should_save? + if T.must(field).should_save? self.value = case field_kind when :boolean diff --git a/app/models/feedback_answer.rb b/app/models/feedback_answer.rb index 1f870a5bf..8410c7528 100644 --- a/app/models/feedback_answer.rb +++ b/app/models/feedback_answer.rb @@ -1,7 +1,9 @@ +# typed: strict # frozen_string_literal: true # Stores what the student has answered to a single feedback question (for an exercise in a course). class FeedbackAnswer < ApplicationRecord + extend T::Sig belongs_to :feedback_question belongs_to :course belongs_to :exercise, ->(exercise) { where(course: exercise.course) }, foreign_key: :exercise_name, primary_key: :name @@ -10,33 +12,36 @@ class FeedbackAnswer < ApplicationRecord validates_with Validators::FeedbackAnswerFormatValidator + sig { returns(T::Boolean) } def replied? reply_to_feedback_answers.count > 0 end + sig { params(exercise: Exercise).returns(T::Hash[Integer, Float]) } def self.numeric_answer_averages(exercise) - result = {} + result = T.let({}, T::Hash[Integer, Float]) connection.execute(numeric_answer_averages_query(exercise).to_sql).each do |record| result[record['qid'].to_i] = record['avg'].to_f end result end + sig { params(exercise: Exercise).returns(T::Array[T::Hash[Integer, Integer]]) } def self.anonymous_numeric_answers(exercise) - by_submission = {} + by_submission = T.let({}, T::Hash[Integer, T::Hash[Integer, Integer]]) connection.execute(numeric_answers_query(exercise).to_sql).each do |record| sid = record['sid'].to_i qid = record['qid'].to_i answer = record['answer'].to_i - by_submission[sid] ||= {} - by_submission[sid][qid] = answer + (by_submission[sid] ||= {})[qid] = answer end by_submission.values.shuffle! # shuffled to minimize user identifiability end private + sig { params(exercise: Exercise).returns(Arel::SelectManager) } def self.numeric_answers_query(exercise) questions = FeedbackQuestion.arel_table answers = FeedbackAnswer.arel_table @@ -49,6 +54,7 @@ def self.numeric_answers_query(exercise) ) end + sig { params(exercise: Exercise).returns(Arel::SelectManager) } def self.numeric_answer_averages_query(exercise) questions = FeedbackQuestion.arel_table @@ -60,6 +66,7 @@ def self.numeric_answer_averages_query(exercise) ) end + sig { params(exercise: Exercise).returns(Arel::SelectManager) } def self.numeric_answers_base_query(exercise) answers = FeedbackAnswer.arel_table questions = FeedbackQuestion.arel_table diff --git a/app/models/feedback_question.rb b/app/models/feedback_question.rb index 556172d6a..af44f36d2 100644 --- a/app/models/feedback_question.rb +++ b/app/models/feedback_question.rb @@ -1,23 +1,28 @@ +# typed: strict # frozen_string_literal: true class FeedbackQuestion < ApplicationRecord + extend T::Sig include Orderable belongs_to :course has_many :feedback_answers, dependent: :delete_all validates :course, presence: true - validates :kind, presence: true do validate_kind end + validates :kind, presence: true validates :question, presence: true + sig { returns(String) } def title_or_question title || question end + sig { returns(T.nilable(Integer)) } def intrange? kind =~ intrange_regex end + sig { returns(T::Range[Integer]) } def intrange if kind =~ intrange_regex (Regexp.last_match(1).to_i)..(Regexp.last_match(2).to_i) @@ -26,6 +31,7 @@ def intrange end end + sig { returns(T::Hash[Symbol, T.untyped]) } def record_for_api { id: id, @@ -35,14 +41,17 @@ def record_for_api end private + sig { returns(Regexp) } def intrange_regex self.class.intrange_regex end + sig { returns(Regexp) } def self.intrange_regex /^intrange\[(-?\d+)\.\.(-?\d+)\]$/ end + sig { void } def validate_kind errors[:kind] << 'invalid' unless kind == 'text' || kind =~ intrange_regex end diff --git a/app/models/file_store.rb b/app/models/file_store.rb index e476e510f..68f5c06d7 100644 --- a/app/models/file_store.rb +++ b/app/models/file_store.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'fileutils' @@ -9,20 +10,25 @@ # # Note: currently this class provides no concurrency control whatsoever! module FileStore + extend T::Sig + sig { returns(String) } def self.root "#{::Rails.root}/db/files" end + sig { params(relpath: T.any(String, Pathname)).returns(String) } def self.get(relpath) File.read(abspath(relpath)) end + sig { params(relpath: T.any(String, Pathname)).returns(T.nilable(String)) } def self.try_get(relpath) get(relpath) rescue StandardError nil end + sig { params(relpath: T.any(String, Pathname), contents: String).void } def self.put(relpath, contents) path = abspath(relpath) FileUtils.mkdir_p(File.dirname(path)) @@ -33,21 +39,24 @@ def self.put(relpath, contents) tmpfile.close # Note: rename is an all-or-nothing opeartion IF the source and dest are on the same filesystem # (which we try to ensure here). Even so, a concurrent operation may breifly see a missing file. - File.rename(tmpfile.path, path) + File.rename(T.must(tmpfile.path), path) rescue StandardError tmpfile.delete end end + sig { params(relpath: T.any(String, Pathname)).returns(Time) } def self.mtime(relpath) File.mtime(abspath(relpath)) end + sig { params(relpath: T.any(String, Pathname)).returns(String) } def self.abspath(relpath) "#{root}/#{relpath}" end private + sig { returns(String) } def self.tmpdir "#{root}/tmp" end diff --git a/app/models/guest.rb b/app/models/guest.rb index 5468fe50f..d92d1c378 100644 --- a/app/models/guest.rb +++ b/app/models/guest.rb @@ -1,21 +1,26 @@ +# typed: strict # frozen_string_literal: true # A transient object representing a non-logged-in user (null object pattern). # # The guest is never explicitly saved in the database. class Guest < User + extend T::Sig before_save :reject_save + sig { params(args: T.untyped).void } def initialize(*args) - super(*args) + super self.login = 'guest' end + sig { returns(T::Boolean) } def guest? true end private + sig { returns(T.noreturn) } def reject_save raise 'The guest user cannot be saved!' end diff --git a/app/models/kafka_batch_update_points.rb b/app/models/kafka_batch_update_points.rb index 09178b3d0..5298ed700 100644 --- a/app/models/kafka_batch_update_points.rb +++ b/app/models/kafka_batch_update_points.rb @@ -1,6 +1,8 @@ +# typed: strict # frozen_string_literal: true class KafkaBatchUpdatePoints < ApplicationRecord + extend T::Sig belongs_to :course # Re-enqueue user progress and points updates for a given (course, user) pair. @@ -11,6 +13,8 @@ class KafkaBatchUpdatePoints < ApplicationRecord # Returns: # { status: :ok, course_id:, user_id:, progress_enqueued:, user_points_enqueued: } # or { status: :skip_, course_id:, user_id: } + # interval is checked in the body so console callers get a readable error. + sig { params(course_id: Integer, user_id: Integer, interval: T.untyped).returns(T::Hash[Symbol, T.untyped]) } def self.send_points_again_for_user_and_course(course_id, user_id, interval: nil) if interval && !interval.is_a?(ActiveSupport::Duration) raise ArgumentError, 'Invalid interval: expected an ActiveSupport::Duration (e.g. 1.week, 3.days)' @@ -43,6 +47,7 @@ def self.send_points_again_for_user_and_course(course_id, user_id, interval: nil # # Accepts optional `interval` (ActiveSupport::Duration) to restrict submissions. # Returns aggregate counts by status and total enqueued items. + sig { params(user_id: Integer, interval: T.untyped).returns(T::Hash[Symbol, Integer]) } def self.send_points_again_for_user_and_all_courses(user_id, interval: nil) if interval && !interval.is_a?(ActiveSupport::Duration) raise ArgumentError, 'Invalid interval: expected an ActiveSupport::Duration (e.g. 1.week, 3.days)' @@ -75,6 +80,7 @@ def self.send_points_again_for_user_and_all_courses(user_id, interval: nil) # then prints overall totals at the end. # Wraps the whole operation in one transaction; if it aborts, prints a clear message. # Returns overall totals hash. + sig { params(duration: T.untyped, batch_size: Integer).returns(T::Hash[Symbol, Integer]) } def self.resend_points_for_recent_submissions(duration, batch_size: 1000) unless duration.is_a?(ActiveSupport::Duration) raise ArgumentError, 'Invalid argument: expected an ActiveSupport::Duration (e.g. 1.week, 3.days)' diff --git a/app/models/migrated_submissions.rb b/app/models/migrated_submissions.rb index a0f1afbc0..167118e85 100644 --- a/app/models/migrated_submissions.rb +++ b/app/models/migrated_submissions.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true class MigratedSubmissions < ApplicationRecord diff --git a/app/models/model_solution_access_log.rb b/app/models/model_solution_access_log.rb index f06a018e1..6426b0925 100644 --- a/app/models/model_solution_access_log.rb +++ b/app/models/model_solution_access_log.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true class ModelSolutionAccessLog < ApplicationRecord diff --git a/app/models/model_solution_token_used.rb b/app/models/model_solution_token_used.rb index 7a4d64f83..003e762ae 100644 --- a/app/models/model_solution_token_used.rb +++ b/app/models/model_solution_token_used.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true class ModelSolutionTokenUsed < ApplicationRecord diff --git a/app/models/orderable.rb b/app/models/orderable.rb index 77d1ccdcc..4f9d9d9c2 100644 --- a/app/models/orderable.rb +++ b/app/models/orderable.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true # Provides operations for active records with a position field. @@ -5,7 +6,11 @@ # Currently this is only used by FeedbackQuestion, and should probably # go away if FeedbackQuestion is ever changed to use a config file. module Orderable + extend T::Sig extend ActiveSupport::Concern + extend T::Helpers + requires_ancestor { FeedbackQuestion } + included do validates :position, uniqueness: true before_create :set_default_position @@ -13,6 +18,7 @@ module Orderable include Comparable + sig { params(other: T.untyped).returns(T.nilable(Integer)) } def <=>(other) position <=> other.position end @@ -21,27 +27,32 @@ def <=>(other) # - they operate on the database immediately # - any records that are not self and other may have a stale position afterwards + sig { void } def move_forward! - other = self.class.where("position > #{quote(position)}").order('position ASC').first + other = record_class.where("position > #{quote(position)}").order('position ASC').first move_after!(other) if other end + sig { void } def move_backward! - other = self.class.where("position < #{quote(position)}").order('position DESC').first + other = record_class.where("position < #{quote(position)}").order('position DESC').first move_before!(other) if other end + sig { params(other: FeedbackQuestion).void } def move_before!(other) move!(other, '<=', -1) end + sig { params(other: FeedbackQuestion).void } def move_after!(other) move!(other, '>=', 1) end private + sig { params(other: FeedbackQuestion, op: String, delta: Integer).void } def move!(other, op, delta) - tbl = self.class.quoted_table_name + tbl = record_class.quoted_table_name conn = ActiveRecord::Base.connection conn.transaction(requires_new: true) do conn.execute("LOCK #{tbl} IN ACCESS EXCLUSIVE MODE") @@ -59,9 +70,10 @@ def move!(other, op, delta) end end + sig { void } def set_default_position if position.nil? - tbl = self.class.quoted_table_name + tbl = record_class.quoted_table_name conn = ActiveRecord::Base.connection conn.execute("LOCK #{tbl} IN ACCESS EXCLUSIVE MODE") # applies to the rest of this transaction max = conn.select_value("SELECT MAX(position) FROM #{tbl}").to_i @@ -69,7 +81,13 @@ def set_default_position end end + sig { params(value: T.untyped).returns(String) } def quote(value) - self.class.connection.quote(value) + record_class.connection.quote(value) + end + + sig { returns(T.class_of(FeedbackQuestion)) } + def record_class + T.cast(self.class, T.class_of(FeedbackQuestion)) end end diff --git a/app/models/organization.rb b/app/models/organization.rb index d37419a1d..9e60ea81d 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -1,8 +1,10 @@ +# typed: strict # frozen_string_literal: true # Organisations (schools etc.) have teachers and their own customized courses. class Organization < ApplicationRecord + extend T::Sig include Swagger::Blocks swagger_schema :Organization do @@ -52,6 +54,7 @@ class Organization < ApplicationRecord scope :participated_organizations, ->(user) { joins(:courses, courses: :awarded_points).where(awarded_points: { user_id: user.id }) } scope :visible_organizations, -> { accepted_organizations.where(hidden: false) } + sig { params(params: T.any(ActionController::Parameters, T::Hash[Symbol, T.untyped]), initial_user: User).returns(Organization) } def self.init(params, initial_user) organization = Organization.new(params.merge(verified: false, creator: initial_user)) teachership = Teachership.new(user: initial_user, organization: organization) @@ -62,39 +65,48 @@ def self.init(params, initial_user) organization end + sig { returns(T::Hash[Symbol, T.untyped]) } def org_as_json { name: name, information: information, slug: slug, logo_path: logo_path, pinned: pinned } end + sig { params(user: T.nilable(User)).returns(T::Boolean) } def teacher?(user) teachers.include? user end + sig { params(user: T.nilable(User)).returns(T::Boolean) } def member?(user) members.include?(user) end + sig { returns(T.nilable(String)) } def to_param slug end + sig { params(slug: String).returns(ActiveRecord::Relation) } def find_by_slug(slug) Organization.where(slug: slug) end + sig { params(request: ActionDispatch::Request, user: User).returns(T::Boolean) } def visibility_allowed?(request, user) return true if user.administrator? + whitelisted_ips = self.whitelisted_ips return true unless whitelisted_ips whitelisted_ips.include?(request.remote_ip) end + sig { void } def valid_slug? # slug must not be an existing route (/org/new etc) errors.add(:slug, 'is a system reserved word') if %w[new list_requests].include? slug end + sig { returns(String) } def logo_path if self.logo.attached? - Rails.application.routes.url_helpers.rails_representation_url(self.logo.variant(resize_to_fill: [100, nil]).processed, only_path: true) + Rails.application.routes.url_helpers.rails_representation_url(T.unsafe(self.logo).variant(resize_to_fill: [100, nil]).processed, only_path: true) else 'missing.png' end @@ -103,9 +115,10 @@ def logo_path 'missing.png' end + sig { returns(T.any(ActiveStorage::VariantWithRecord, ActiveStorage::Variant, String)) } def org_logo if self.logo.attached? - self.logo.variant(resize_to_fill: [100, nil]) + T.unsafe(self.logo).variant(resize_to_fill: [100, nil]) else 'missing.png' end diff --git a/app/models/organization_membership.rb b/app/models/organization_membership.rb index 8d6ca9741..e125380c1 100644 --- a/app/models/organization_membership.rb +++ b/app/models/organization_membership.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true class OrganizationMembership < ApplicationRecord diff --git a/app/models/recently_changed_user_detail.rb b/app/models/recently_changed_user_detail.rb index 64af6c4bc..4ff06454d 100644 --- a/app/models/recently_changed_user_detail.rb +++ b/app/models/recently_changed_user_detail.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true class RecentlyChangedUserDetail < ApplicationRecord diff --git a/app/models/remote_sandbox.rb b/app/models/remote_sandbox.rb index e19bd2cc3..493157156 100644 --- a/app/models/remote_sandbox.rb +++ b/app/models/remote_sandbox.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'rest-client' @@ -11,11 +12,17 @@ # # These are transient objects read from the configuration file. class RemoteSandbox + extend T::Sig + sig { returns(String) } attr_reader :baseurl + # object is the sandbox's JSON error payload. class InternalSandboxError < StandardError + extend T::Sig + sig { returns(T.untyped) } attr_reader :object + sig { params(object: T.untyped).void } def initialize(object) @object = object end @@ -23,12 +30,16 @@ def initialize(object) class SandboxUnavailableError < StandardError; end + sig { params(baseurl: String, experimental: T::Boolean).void } def initialize(baseurl, experimental = true) @baseurl = baseurl @baseurl = @baseurl.gsub(/\/+$/, '') @experimental = experimental + @capacity = T.let(nil, T.nilable(Integer)) + @parsed = T.let(nil, T.untyped) end + sig { params(submission: Submission, notify_url: String).returns(T::Boolean) } def self.try_to_send_submission_to_free_server(submission, notify_url) # dir = ExerciseDir.get(submission.exercise.clone_path) # servers = if submission.exercise && dir.safe_for_experimental_sandbox @@ -57,6 +68,7 @@ def self.try_to_send_submission_to_free_server(submission, notify_url) false end + sig { params(submission: Submission, notify_url: String).void } def send_submission(submission, notify_url) exercise = submission.exercise @@ -70,7 +82,7 @@ def send_submission(submission, notify_url) begin Timeout.timeout(SUBMISSION_PACKAGING_TIMEOUT_SECONDS) do - RustLangsCliExecutor.prepare_submission(submission.exercise.clone_path, tar_path, zip_path, {}, no_archive_prefix: true) + RustLangsCliExecutor.prepare_submission(exercise.clone_path, tar_path, zip_path, {}, no_archive_prefix: true) end rescue Timeout::Error Rails.logger.error("RustLangsCliExecutor.prepare_submission timed out after #{SUBMISSION_PACKAGING_TIMEOUT_SECONDS} seconds for submission #{submission.id}") @@ -85,9 +97,9 @@ def send_submission(submission, notify_url) # While Timeout::timeout is considered dangerous, this is still necessary because if this happens to block it will bring the whole server down. Timeout.timeout(10) do # The timeout is only for open_timeout and read_timeout - payload = { + payload = T.let({ file: tar_file, notify: notify_url, token: submission.secret_token, submission_id: submission.id - } + }, T::Hash[Symbol, T.untyped]) payload[:docker_image] = exercise.docker_image if exercise.docker_image payload[:memory_limit_gb] = exercise.memory_limit_gb if exercise.memory_limit_gb payload[:cpu_limit] = exercise.cpu_limit if exercise.cpu_limit @@ -100,6 +112,7 @@ def send_submission(submission, notify_url) puts e begin # Try to parse the response to see if the error originated from within the sandbox. + raise SandboxUnavailableError unless e.is_a?(RestClient::Exception) @parsed = JSON.parse e.response rescue StandardError raise SandboxUnavailableError @@ -126,42 +139,58 @@ def send_submission(submission, notify_url) end end + sig { returns(T::Array[RemoteSandbox]) } def self.all - @all ||= SiteSetting.value('remote_sandboxes').map { |url| RemoteSandbox.new(url) } + @all ||= T.let(SiteSetting.value('remote_sandboxes').map { |url| RemoteSandbox.new(url) }, T.nilable(T::Array[RemoteSandbox])) end + sig { returns(T::Array[RemoteSandbox]) } def self.all_experimental - @all_experimental ||= SiteSetting.value('experimental_sandboxes').map { |url| RemoteSandbox.new(url, true) } + @all_experimental ||= T.let(SiteSetting.value('experimental_sandboxes').map { |url| RemoteSandbox.new(url, true) }, T.nilable(T::Array[RemoteSandbox])) end + sig { returns(Integer) } def self.total_capacity all.map(&:capacity).reduce(0, &:+) end + sig { returns(Integer) } def capacity @capacity ||= begin - get_status['total_instances'] + status_count('total_instances') rescue StandardError nil end @capacity || 0 end + # nil when the status lacks an integer count; 0 when the sandbox is unreachable. + sig { returns(T.nilable(Integer)) } def busy_instances - get_status['busy_instances'] + status_count('busy_instances') rescue StandardError 0 end private + # Polled every second, so a malformed status yields nil instead of a logged type error. + sig { params(key: String).returns(T.nilable(Integer)) } + def status_count(key) + count = get_status[key] + count if count.is_a?(Integer) + end + + sig { returns(T.untyped) } def get_status ActiveSupport::JSON.decode(RestClient.get(status_url)) end + sig { returns(String) } def post_url "#{@baseurl}/tasks.json" end + sig { returns(String) } def status_url "#{@baseurl}/status.json" end diff --git a/app/models/reply_to_feedback_answer.rb b/app/models/reply_to_feedback_answer.rb index c01ae7deb..39c5a19e7 100644 --- a/app/models/reply_to_feedback_answer.rb +++ b/app/models/reply_to_feedback_answer.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true class ReplyToFeedbackAnswer < ApplicationRecord diff --git a/app/models/review.rb b/app/models/review.rb index 47eb31dda..cf3129db9 100644 --- a/app/models/review.rb +++ b/app/models/review.rb @@ -1,8 +1,10 @@ +# typed: strict # frozen_string_literal: true require 'natsort' class Review < ApplicationRecord + extend T::Sig include Swagger::Blocks swagger_schema :Review do @@ -31,12 +33,13 @@ class Review < ApplicationRecord property :updated_at, type: :string, example: '2016-10-10T13:22:19.554+03:00' end + sig { params(course: Course, reviewed_submissions: ActiveRecord::Relation, view_context: ActionView::Base).returns(T::Array[T::Hash[Symbol, T.untyped]]) } def self.course_reviews_json(course, reviewed_submissions, view_context) reviewed_submissions = reviewed_submissions.includes(reviews: %i[reviewer submission]) exercises = course.exercises.index_by { |e| e.name } reviewed_submissions.map do |s| s.reviews.map do |r| - available_points = exercises[r.submission.exercise_name].available_points.where(requires_review: true).map(&:name) + available_points = T.must(exercises[r.submission.exercise_name]).available_points.where(requires_review: true).map(&:name) points_not_awarded = available_points - r.points_list { submission_id: s.id, @@ -60,18 +63,21 @@ def self.course_reviews_json(course, reviewed_submissions, view_context) belongs_to :submission belongs_to :reviewer, class_name: 'User', inverse_of: :reviews + sig { returns(T::Array[String]) } def points_list points.to_s.split end + sig { params(user: User).returns(T::Boolean) } def readable_by?(user) user.administrator? || - user.id == submission.user.id || - user.teacher?(submission.course.organization) + user.id == T.must(T.must(submission).user).id || + user.teacher?(T.must(T.must(submission).course).organization) end + sig { params(user: User).returns(T::Boolean) } def manageable_by?(user) user.administrator? || - user.teacher?(submission.course.organization) + user.teacher?(T.must(T.must(submission).course).organization) end end diff --git a/app/models/session.rb b/app/models/session.rb index 43bfa05b2..9cdaef643 100644 --- a/app/models/session.rb +++ b/app/models/session.rb @@ -1,11 +1,15 @@ +# typed: strict # frozen_string_literal: true class Session < ActiveRecord::SessionStore::Session + extend T::Sig + sig { returns(Integer) } def self.delete_expired - delete_all(['updated_at < ?', 1.month.ago]) + where('updated_at < ?', 1.month.ago).delete_all end + sig { params(user: User).returns(T::Boolean) } def belongs_to?(user) - data['user_id'] == user.id + T.unsafe(data)['user_id'] == user.id end end diff --git a/app/models/site_setting.rb b/app/models/site_setting.rb index ad9d4f868..3a2bd4ea5 100644 --- a/app/models/site_setting.rb +++ b/app/models/site_setting.rb @@ -1,24 +1,33 @@ +# typed: strict # frozen_string_literal: true # Represents the contents of `config/site.yml`. class SiteSetting + extend T::Sig + @settings = T.let(nil, T.nilable(T::Hash[String, T.untyped])) + + # Values come from YAML. + sig { params(key: T.any(String, Symbol)).returns(T.untyped) } def self.value(key) key = key.to_s raise "No such setting: #{key}" unless all_settings.key?(key) all_settings[key] end + sig { returns(T::Hash[String, T.untyped]) } def self.all_settings @settings ||= settings_from_files(settings_files) end + sig { void } def self.use_distribution_defaults! # for tests @settings = settings_from_files(settings_files.select { |f| f.end_with?('site.defaults.yml') }) end private + sig { params(files: T::Array[String]).returns(T::Hash[String, T.untyped]) } def self.settings_from_files(files) - result = {} + result = T.let({}, T::Hash[String, T.untyped]) files.each do |path| next unless File.exist?(path) template = ERB.new File.new(path).read @@ -29,6 +38,7 @@ def self.settings_from_files(files) result end + sig { returns(T::Array[String]) } def self.settings_files config_dir = "#{Rails.root}/config" ["#{config_dir}/site.defaults.yml", "#{config_dir}/site.yml"] diff --git a/app/models/solution.rb b/app/models/solution.rb index 002dbef3d..95c22c135 100644 --- a/app/models/solution.rb +++ b/app/models/solution.rb @@ -1,50 +1,64 @@ +# typed: strict # frozen_string_literal: true require 'find' # Represents a solution (files prepared by CourseRefresher). class Solution + extend T::Sig + + sig { params(exercise: Exercise).void } def initialize(exercise) @exercise = exercise end + sig { returns(Exercise) } attr_reader :exercise + sig { returns(String) } def path @exercise.solution_path end + sig { params(user: User, ignore_email_verification: T::Boolean).returns(T.nilable(T::Boolean)) } def visible_to?(user, ignore_email_verification = false) if user.administrator? true elsif !ignore_email_verification && !user.email_verified? false - elsif !@exercise.course.organization.verified + elsif !T.must(course.organization).verified false - elsif user.teacher?(@exercise.course.organization) || user.assistant?(@exercise.course) + elsif user.teacher?(course.organization) || user.assistant?(course) true elsif user.guest? false - elsif @exercise.course.hide_submission_results? || @exercise.hide_submission_results? + elsif course.hide_submission_results? || @exercise.hide_submission_results? false - elsif @exercise.course.model_solution_visible_before_completion? && @exercise.course.enabled? + elsif course.model_solution_visible_before_completion? && course.enabled? true elsif @exercise.completed_by?(user) true - elsif !@exercise.course.visible_to?(user) + elsif !course.visible_to?(user) false elsif !@exercise.visible_to?(user) false else show_when_completed = SiteSetting.value('show_model_solutions_when_exercise_completed') show_when_expired = SiteSetting.value('show_model_solutions_when_exercise_expired') - (!@exercise.solution_visible_after.nil? && @exercise.solution_visible_after < Time.now) || + visible_after = @exercise.solution_visible_after + (!visible_after.nil? && visible_after < Time.now) || (show_when_completed && @exercise.completed_by?(user)) || (show_when_expired && @exercise.expired_for?(user)) end end + sig { returns(SourceFileList) } def files - @files ||= SourceFileList.for_solution(self) + @files ||= T.let(SourceFileList.for_solution(self), T.nilable(SourceFileList)) end + private + sig { returns(Course) } + def course + T.must(@exercise.course) + end end diff --git a/app/models/source_file_list.rb b/app/models/source_file_list.rb index 0d5900bef..24b148476 100644 --- a/app/models/source_file_list.rb +++ b/app/models/source_file_list.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'find' @@ -9,29 +10,42 @@ # Represents a list of source code files for the web UI to display. class SourceFileList + extend T::Sig + extend T::Generic include Enumerable - MAX_SIZE = 3.megabytes - MAX_INDIVIDUAL_FILE_SIZE = 300.kilobytes + MAX_SIZE = T.let(3.megabytes, Integer) + MAX_INDIVIDUAL_FILE_SIZE = T.let(300.kilobytes, Integer) class FileRecord + extend T::Sig + sig { params(path: String, contents: String).void } def initialize(path, contents) @path = path @contents = contents - @html_prelude = nil + @html_prelude = T.let(nil, T.nilable(String)) end - attr_accessor :path, :contents, :html_prelude + sig { returns(String) } + attr_accessor :path, :contents + sig { returns(T.nilable(String)) } + attr_accessor :html_prelude end + sig { params(files: T::Array[FileRecord]).void } def initialize(files) @files = files end + Elem = type_member { { fixed: FileRecord } } + + sig { override.params(block: T.nilable(T.proc.params(file: FileRecord).void)).returns(T.any(T::Array[FileRecord], T::Enumerator[FileRecord])) } def each(&block) + return @files.each unless block @files.each(&block) end + sig { params(submission: Submission).returns(T.attached_class) } def self.for_submission(submission) Dir.mktmpdir do |tmpdir| zip_path = "#{tmpdir}/submission.zip" @@ -41,17 +55,14 @@ def self.for_submission(submission) project_dir = TmcDirUtils.find_dir_containing(tmpdir, 'src') return new([]) if project_dir.nil? - files = if project_dir == tmpdir - find_all_files_under(project_dir) - else - find_source_files_under(project_dir) - end + files = find_source_files_under(project_dir) - return new([]) unless submission.exercise + exercise = submission.exercise + return new([]) unless exercise - project_file = TmcProjectFile.for_project(submission.exercise.clone_path) + project_file = TmcProjectFile.for_project(exercise.clone_path) - project_file&.extra_student_files&.each do |f| + project_file.extra_student_files.each do |f| file = Pathname.new(File.join(project_dir, f)) if source_file?(file) && file.size <= MAX_INDIVIDUAL_FILE_SIZE files << FileRecord.new(file.to_s, file.read) @@ -64,9 +75,10 @@ def self.for_submission(submission) end end + sig { params(solution: Solution).returns(T.attached_class) } def self.for_solution(solution) project_file = TmcProjectFile.for_project(solution.exercise.clone_path) - files = if project_file&.show_all_files_in_solution + files = if project_file.show_all_files_in_solution find_all_files_under(solution.path) else find_source_files_under(solution.path) @@ -84,8 +96,9 @@ def self.for_solution(solution) end private + sig { params(root_dir: T.any(String, Pathname)).returns(T::Array[FileRecord]) } def self.find_source_files_under(root_dir) - files = [] + files = T.let([], T::Array[FileRecord]) total_size = 0 Pathname(root_dir).realpath.find do |file| Find.prune if file.directory? && should_skip_dir?(file) @@ -100,8 +113,9 @@ def self.find_source_files_under(root_dir) files.sort_by(&:path) end + sig { params(root_dir: T.any(String, Pathname)).returns(T::Array[FileRecord]) } def self.find_all_files_under(root_dir) - files = [] + files = T.let([], T::Array[FileRecord]) total_size = 0 Pathname(root_dir).realpath.find do |file| next unless file.size <= MAX_INDIVIDUAL_FILE_SIZE @@ -115,6 +129,7 @@ def self.find_all_files_under(root_dir) files.sort_by(&:path) end + sig { params(file: Pathname).returns(T::Boolean) } def self.source_file?(file) return false unless file.file? dir = file.parent.to_s @@ -140,18 +155,21 @@ def self.source_file?(file) name.end_with?('.cs') end + sig { params(file: Pathname).returns(T::Boolean) } def self.should_skip_dir?(file) name = file.basename.to_s name.start_with?('.') || name == 'test' || name == 'lib' || name == 'nbproject' || name == 'bower_components' || name == 'test_runner' end + sig { params(root_dir: T.any(String, Pathname), files: T::Array[FileRecord]).void } def self.make_path_names_relative(root_dir, files) root_dir = root_dir.to_s for file in files - file.path = file.path[(root_dir.size + 1)...file.path.length] if file.path.start_with?(root_dir) + file.path = T.must(file.path[(root_dir.size + 1)...file.path.length]) if file.path.start_with?(root_dir) end end + sig { params(files: T::Array[FileRecord]).returns(T::Array[FileRecord]) } def self.sort_source_files(files) files.sort_by do |f| priority = if f.path.include?('WEB-INF/') then 1 diff --git a/app/models/stats.rb b/app/models/stats.rb index 0aa37bdff..f73451aef 100644 --- a/app/models/stats.rb +++ b/app/models/stats.rb @@ -1,7 +1,10 @@ +# typed: strict # frozen_string_literal: true # Helpers for serving /stats. module Stats + extend T::Sig + sig { params(organization: T.nilable(Organization)).returns(T::Hash[Symbol, T.untyped]) } def self.courses(organization = nil) courses = Course.all courses = courses.where(organization: organization) unless organization.nil? @@ -11,6 +14,7 @@ def self.courses(organization = nil) } end + sig { params(course: Course).returns(T::Hash[Symbol, T.untyped]) } def self.for_course(course) keys = %i[ participants_with_submissions_count @@ -21,8 +25,9 @@ def self.for_course(course) keys.reduce({}) { |h, k| h.merge(k => send(k, course)) } end + sig { params(course: Course).returns(T::Hash[String, T::Hash[Symbol, Integer]]) } def self.exercise_group_stats(course) - result = {} + result = T.let({}, T::Hash[String, T::Hash[Symbol, Integer]]) for group_name, exercises in exercise_groups(course) result[group_name] = { participants_with_submissions_count: participants_with_submissions_count(exercises), @@ -33,15 +38,16 @@ def self.exercise_group_stats(course) result end + sig { params(course: Course).returns(T::Hash[String, T::Array[Exercise]]) } def self.exercise_groups(course) - groups = {} + groups = T.let({}, T::Hash[String, T::Array[Exercise]]) for exercise in course.exercises.where(hidden: false) - groups[exercise.exercise_group_name] ||= [] - groups[exercise.exercise_group_name] << exercise + (groups[exercise.exercise_group_name] ||= []) << exercise end groups end + sig { params(exercise_or_course: T.nilable(T.any(Course, T.any(ActiveRecord::Relation, T::Array[Exercise])))).returns(Integer) } def self.participants_with_submissions_count(exercise_or_course = nil) exercises = get_exercises(exercise_or_course) if exercises.present? @@ -53,25 +59,30 @@ def self.participants_with_submissions_count(exercise_or_course = nil) end end + sig { params(exercise_or_course: T.nilable(T.any(Course, T.any(ActiveRecord::Relation, T::Array[Exercise])))).returns(Integer) } def self.completed_exercise_count(exercise_or_course = nil) exercises = get_exercises(exercise_or_course) Exercise.count_completed(all_regular_users, exercises) end + sig { params(exercise_or_course: T.nilable(T.any(Course, T.any(ActiveRecord::Relation, T::Array[Exercise])))).returns(Integer) } def self.possible_completed_exercise_count(exercise_or_course = nil) exercises = get_exercises(exercise_or_course) participants_with_submissions_count(exercises) * exercises.size end private + sig { returns(ActiveRecord::Relation) } def self.all_regular_users User.where(administrator: false) end + sig { returns(ActiveRecord::Relation) } def self.all_nonhidden_exercises Exercise.where(hidden: false) end + sig { params(exercise_or_course: T.nilable(T.any(Course, T.any(ActiveRecord::Relation, T::Array[Exercise])))).returns(T.any(ActiveRecord::Relation, T::Array[Exercise])) } def self.get_exercises(exercise_or_course = nil) if exercise_or_course.nil? all_nonhidden_exercises diff --git a/app/models/submission.rb b/app/models/submission.rb index 734aa7c89..eb7b796ed 100644 --- a/app/models/submission.rb +++ b/app/models/submission.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'zlib' @@ -5,6 +6,7 @@ require 'submission_packager' class Submission < ApplicationRecord + extend T::Sig include Swagger::Blocks swagger_schema :Submission do @@ -77,8 +79,11 @@ class Submission < ApplicationRecord has_many :test_case_runs, -> { order(:id) }, dependent: :delete_all has_many :reviews, -> { order(:created_at) }, dependent: :delete_all do + extend T::Sig + + sig { returns(T.nilable(Review)) } def latest - order('created_at DESC').limit(1).first + T.unsafe(self).order('created_at DESC').limit(1).first end end has_many :awarded_points, dependent: :nullify @@ -93,30 +98,37 @@ def latest after_save :kafka_update_progress after_destroy :kafka_update_progress + sig { returns(T.nilable(Integer)) } def processing_time - if processing_completed_at.nil? || processing_completed_at.nil? + completed_at = processing_completed_at + started_at = processing_attempts_started_at + if completed_at.nil? || started_at.nil? nil else - (processing_completed_at - processing_attempts_started_at).round + (completed_at - started_at).round end end + sig { returns(ActiveRecord::Relation) } def self.to_be_reprocessed unprocessed .where('processing_tried_at IS NULL OR processing_tried_at < ?', Time.now - processing_retry_interval) .where('processing_began_at IS NULL OR processing_began_at < ?', Time.now - processing_resend_interval) end + sig { returns(ActiveRecord::Relation) } def self.unprocessed where(processed: false) .order('processing_priority DESC, processing_tried_at ASC, id ASC') end + sig { returns(Integer) } def self.unprocessed_count unprocessed.count end # Count how many submissions a user has processing for a specific exercise + sig { params(user_id: T.nilable(Integer), exercise_name: String, course_id: Integer).returns(Integer) } def self.processing_count_for_user_and_exercise(user_id, exercise_name, course_id) where( user_id: user_id, @@ -127,24 +139,29 @@ def self.processing_count_for_user_and_exercise(user_id, exercise_name, course_i end # How many times at most should a submission be (successfully) sent to a sandbox + sig { returns(Integer) } def self.max_attempts_at_processing 3 end before_create :randomize_secret_token + sig { returns(T::Boolean) } def tests_ran? processed? && pretest_error.nil? end + sig { returns(String) } def result_url "#{SiteSetting.value(:baseurl_for_remote_sandboxes).sub(/\/+$/, '')}/submissions/#{id}/result" end + sig { returns(T.nilable(T::Hash[String, T.untyped])) } def params ActiveSupport::JSON.decode(params_json) if params_json end + sig { params(value: T.untyped).void } def params=(value) if value.is_a?(Hash) value.each { |k, v| raise "Invalid submission param: #{k} = #{v}" unless valid_param?(k, v) } @@ -156,6 +173,7 @@ def params=(value) end end + sig { params(k: T.untyped, v: T.untyped).returns(T.nilable(Integer)) } def valid_param?(k, v) # See also: SubmissionPackager.write_extra_params k = k.to_s @@ -163,6 +181,7 @@ def valid_param?(k, v) k =~ /^[a-zA-Z\-_]+$/ && v =~ /^[a-zA-Z\-_]+$/ end + sig { params(user: User).returns(Symbol) } def status(user) if !processed? :processing @@ -177,20 +196,23 @@ def status(user) end end + sig { params(user: User).returns(T::Boolean) } def can_see_results?(user) - results_hidden = ((!exercise.nil? && exercise.hide_submission_results?) || course.hide_submission_results?) + results_hidden = ((!exercise.nil? && T.must(exercise).hide_submission_results?) || T.must(course).hide_submission_results?) !results_hidden || - course.organization.teacher?(user) || - course.assistant?(user) || + T.must(T.must(course).organization).teacher?(user) || + T.must(course).assistant?(user) || user.administrator? end + sig { returns(T::Array[String]) } def points_list points.to_s.split(' ') end # Returns a query for all submissions (including this one) by the same user # for the same course and exercise + sig { returns(ActiveRecord::Relation) } def of_same_kind Submission.where( course_id: course_id, @@ -201,16 +223,19 @@ def of_same_kind # Returns the newest submission by the same user for the same exercise, # as long as it's newer than this submission + sig { returns(T.nilable(Submission)) } def newest_of_same_kind of_same_kind.where(['created_at > ?', created_at]).order('created_at DESC').first end + sig { returns(T::Boolean) } def review_dismissable? (requires_review? || requests_review?) && !review_dismissed? && !newer_submission_reviewed? end + sig { returns(Integer) } def unprocessed_submissions_before_this if !processed? i = 0 @@ -224,10 +249,12 @@ def unprocessed_submissions_before_this end end + sig { returns(String) } def downloadable_file_name "#{exercise_name}-#{id}.zip" end + sig { returns(T::Array[T::Hash[Symbol, T.untyped]]) } def test_case_records test_case_runs.map do |tcr| { @@ -242,61 +269,75 @@ def test_case_records delegate :return_file, to: :submission_data + sig { params(value: T.nilable(String)).void } def return_file=(value) build_submission_data unless submission_data - submission_data.return_file = value + T.must(submission_data).return_file = value end + sig { returns(T.nilable(String)) } def stdout build_submission_data unless submission_data - submission_data.stdout + T.must(submission_data).stdout end + sig { params(value: T.nilable(String)).void } def stdout=(value) build_submission_data unless submission_data - submission_data.stdout = value + T.must(submission_data).stdout = value end + sig { returns(T.nilable(String)) } def stderr build_submission_data unless submission_data - submission_data.stderr + T.must(submission_data).stderr end + sig { params(value: T.nilable(String)).void } def stderr=(value) build_submission_data unless submission_data - submission_data.stderr = value + T.must(submission_data).stderr = value end + sig { returns(T.nilable(String)) } def vm_log build_submission_data unless submission_data - submission_data.vm_log + T.must(submission_data).vm_log end + sig { params(value: T.nilable(String)).void } def vm_log=(value) build_submission_data unless submission_data - submission_data.vm_log = value + T.must(submission_data).vm_log = value end + sig { returns(T.nilable(String)) } def valgrind build_submission_data unless submission_data - submission_data.valgrind + T.must(submission_data).valgrind end + sig { params(value: T.nilable(String)).void } def valgrind=(value) build_submission_data unless submission_data - submission_data.valgrind = value + T.must(submission_data).valgrind = value end + # Parsed from the sandbox's JSON. + sig { returns(T.untyped) } def validations build_submission_data unless submission_data - JSON.parse submission_data.validations if submission_data.validations.present? + data = T.must(submission_data).validations + JSON.parse data if data.present? end + sig { params(value: T.nilable(String)).void } def validations=(value) build_submission_data unless submission_data - submission_data.validations = value + T.must(submission_data).validations = value end + sig { void } def raise_pretest_error_if_any unless pretest_error.nil? error = "Submission failed: #{pretest_error}." @@ -314,11 +355,12 @@ def raise_pretest_error_if_any end end + sig { params(priority: Integer).returns(T::Boolean) } def set_to_be_reprocessed!(priority = -200) self.processed = false self.times_sent_to_sandbox = 0 self.processing_priority = priority - self.processing_attempts_started_at = Time.now + self.processing_attempts_started_at = Time.zone.now self.processing_tried_at = nil self.processing_began_at = nil self.processing_completed_at = nil @@ -330,21 +372,25 @@ def set_to_be_reprocessed!(priority = -200) # When a remote sandbox returns a result to the webapp, # it authenticates the result by passing back the secret token. # Changing it in the meantime will obsolete any runs currently being processed. + sig { void } def randomize_secret_token self.secret_token = rand(10**100).to_s end # How often we try to resend if no sandbox has received it yet + sig { returns(ActiveSupport::Duration) } def self.processing_retry_interval 7.seconds end # How often we try to resend after a sandbox has received but not responded with a result + sig { returns(ActiveSupport::Duration) } def self.processing_resend_interval 5.minutes end # A dirty workaround. See http://stackoverflow.com/questions/10666808/rails-eager-loading-a-belongs-to-with-conditions-refering-to-self + sig { params(submissions: T::Enumerable[Submission]).void } def self.eager_load_exercises(submissions) keys = submissions.map { |s| "(#{connection.quote(s.course_id)}, #{connection.quote(s.exercise_name)})" } keys.uniq! @@ -358,21 +404,25 @@ def self.eager_load_exercises(submissions) end end + sig { params(user: User).returns(T::Boolean) } def paste_visible_for?(user) return false unless paste_available - return true if exercise && exercise.completed_by?(user) - return true if user.submissions.where(exercise_name: exercise.name, pretest_error: nil, all_tests_passed: true).any? + return true if exercise&.completed_by?(user) + return true if user.submissions.where(exercise_name: T.must(exercise).name, pretest_error: nil, all_tests_passed: true).any? !all_tests_passed end + sig { params(user: User).returns(T::Boolean) } def readable_by?(user) - user.administrator? || user.teacher?(course.organization) || user.assistant?(course) || user_id == user.id + user.administrator? || user.teacher?(T.must(course).organization) || user.assistant?(T.must(course)) || user_id == user.id end + sig { void } def set_paste_key_if_paste_available self.paste_key = SecureRandom.urlsafe_base64 if paste_available? end + sig { params(submissions: T::Array[T.untyped]).returns(T::Array[T::Hash[Symbol, T.untyped]]) } def self.filter_fields!(submissions) submissions.map! do |sub| { @@ -405,16 +455,18 @@ def self.filter_fields!(submissions) end private + sig { void } def set_processing_attempts_started_at - self.processing_attempts_started_at = Time.now + self.processing_attempts_started_at = Time.zone.now end + sig { void } def kafka_update_progress - return if (!self.course.moocfi_id || self.course.moocfi_id.blank?) || !self.processed - realtime = self.created_at > 1.hour.ago - first_submission = self.exercise.submissions_by(user).length == 1 - KafkaBatchUpdatePoints.create!(course_id: self.course_id, user_id: self.user_id, exercise_id: self.exercise.id, task_type: 'user_progress', realtime: realtime) - KafkaBatchUpdatePoints.create!(course_id: self.course_id, user_id: self.user_id, exercise_id: self.exercise.id, task_type: 'user_points', realtime: realtime) unless first_submission + return if (!T.must(self.course).moocfi_id || T.must(self.course).moocfi_id.blank?) || !self.processed + realtime = T.must(self.created_at) > 1.hour.ago + first_submission = T.must(self.exercise).submissions_by(T.must(user)).length == 1 + KafkaBatchUpdatePoints.create!(course_id: self.course_id, user_id: self.user_id, exercise_id: T.must(self.exercise).id, task_type: 'user_progress', realtime: realtime) + KafkaBatchUpdatePoints.create!(course_id: self.course_id, user_id: self.user_id, exercise_id: T.must(self.exercise).id, task_type: 'user_points', realtime: realtime) unless first_submission KafkaBatchUpdatePoints.create!(course_id: self.course_id, user_id: self.user_id, task_type: 'user_course_points', realtime: realtime) if first_submission end end diff --git a/app/models/submission_data.rb b/app/models/submission_data.rb index 5377e85da..6e10d9b99 100644 --- a/app/models/submission_data.rb +++ b/app/models/submission_data.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true # Stores large data such as the returned ZIP and compressed I/O logs for a submission. @@ -6,75 +7,88 @@ # loaded explicitly. If these fields were directly in Submission, a result set # (with default configuration) of Submission objects would easily consume quite a bit of memory. class SubmissionData < ApplicationRecord + extend T::Sig self.primary_key = 'submission_id' belongs_to :submission + sig { returns(T.nilable(String)) } def stdout - unless stdout_compressed.nil? - @stdout ||= - uncompress(stdout_compressed) + compressed = stdout_compressed + unless compressed.nil? + @stdout ||= T.let(uncompress(compressed), T.nilable(String)) end end + sig { params(value: T.nilable(String)).void } def stdout=(value) self.stdout_compressed = (compress(value) unless value.nil?) - @stdout = value + @stdout = T.let(value, T.nilable(String)) end + sig { returns(T.nilable(String)) } def stderr - unless stderr_compressed.nil? - @stderr ||= - uncompress(stderr_compressed) + compressed = stderr_compressed + unless compressed.nil? + @stderr ||= T.let(uncompress(compressed), T.nilable(String)) end end + sig { params(value: T.nilable(String)).void } def stderr=(value) self.stderr_compressed = (compress(value) unless value.nil?) - @stderr = value + @stderr = T.let(value, T.nilable(String)) end + sig { returns(T.nilable(String)) } def vm_log - unless vm_log_compressed.nil? - @vm_log ||= - uncompress(vm_log_compressed) + compressed = vm_log_compressed + unless compressed.nil? + @vm_log ||= T.let(uncompress(compressed), T.nilable(String)) end end + sig { params(value: T.nilable(String)).void } def vm_log=(value) self.vm_log_compressed = (compress(value) unless value.nil?) - @vm_log = value + @vm_log = T.let(value, T.nilable(String)) end + sig { returns(T.nilable(String)) } def valgrind - unless valgrind_compressed.nil? - @valgrind ||= - uncompress(valgrind_compressed) + compressed = valgrind_compressed + unless compressed.nil? + @valgrind ||= T.let(uncompress(compressed), T.nilable(String)) end end + sig { params(value: T.nilable(String)).void } def valgrind=(value) self.valgrind_compressed = (compress(value) unless value.nil?) - @valgrind = value + @valgrind = T.let(value, T.nilable(String)) end + sig { returns(T.nilable(String)) } def validations - unless validations_compressed.nil? - @validations ||= - uncompress(validations_compressed) + compressed = validations_compressed + unless compressed.nil? + @validations ||= T.let(uncompress(compressed), T.nilable(String)) end end + sig { params(value: T.nilable(String)).void } def validations=(value) self.validations_compressed = (compress(value) unless value.nil?) - @validations = value + @validations = T.let(value, T.nilable(String)) end private + sig { params(text: String).returns(String) } def compress(text) Zlib::Deflate.deflate(text) end + sig { params(compressed_text: String).returns(String) } def uncompress(compressed_text) Zlib::Inflate.inflate(compressed_text).force_encoding('UTF-8') end diff --git a/app/models/teachership.rb b/app/models/teachership.rb index de3bfd431..ce17b67c9 100644 --- a/app/models/teachership.rb +++ b/app/models/teachership.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true class Teachership < ApplicationRecord diff --git a/app/models/test_case_run.rb b/app/models/test_case_run.rb index 417511b42..22851e4b0 100644 --- a/app/models/test_case_run.rb +++ b/app/models/test_case_run.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true class TestCaseRun < ApplicationRecord diff --git a/app/models/tmc_project_file.rb b/app/models/tmc_project_file.rb index e12928568..49a8ca8d1 100644 --- a/app/models/tmc_project_file.rb +++ b/app/models/tmc_project_file.rb @@ -1,11 +1,17 @@ +# typed: strict # frozen_string_literal: true require 'pathname' # Represents a `.tmcproject.yml` file. class TmcProjectFile + extend T::Sig + # data is the parsed YAML, so it may be anything. + sig { params(data: T.untyped).void } def initialize(data) - @extra_student_files = [] + @extra_student_files = T.let([], T::Array[String]) + @show_all_files_in_solution = T.let(nil, T.untyped) + @data = T.let(nil, T.untyped) return unless data.is_a?(Hash) @extra_student_files = data['extra_student_files'] if data['extra_student_files'].is_a?(Array) @@ -14,9 +20,12 @@ def initialize(data) @data = data end + sig { returns(T::Array[String]) } attr_reader :extra_student_files + sig { returns(T.untyped) } attr_reader :show_all_files_in_solution + sig { params(project_dir: T.any(String, Pathname)).returns(TmcProjectFile) } def self.for_project(project_dir) file = Pathname(project_dir) + '.tmcproject.yml' TmcProjectFile.new(YAML.load_file(file)) @@ -25,10 +34,12 @@ def self.for_project(project_dir) end private + sig { returns(TmcProjectFile) } def self.empty TmcProjectFile.new({}) end + sig { void } def filter_extra_student_files! @extra_student_files.reject! { |path| path.include?('..') } end diff --git a/app/models/uncomputed_unlock.rb b/app/models/uncomputed_unlock.rb index 80fbc2fd6..c9aecab70 100644 --- a/app/models/uncomputed_unlock.rb +++ b/app/models/uncomputed_unlock.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'set' @@ -7,9 +8,11 @@ # consumes it by calling Unlock.refresh_unlocks on the entries. Code that needs # up-to-date unlocks should call UncomputedUnlock.resolve for the (course, user) first. class UncomputedUnlock < ApplicationRecord + extend T::Sig belongs_to :course belongs_to :user + sig { params(course: Course).void } def self.create_all_for_course(course) transaction do course_users = User.course_students(course).pluck(:id) @@ -26,6 +29,7 @@ def self.create_all_for_course(course) # Primarily used for demoing unlock date change through gui, this version of the method creates uncomputed unlocks # for every user, not requiring the user to have awarded points from the course. This method will most likely be # left unused in production build. + sig { params(course: Course).void } def self.create_all_for_course_eager(course) transaction do rows_to_insert = User.all.pluck(:id).map { |uid| { course_id: course.id, user_id: uid } } @@ -33,6 +37,7 @@ def self.create_all_for_course_eager(course) end end + sig { params(course: Course, user: User).void } def self.resolve(course, user) if find_by(course_id: course, user_id: user) Unlock.refresh_unlocks(course, user) diff --git a/app/models/unlock.rb b/app/models/unlock.rb index 68f5d5c78..db3fadb73 100644 --- a/app/models/unlock.rb +++ b/app/models/unlock.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true @@ -16,11 +17,13 @@ # starting the timer prematurely. # class Unlock < ApplicationRecord + extend T::Sig belongs_to :user belongs_to :course belongs_to :exercise, ->(unlock) { where(course: unlock.course) }, foreign_key: :exercise_name, primary_key: :name # the DB validates uniqueness for (user_id, course_id, :exercise_name) + sig { params(course: Course, user: User).void } def self.refresh_unlocks(course, user) time = Time.zone.now Unlock.transaction do @@ -31,6 +34,7 @@ def self.refresh_unlocks(course, user) end end + sig { params(exercises: T::Enumerable[Exercise], user: User).void } def self.unlock_exercises(exercises, user) Unlock.transaction do for ex in exercises @@ -46,6 +50,7 @@ def self.unlock_exercises(exercises, user) end private + sig { params(course: Course, user: User, user_unlocks_by_exercise_name: T::Hash[T.nilable(String), Unlock]).void } def self.refresh_unlocks_impl(course, user, user_unlocks_by_exercise_name) course.exercises.enabled.each do |exercise| existing = user_unlocks_by_exercise_name[exercise.name] @@ -59,19 +64,21 @@ def self.refresh_unlocks_impl(course, user, user_unlocks_by_exercise_name) valid_after: exercise.unlock_spec_obj.valid_after ) elsif exists && !may_exist - user_unlocks_by_exercise_name[exercise.name].destroy + existing.destroy elsif exists && may_exist && exercise.unlock_spec_obj.valid_after != existing.valid_after - existing.valid_after = exercise.unlock_spec_obj.valid_after + # Active Record casts any Time to TimeWithZone; Tapioca types the writer as TimeWithZone only. + existing.valid_after = T.unsafe(exercise.unlock_spec_obj.valid_after) existing.save! end end end + sig { params(course: Course, user: User, user_unlocks_by_exercise_name: T::Hash[T.nilable(String), Unlock]).void } def self.fast_refresh_unlocks_impl(course, user, user_unlocks_by_exercise_name) # We can share the calculation between the exercises that have the same condition - new_unlocks = [] + new_unlocks = T.let([], T::Array[Unlock]) course.exercises.enabled.group_by { |o| o.unlock_spec }.each do |_spec, exercises| - exercise = exercises.first + exercise = T.must(exercises.first) existing = exercises.all? { |ex| user_unlocks_by_exercise_name[ex.name] } exists = !!existing may_exist = exercise.requires_unlock? && exercise.unlock_spec_obj.permits_unlock_for?(user) diff --git a/app/models/unlock_spec.rb b/app/models/unlock_spec.rb index 7fbb694c3..bbd634377 100644 --- a/app/models/unlock_spec.rb +++ b/app/models/unlock_spec.rb @@ -1,18 +1,25 @@ +# typed: strict # frozen_string_literal: true require 'date_and_time_utils' # Parses and abstracts specification in the "unlocked_after" field of a `metadata.yml` file. class UnlockSpec # (the name of this class is unfortunate as it confuses IDEs when jumping to tests) + extend T::Sig class InvalidSyntaxError < StandardError; end + # course may be nil while an exercise is being built; only progress conditions need it. + # conditions is a decoded JSON array. + sig { params(course: T.nilable(Course), conditions: T::Array[T.untyped]).void } def initialize(course, conditions) @course = course @raw_spec = conditions - @conditions = [] - @universal_descriptions = [] - @describers = [] - @datetime_count = 0 + @conditions = T.let([], T::Array[T.proc.params(user: User).returns(T::Boolean)]) + @universal_descriptions = T.let([], T::Array[String]) + @describers = T.let([], T::Array[T.proc.params(user: User).returns(T.nilable(String))]) + @datetime_count = T.let(0, Integer) + @valid_after = T.let(nil, T.nilable(T.any(Time, ActiveSupport::TimeWithZone, DateTime))) + @depends_on_other_exercises = T.let(false, T::Boolean) conditions.each_with_index do |condition, i| parse_condition(condition.to_s.strip) if condition.to_s.present? rescue InvalidSyntaxError @@ -22,41 +29,50 @@ def initialize(course, conditions) end end + sig { params(course: T.nilable(Course), string: T.nilable(String)).returns(T.attached_class) } def self.from_str(course, string) return new(course, []) if string.nil? new(course, ActiveSupport::JSON.decode(string)) end + sig { returns(T::Boolean) } def empty? # No unlock conditions - no Unlock object required to be unlocked @conditions.empty? && @valid_after.nil? end # Whether the raw spec is only a date, so the clock alone decides the unlock. # Reads the JSON without parsing the spec, since parsing a progress condition queries the course's exercises. + sig { params(string: T.nilable(String)).returns(T::Boolean) } def self.date_only?(string) conditions = raw_conditions(string) conditions.any? && conditions.all? { |c| DateAndTimeUtils.looks_like_date_or_time(c) } end # The raw spec's conditions other than dates. Works on specs that no longer parse. + sig { params(string: T.nilable(String)).returns(T::Array[String]) } def self.non_date_conditions(string) raw_conditions(string).reject { |c| DateAndTimeUtils.looks_like_date_or_time(c) } end + sig { params(string: T.nilable(String)).returns(T::Array[String]) } def self.raw_conditions(string) return [] if string.nil? ActiveSupport::JSON.decode(string).map { |c| c.to_s.strip }.reject(&:empty?) end private_class_method :raw_conditions + sig { returns(T::Array[T.untyped]) } attr_reader :raw_spec + sig { returns(T.nilable(T.any(Time, ActiveSupport::TimeWithZone, DateTime))) } attr_reader :valid_after + sig { returns(T::Array[String]) } attr_reader :universal_descriptions + sig { params(user: User).returns(T.nilable(String)) } def description_for(user) - descrs = @describers.map { |d| d.call(user) }.reject(&:nil?) + descrs = @describers.filter_map { |d| d.call(user) } unless descrs.empty? - last = descrs.pop + last = T.must(descrs.pop) 'To unlock this exercise, you must ' + if descrs.empty? last else @@ -65,18 +81,21 @@ def description_for(user) end end + sig { params(user: User).returns(T::Boolean) } def permits_unlock_for?(user) @conditions.all? { |c| c.call(user) } end + sig { returns(T::Boolean) } def depends_on_other_exercises? !!@depends_on_other_exercises end private + sig { params(str: String).void } def parse_condition(str) if DateAndTimeUtils.looks_like_date_or_time(str) - time = DateAndTimeUtils.to_time(str) + time = T.must(DateAndTimeUtils.to_time(str)) raise 'Date out of range' if time.year > 10_000 || time.year < 1 # Prevent database datetime overflow raise "You can't have multiple unlock dates for the same exercise" if @datetime_count > 0 # Multiple unlock dates don't work correctly @datetime_count += 1 @@ -87,31 +106,32 @@ def parse_condition(str) # TODO: This does not work well with soft deadlines elsif str =~ /^points?\s+(\S+.*)$/ - points = Regexp.last_match(1).split(' ').map(&:strip).reject(&:empty?) + points = T.must(Regexp.last_match(1)).split(' ').map(&:strip).reject(&:empty?) @depends_on_other_exercises = true @conditions << lambda do |u| - AwardedPoint.where(user_id: u.id, course_id: @course.id, name: points).count == points.count + AwardedPoint.where(user_id: u.id, course_id: T.must(@course).id, name: points).count == points.count end @universal_descriptions << "the following points: #{points.join(' ')}" @describers << lambda do |u| - awarded = AwardedPoint.where(user_id: u.id, course_id: @course.id, name: points).map(&:name) + awarded = AwardedPoint.where(user_id: u.id, course_id: T.must(@course).id, name: points).map(&:name) "get the following points: #{(points - awarded).join(' ')}" end elsif str =~ /^(\d+)[%]\s+(?:in|of|from)\s+(\S+)$/ percentage_str = Regexp.last_match(1) percentage = percentage_str.to_f / 100.0 - group = Regexp.last_match(2) - check_group_or_exercise_exists(@course, group) + group = T.must(Regexp.last_match(2)) + course = T.must(@course) + check_group_or_exercise_exists(course, group) @depends_on_other_exercises = true @conditions << lambda do |u| - available, awarded, late = available_and_awarded_and_awarded_late(@course, group, u) - (awarded.count.to_f + late.count.to_f * @course.soft_deadline_point_multiplier) / available.count.to_f >= percentage - 0.0001 + available, awarded, late = available_and_awarded_and_awarded_late(course, group, u) + (awarded.count.to_f + late.count.to_f * course.soft_deadline_point_multiplier) / available.count.to_f >= percentage - 0.0001 end @universal_descriptions << "#{percentage_str}% from #{group}" @describers << lambda do |u| - available, awarded, late = available_and_awarded_and_awarded_late(@course, group, u) - remaining = ((percentage - 0.0001) * available.count.to_f).ceil - (awarded.count.to_f + late.count.to_f * @course.soft_deadline_point_multiplier).round(2) + available, awarded, late = available_and_awarded_and_awarded_late(course, group, u) + remaining = ((percentage - 0.0001) * available.count.to_f).ceil - (awarded.count.to_f + late.count.to_f * course.soft_deadline_point_multiplier).round(2) if remaining > 0 "get #{remaining} more #{plural(remaining, 'point')} from #{group}" end @@ -119,16 +139,17 @@ def parse_condition(str) elsif str =~ /^(\d+)\s+exercises?\s+(?:in|of|from)\s+(\S+)$/ num_exercises = Regexp.last_match(1).to_i - group = Regexp.last_match(2) - check_group_or_exercise_exists(@course, group) + group = T.must(Regexp.last_match(2)) + course = T.must(@course) + check_group_or_exercise_exists(course, group) @depends_on_other_exercises = true @conditions << lambda do |u| - required_exercises = @course.exercises_by_name_or_group(group) + required_exercises = course.exercises_by_name_or_group(group) required_exercises.count { |ex| ex.completed_by?(u) } >= num_exercises end @universal_descriptions << "#{num_exercises} #{plural(num_exercises, 'exercise')} from #{group}" @describers << lambda do |u| - required_exercises = @course.exercises_by_name_or_group(group) + required_exercises = course.exercises_by_name_or_group(group) remaining = num_exercises - required_exercises.count { |ex| ex.completed_by?(u) } if remaining > 0 "complete #{remaining} more #{plural(remaining, 'exercise')} from #{group}" @@ -137,16 +158,17 @@ def parse_condition(str) elsif str =~ /^(\d+)\s+points?\s+(?:in|of|from)\s+(\S+)$/ num_points = Regexp.last_match(1).to_i - group = Regexp.last_match(2) - check_group_or_exercise_exists(@course, group) + group = T.must(Regexp.last_match(2)) + course = T.must(@course) + check_group_or_exercise_exists(course, group) @depends_on_other_exercises = true @conditions << lambda do |u| - awarded = available_and_awarded_and_awarded_late(@course, group, u)[1] + awarded = available_and_awarded_and_awarded_late(course, group, u)[1] awarded.count >= num_points end @universal_descriptions << "#{num_points} #{plural(num_points, 'point')} from #{group}" @describers << lambda do |u| - awarded = available_and_awarded_and_awarded_late(@course, group, u)[1] + awarded = available_and_awarded_and_awarded_late(course, group, u)[1] remaining = num_points - awarded.count if remaining > 0 "get #{remaining} more #{plural(remaining, 'point')} from #{group}" @@ -157,12 +179,14 @@ def parse_condition(str) end end + sig { params(course: Course, group_or_exercise_name: String).void } def check_group_or_exercise_exists(course, group_or_exercise_name) if course.exercises_by_name_or_group(group_or_exercise_name, true).empty? raise "No such exercise or exercise group: #{group_or_exercise_name}. Remember that exercises need to be specified with their full name including their group." end end + sig { params(course: Course, group_or_exercise_name: String, user: User).returns([T::Array[String], T::Array[AwardedPoint], T::Array[AwardedPoint]]) } def available_and_awarded_and_awarded_late(course, group_or_exercise_name, user) required_exercises = course.exercises_by_name_or_group(group_or_exercise_name) .select { |e| e.hide_submission_results == false && e.enabled? } @@ -175,6 +199,7 @@ def available_and_awarded_and_awarded_late(course, group_or_exercise_name, user) [available, awarded, late] end + sig { params(n: Numeric, word: String).returns(String) } def plural(n, word) if n == 1 word @@ -183,6 +208,7 @@ def plural(n, word) end end + sig { params(spec: String, exercise: Exercise).returns(T::Boolean) } def self.parsable?(spec, exercise) UnlockSpec.new(exercise.course, ActiveSupport::JSON.decode(spec)) # Parses spec and fails if invalid true diff --git a/app/models/user.rb b/app/models/user.rb index 781abaa59..efa9ae83b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,8 +1,10 @@ +# typed: strict # frozen_string_literal: true require 'app_secrets' class User < ApplicationRecord + extend T::Sig include Comparable include Gravtastic include Swagger::Blocks @@ -69,9 +71,11 @@ class User < ApplicationRecord scope :legitimate_students, -> { where(legitimate_student: true) } scope :non_legitimate_students, -> { where(legitimate_student: false) } + sig { returns(T.nilable(String)) } attr_accessor :password before_save :encrypt_password + sig { params(course: Course).returns(ActiveRecord::Relation) } def self.course_students(course) joins(:awarded_points) .where(awarded_points: { course_id: course.id }) @@ -79,46 +83,60 @@ def self.course_students(course) end # TODO: Later after enrollment has implemented, this should use it instead + sig { params(organization: Organization).returns(ActiveRecord::Relation) } def self.organization_students(organization) joins(awarded_points: :course) .where(courses: { organization_id: organization.id }) .group('users.id') end + sig { params(course: Course, sheetname: String).returns(ActiveRecord::Relation) } def self.course_sheet_students(course, sheetname) AwardedPoint.users_in_course_with_sheet(course, sheetname) end + sig { returns(String) } def username login # 'login' is a legacy name that ought to be refactored out some day end + sig { params(name: String).void } def username=(name) self.login = name end # May eventually be separate from username + sig { returns(String) } def display_name username end - def field_value(field) - field_value_record(field).value + sig { params(field_name: String).returns(String) } + def field_value_by_name(field_name) + field_value_record_by_name(field_name).value end + sig { params(field: UserField).returns(T.any(String, T::Boolean)) } def field_ruby_value(field) field_value_record(field).ruby_value end + sig { params(field: UserField).returns(UserFieldValue) } def field_value_record(field) - value = user_field_values.to_a.select { |v| v.field_name == field.name }.first + field_value_record_by_name(field.name) + end + + sig { params(field_name: String).returns(UserFieldValue) } + def field_value_record_by_name(field_name) + value = user_field_values.to_a.select { |v| v.field_name == field_name }.first unless value - value = UserFieldValue.new(field_name: field.name, user_id: id, value: '') + value = UserFieldValue.new(field_name: field_name, user_id: id, value: '') user_field_values << value end value end + sig { params(filter_params: T.any(ActionController::Parameters, T::Hash[String, T.untyped])).returns(ActiveRecord::Relation) } def self.filter_by(filter_params) users = includes(:user_field_values) @@ -142,10 +160,12 @@ def self.filter_by(filter_params) users end + sig { returns(T::Boolean) } def guest? false end + sig { params(submitted_password: T.nilable(String)).returns(T::Boolean) } def has_password?(submitted_password) if !salt normalized = normalize_password(submitted_password) @@ -169,6 +189,7 @@ def has_password?(submitted_password) # The user when the password is accepted, nil otherwise. Use .authenticate_with_status when the # outcome is shown to the user, so that a delegation failure is not reported as a wrong password. + sig { params(login: T.nilable(String), submitted_password: T.nilable(String)).returns(T.nilable(User)) } def self.authenticate(login, submitted_password) user, status = authenticate_with_status(login, submitted_password) status == :accepted ? user : nil @@ -178,6 +199,7 @@ def self.authenticate(login, submitted_password) # :unavailable when courses.mooc.fi could not be reached, or :misconfigured when the account # cannot be delegated at all and only an admin can repair it. A found user is returned whatever # the status, so sign in only on :accepted. + sig { params(login: T.nilable(String), submitted_password: T.nilable(String)).returns([T.nilable(User), Symbol]) } def self.authenticate_with_status(login, submitted_password) return [nil, :rejected] unless login login = login.strip @@ -201,12 +223,14 @@ def self.authenticate_with_status(login, submitted_password) end # The password is stored in courses.mooc.fi and we have the id needed to delegate auth/changes. + sig { returns(T::Boolean) } def managed_externally? password_managed_by_courses_mooc_fi && courses_mooc_fi_user_id.present? end # Flagged as managed by courses.mooc.fi but missing the delegation id: a misconfigured state in # which local credentials must never be used as a fallback. + sig { returns(T::Boolean) } def externally_managed_without_target? password_managed_by_courses_mooc_fi && courses_mooc_fi_user_id.blank? end @@ -214,6 +238,7 @@ def externally_managed_without_target? # :accepted, :rejected when courses.mooc.fi judged the password wrong, or :unavailable when it # could not be consulted. Raises nothing, so that an outage is never mistaken for a rejection. + sig { params(submitted_password: T.nilable(String)).returns(Symbol) } def courses_mooc_fi_authentication_status(submitted_password) auth_url = courses_mooc_fi_url('/api/v0/tmc-server/users/authenticate') @@ -267,6 +292,7 @@ def courses_mooc_fi_authentication_status(submitted_password) + sig { params(old_password: T.nilable(String), new_password: T.nilable(String)).returns(T::Boolean) } def update_password_via_courses_mooc_fi(old_password, new_password) update_url = courses_mooc_fi_url('/api/v0/tmc-server/users/change-password') @@ -319,6 +345,7 @@ def update_password_via_courses_mooc_fi(old_password, new_password) end end + sig { params(password: T.nilable(String)).returns(T::Boolean) } def post_new_user_to_courses_mooc_fi(password) Rails.logger.info("Posting new user #{self.email} to courses.mooc.fi") create_url = courses_mooc_fi_url('/api/v0/tmc-server/users/create') @@ -385,6 +412,7 @@ def post_new_user_to_courses_mooc_fi(password) # so the user is passwordless until generate_password_reset_link runs. Local state is only # updated after a confirmed remote success, so a failure (e.g. re-creating a soft-deleted linked # id collides on the primary key) never leaves the account half-migrated. + sig { returns(T::Hash[Symbol, T.untyped]) } def force_migrate_to_courses_mooc_fi conn = courses_mooc_fi_connection @@ -422,6 +450,7 @@ def force_migrate_to_courses_mooc_fi # Live, display-only read of courses.mooc.fi's view of this user -- never gates any action. # nil means genuinely unknown (unconfigured, network error, unexpected response), not "not migrated". + sig { returns(T.nilable(T::Hash[Symbol, T.untyped])) } def courses_mooc_fi_migration_status return nil if SiteSetting.value('courses_mooc_fi_base_url').blank? @@ -456,6 +485,7 @@ def courses_mooc_fi_migration_status nil end + sig { returns(T.nilable(String)) } def courses_mooc_fi_profile_url return nil if courses_mooc_fi_user_id.blank? return nil if SiteSetting.value('courses_mooc_fi_base_url').blank? @@ -463,40 +493,49 @@ def courses_mooc_fi_profile_url courses_mooc_fi_url("/manage/users/#{courses_mooc_fi_user_id}") end + sig { returns(T.nilable(ActionToken)) } def password_reset_key action_tokens.find { |t| t.action == 'reset_password' } end + sig { params(course: Course, point_name: String).returns(T::Boolean) } def has_point?(course, point_name) awarded_points.where(course_id: course.id, name: point_name).any? end + sig { params(course: Course, point_names: T::Array[String]).returns(T::Boolean) } def has_points?(course, point_names) existing = awarded_points.where(course_id: course.id, name: point_names).map(&:name) point_names.all? { |pt| existing.include?(pt) } end + sig { params(other: T.untyped).returns(T.nilable(Integer)) } def <=>(other) login.downcase <=> other.login.downcase end + sig { params(organization: T.nilable(Organization)).returns(T::Boolean) } def teacher?(organization) organizations.include? organization end + sig { params(organization: Organization).returns(T.nilable(Teachership)) } def teachership(organization) Teachership.find_by(user_id: self, organization_id: organization) end + sig { params(course: Course).returns(T::Boolean) } def assistant?(course) assisted_courses.exists?(course.id) end + sig { params(organization: T.nilable(Organization)).returns(T::Boolean) } def member?(organization) memberships.include?(organization) end # TODO: this might need optimizing for minimizing sql queries made + sig { params(user: User).returns(T::Boolean) } def readable_by?(user) user.administrator? || id == user.id || @@ -504,6 +543,7 @@ def readable_by?(user) visible_to_assistant?(user) end + sig { params(teacher: User).returns(T::Boolean) } def visible_to_teacher?(teacher) courses = Course.joins(organization: :teacherships).where(teacherships: { user_id: teacher.id }) courses.each do |c| @@ -512,6 +552,7 @@ def visible_to_teacher?(teacher) false end + sig { params(assistant: User).returns(T::Boolean) } def visible_to_assistant?(assistant) assistant.assisted_courses.each do |c| return true if student_in_course?(c) @@ -519,10 +560,12 @@ def visible_to_assistant?(assistant) false end + sig { params(c: Course).returns(T::Boolean) } def student_in_course?(c) in?(User.course_students(c)) end + sig { params(organization: Organization).returns(T::Boolean) } def student_in_organization?(organization) organization.courses.each do |c| return true if student_in_course?(c) @@ -530,6 +573,7 @@ def student_in_organization?(organization) false end + sig { returns(T.nilable(T::Array[Integer])) } def teaching_in_courses if !assistantships.empty? Course.where(id: assistantships.pluck(:course_id)).ids @@ -538,14 +582,17 @@ def teaching_in_courses end end + sig { returns(T::Array[Integer]) } def teaching_in_organizations Teachership.where(user: self).pluck(:organization_id) end + sig { params(course: Course).returns(T.nilable(Assistantship)) } def assistantship(course) Assistantship.find_by(user_id: self, course_id: course) end + sig { returns(T::Hash[Integer, T::Array[T::Hash[Symbol, T.untyped]]]) } def courses_with_submissions exercises = Exercise.arel_table submissions = Submission.arel_table @@ -555,12 +602,11 @@ def courses_with_submissions .project(exercises[:course_id], exercises[:name], exercises[:id], submissions[:id].count, Arel::Nodes::SqlLiteral.new('bool_or(submissions.all_tests_passed)').as('all_tests_passed'), Arel::Nodes::SqlLiteral.new('ARRAY_AGG(DISTINCT available_points.name order by available_points.name) = ARRAY_AGG(DISTINCT awarded_points.name order by awarded_points.name)').as('got_all_points'), Arel::Nodes::SqlLiteral.new("STRING_AGG(DISTINCT available_points.name, ' ' order by available_points.name)").as('available_points'), Arel::Nodes::SqlLiteral.new("STRING_AGG(DISTINCT awarded_points.name, ' ' order by awarded_points.name)").as('awarded_points')) sql = query.to_sql - result = {} + result = T.let({}, T::Hash[Integer, T::Array[T::Hash[Symbol, T.untyped]]]) ActiveRecord::Base.connection.execute(sql).each do |record| # {"course_id"=>"8", "name"=>"viikkob-B.1.Opiskelijanumero", "count"=>"1", "all_tests_passed"=>"t", "got_all_points"=>"t", "available_points"=>"{B.1}", "awarded_points"=>"{B.1}"} course_id = record['course_id'].to_i - result[course_id] ||= [] - result[course_id] << { + (result[course_id] ||= []) << { exercise_name: record['name'], exercise_id: record['id'].to_i, submissions_count: record['count'].to_i, @@ -574,14 +620,16 @@ def courses_with_submissions result end + sig { returns(T::Array[Integer]) } def course_ids - results = [] + results = T.let([], T::Array[Integer]) ActiveRecord::Base.connection.execute(course_ids_arel.to_sql).each do |record| results << record['course_id'] end results end + sig { returns(String) } def generate_password_reset_link key = ActionToken.generate_password_reset_key_for(self) settings = SiteSetting.value('emails') @@ -589,17 +637,21 @@ def generate_password_reset_link url end + sig { params(query: T.nilable(String)).returns(ActiveRecord::Relation) } def self.search(query) return User.none unless query User.where('lower(email) LIKE ?', "%#{query.strip.downcase}%") end # Count how many submissions this user has processing for a specific exercise + sig { params(exercise_name: String, course_id: Integer).returns(Integer) } def processing_submissions_count_for_exercise(exercise_name, course_id) Submission.processing_count_for_user_and_exercise(id, exercise_name, course_id) end private + # Unchecked because specs stub Faraday.new with plain doubles. + sig { returns(Faraday::Connection).checked(:never) } def courses_mooc_fi_connection Faraday.new(headers: CoursesMoocFiRateLimitBypass.headers, request: { open_timeout: 2, timeout: 10 }) do |f| f.request :json @@ -607,10 +659,12 @@ def courses_mooc_fi_connection end end + sig { params(path: String).returns(String) } def courses_mooc_fi_url(path) "#{SiteSetting.value('courses_mooc_fi_base_url')}#{path}" end + sig { returns(Arel::SelectManager) } def course_ids_arel courses = Course.arel_table submissions = Submission.arel_table @@ -621,17 +675,20 @@ def course_ids_arel .order(submissions[:course_id]) end + sig { params(query: Arel::SelectManager).returns(Arel::SelectManager) } def without_disabled(query) exercises = Exercise.arel_table query.where(exercises[:disabled_status].eq(0)) query.where(exercises[:hidden].eq(false)) end + sig { params(query: Arel::SelectManager).returns(Arel::SelectManager) } def without_hidden_points(query) exercises = Exercise.arel_table query.where(exercises[:hide_submission_results].eq(false)) end + sig { returns(Arel::SelectManager) } def submissions_exercises_and_points_for_user users = User.arel_table awarded_points = AwardedPoint.arel_table @@ -649,6 +706,7 @@ def submissions_exercises_and_points_for_user .order(exercises[:name], exercises[:course_id]) end + sig { void } def encrypt_password if password.present? self.argon_hash = generate_argon(password) @@ -656,14 +714,17 @@ def encrypt_password end end + sig { params(string: T.nilable(String)).returns(String) } def old_encrypt(string) secure_hash("#{salt}--#{string}") end + sig { params(string: String).returns(String) } def secure_hash(string) Digest::SHA2.hexdigest(string) end + sig { void } def reject_common_login_mistakes return if login.blank? errors.add(:login, 'may not be your email address. Keep in mind that your username is public to everyone.') if login.include?('@') @@ -672,6 +733,7 @@ def reject_common_login_mistakes errors.add(:email, 'is incorrect. You probably meant firstname.lastname@helsinki.fi. Keep in mind that your email address does not contain your University of Helsinki username.') if email.end_with?('@helsinki.fi') && !/.*\..*@helsinki.fi/.match?(email) end + sig { params(input: T.nilable(String)).returns(String) } def generate_argon(input) Argon2::Password.new(t_cost: 4, m_cost: 15).create(normalize_password(input)) end @@ -680,6 +742,7 @@ def generate_argon(input) # entered on different platforms/forms hashes to identical bytes. Argon2 hashes raw bytes, so # a composed "ä" (U+00E4) and a decomposed "ä" (U+0061 U+0308) would otherwise produce # different hashes. nil is passed through unchanged (e.g. a missing old_password on reset). + sig { params(password: T.nilable(String)).returns(T.nilable(String)) } def normalize_password(password) return password unless password.is_a?(String) # HTTP Basic Auth credentials arrive Base64-decoded as ASCII-8BIT (binary), and @@ -695,6 +758,7 @@ def normalize_password(password) # be used as a fallback. Drop it if present. This self-heals users whose managed flag was set # by a direct SQL backfill that left the old hash behind (see also the one-time cleanup task). # update_columns writes directly, skipping validations and callbacks. + sig { void } def clear_stale_local_password return unless argon_hash.present? || salt.present? || password_hash.present? update_columns(argon_hash: nil, salt: nil, password_hash: nil, updated_at: Time.now) diff --git a/app/models/user_app_datum.rb b/app/models/user_app_datum.rb index 41cc7993b..ca01c6896 100644 --- a/app/models/user_app_datum.rb +++ b/app/models/user_app_datum.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true class UserAppDatum < ApplicationRecord diff --git a/app/models/user_field.rb b/app/models/user_field.rb index 078fca3ff..fce33403e 100644 --- a/app/models/user_field.rb +++ b/app/models/user_field.rb @@ -1,16 +1,21 @@ +# typed: strict # frozen_string_literal: true class UserField + extend T::Sig include ExtraField + sig { returns(T::Boolean) } def show_in_participant_list? @options[:show_in_participant_list] end + sig { params(user: User).returns(T::Boolean) } def visible_to?(user) @options[:visible_to_if].call(user) end + sig { returns(T::Hash[Symbol, T.untyped]) } def default_options super.merge(show_in_participant_list: false, visible_to_if: ->(_user) { true }) diff --git a/app/models/user_field_value.rb b/app/models/user_field_value.rb index 35ba46c89..02ca0392f 100644 --- a/app/models/user_field_value.rb +++ b/app/models/user_field_value.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true class UserFieldValue < ApplicationRecord diff --git a/app/models/validators/feedback_answer_format_validator.rb b/app/models/validators/feedback_answer_format_validator.rb index 8bc88c8bb..635fa169b 100644 --- a/app/models/validators/feedback_answer_format_validator.rb +++ b/app/models/validators/feedback_answer_format_validator.rb @@ -1,8 +1,12 @@ +# typed: strict # frozen_string_literal: true class Validators::FeedbackAnswerFormatValidator < ActiveModel::Validator + extend T::Sig + + sig { params(record: FeedbackAnswer).void } def validate(record) - kind = record.feedback_question.kind + kind = T.must(record.feedback_question).kind ans = record.answer.strip if kind =~ FeedbackQuestion.send(:intrange_regex) diff --git a/app/models/verification_token.rb b/app/models/verification_token.rb index ef0c2deee..3a5a2fdbd 100644 --- a/app/models/verification_token.rb +++ b/app/models/verification_token.rb @@ -1,6 +1,8 @@ +# typed: strict # frozen_string_literal: true class VerificationToken < ApplicationRecord + extend T::Sig # This class does not use single table inheritance self.inheritance_column = :_type_disabled @@ -16,6 +18,7 @@ class VerificationToken < ApplicationRecord before_create :generate_token private + sig { returns(String) } def generate_token self.token = SecureRandom.urlsafe_base64.to_s end diff --git a/app/services/courses_mooc_fi_authentication.rb b/app/services/courses_mooc_fi_authentication.rb index 4062ae791..c8b86292a 100644 --- a/app/services/courses_mooc_fi_authentication.rb +++ b/app/services/courses_mooc_fi_authentication.rb @@ -1,10 +1,13 @@ +# typed: strict # frozen_string_literal: true # Resolves the local user behind a courses.mooc.fi access token sent to API v8. module CoursesMoocFiAuthentication + extend T::Sig # Returns the user the request's bearer token belongs to, or nil when there is no bearer token, # courses.mooc.fi rejects it, or it belongs to no local user. Raises # CoursesMoocFiTokenIntrospector::Unavailable when the token cannot be checked right now. + sig { params(request: ActionDispatch::Request).returns(T.nilable(User)) } def self.user_for(request) token = Doorkeeper::OAuth::Token.from_bearer_authorization(request) return nil if token.blank? @@ -17,6 +20,7 @@ def self.user_for(request) # Binds the user with the TMC id courses.mooc.fi reports to the token's subject, unless that user # is already bound to another subject. + sig { params(result: CoursesMoocFiTokenIntrospector::Result).returns(T.nilable(User)) } def self.link_by_upstream_id(result) return nil if result.upstream_id.blank? diff --git a/app/services/courses_mooc_fi_rate_limit_bypass.rb b/app/services/courses_mooc_fi_rate_limit_bypass.rb index 7f96bcd51..0a5613713 100644 --- a/app/services/courses_mooc_fi_rate_limit_bypass.rb +++ b/app/services/courses_mooc_fi_rate_limit_bypass.rb @@ -1,10 +1,13 @@ +# typed: strict # frozen_string_literal: true # Headers for tmc-server's requests to courses.mooc.fi: sp331 skips its per-IP rate limits when this # header matches its RATELIMIT_PROTECTION_SAFE_API_KEY, the same shared value as RACK_ATTACK_SAFE_API_KEY. module CoursesMoocFiRateLimitBypass + extend T::Sig HEADER = 'RATELIMIT-PROTECTION-SAFE-API-KEY' + sig { returns(T::Hash[String, String]) } def self.headers key = ENV['RACK_ATTACK_SAFE_API_KEY'] key.present? ? { HEADER => key } : {} diff --git a/app/services/courses_mooc_fi_token_introspector.rb b/app/services/courses_mooc_fi_token_introspector.rb index 5b168c565..6aef62418 100644 --- a/app/services/courses_mooc_fi_token_introspector.rb +++ b/app/services/courses_mooc_fi_token_introspector.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'app_secrets' @@ -5,6 +6,7 @@ # Checks an opaque courses.mooc.fi (secret-project-331) access token via RFC 7662 introspection. class CoursesMoocFiTokenIntrospector + extend T::Sig # courses.mooc.fi could not answer: transport failure, non-200 (including 401 for our own client # credentials), unreadable body or missing configuration. Says nothing about the token. class Unavailable < StandardError; end @@ -21,10 +23,12 @@ class Unavailable < StandardError; end # Returns the Result for a token courses.mooc.fi vouches for, or nil when it rejects the token. # Raises Unavailable when it cannot answer; that is never cached. + sig { params(token: String).returns(T.nilable(Result)) } def self.introspect(token) new.introspect(token) end + sig { params(token: String).returns(T.nilable(Result)) } def introspect(token) return nil if token.blank? @@ -53,10 +57,13 @@ def introspect(token) private # sp331 serves introspection at "/introspect" and stamps every active response with # this issuer. + sig { returns(String) } def issuer - @issuer ||= "#{SiteSetting.value('courses_mooc_fi_base_url').to_s.chomp('/')}/api/v0/main-frontend/oauth" + @issuer ||= T.let("#{SiteSetting.value('courses_mooc_fi_base_url').to_s.chomp('/')}/api/v0/main-frontend/oauth", T.nilable(String)) end + # Returns the parsed JSON object of a 200 answer. + sig { params(token: String).returns(T::Hash[String, T.untyped]) } def request_introspection(token) client_id = AppSecrets.courses_mooc_fi_introspection_client_id client_secret = AppSecrets.courses_mooc_fi_introspection_secret @@ -88,6 +95,7 @@ def request_introspection(token) end # `aud` is not checked: sp331 mints every access token without an audience. + sig { params(body: T::Hash[String, T.untyped]).returns(T.nilable(String)) } def reject_reason(body) return 'inactive' unless body['active'] == true return "iss #{body['iss'].inspect} is not #{issuer.inspect}" unless body['iss'] == issuer @@ -100,6 +108,8 @@ def reject_reason(body) nil end + # In seconds; nil when the token has already expired. + sig { params(expires_at: T.nilable(Time)).returns(T.nilable(Integer)) } def cache_ttl(expires_at) return MAX_CACHE_TTL if expires_at.nil? remaining = (expires_at - Time.now).floor diff --git a/app/views/emails/index.html.erb b/app/views/emails/index.html.erb index ab80248d5..8a4ecd5bf 100644 --- a/app/views/emails/index.html.erb +++ b/app/views/emails/index.html.erb @@ -28,10 +28,10 @@ <%= mail_to(student.email) %> - <%= student.field_value(OpenStruct.new(name: 'first_name')) %> + <%= student.field_value_by_name('first_name') %> - <%= student.field_value(OpenStruct.new(name: 'last_name')) %> + <%= student.field_value_by_name('last_name') %> <% end %> diff --git a/bin/tapioca b/bin/tapioca new file mode 100755 index 000000000..2deef8fce --- /dev/null +++ b/bin/tapioca @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('tapioca', 'tapioca') diff --git a/config/application.rb b/config/application.rb index 1b3f4a4e7..219cbd0d6 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,9 +1,12 @@ +# typed: strict # frozen_string_literal: true require File.expand_path('boot', __dir__) +require 'sorbet-runtime' require File.expand_path('../app/models/site_setting.rb', __dir__) require 'rails/all' +require File.expand_path('sorbet_runtime', __dir__) # Require the gems listed in gemfile, including any gems # you've limited to :test, :development, or :production. @@ -37,6 +40,7 @@ class Application < Rails::Application config.x.accept_courses_mooc_fi_tokens = ENV['ACCEPT_COURSES_MOOC_FI_TOKENS'] == 'true' config.middleware.insert_before 0, Rack::Cors, debug: true, logger: (-> { Rails.logger }) do + T.bind(self, Rack::Cors) allow do origins '*' resource '/oauth*', headers: :any, methods: :any diff --git a/config/boot.rb b/config/boot.rb index 30e594e23..af83030a1 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) diff --git a/config/environment.rb b/config/environment.rb index 32d57aa44..bd8a00f75 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true # Load the Rails application. diff --git a/config/environments/development.rb b/config/environments/development.rb index 0c5268ce5..1edf11e8e 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true Rails.application.configure do diff --git a/config/environments/production.rb b/config/environments/production.rb index d11a105f4..e89425f72 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'uglifier' diff --git a/config/environments/test.rb b/config/environments/test.rb index ab1520346..57c3ac034 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true Rails.application.configure do diff --git a/config/initializers/admin.rb b/config/initializers/admin.rb index 541c2ffb1..6ca9554f3 100644 --- a/config/initializers/admin.rb +++ b/config/initializers/admin.rb @@ -1,7 +1,11 @@ +# typed: strict # frozen_string_literal: true class CanAccessPgHero + extend T::Sig + + sig { params(request: ActionDispatch::Request).returns(T::Boolean) } def self.matches?(request) current_user = User.find_by(id: request.env['rack.session']['user_id']) return false if current_user.blank? diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 1273fb743..1111a6970 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb index 4b63f2893..bd41145e2 100644 --- a/config/initializers/backtrace_silencers.rb +++ b/config/initializers/backtrace_silencers.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true # Be sure to restart your server when you modify this file. diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb index 0a23b25ec..8ea706c93 100644 --- a/config/initializers/cookies_serializer.rb +++ b/config/initializers/cookies_serializer.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true # Be sure to restart your server when you modify this file. diff --git a/config/initializers/doorkeeper.rb b/config/initializers/doorkeeper.rb index 314a2356c..c93bb667b 100644 --- a/config/initializers/doorkeeper.rb +++ b/config/initializers/doorkeeper.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true Doorkeeper.configure do diff --git a/config/initializers/doorkeeper_openid_connect.rb b/config/initializers/doorkeeper_openid_connect.rb index 6e85f4d0c..d072a73d3 100644 --- a/config/initializers/doorkeeper_openid_connect.rb +++ b/config/initializers/doorkeeper_openid_connect.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'app_secrets' diff --git a/config/initializers/env_lang.rb b/config/initializers/env_lang.rb index 5988df790..427f488e8 100644 --- a/config/initializers/env_lang.rb +++ b/config/initializers/env_lang.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true # This ensures any commands we invoke, especially javac, use UTF-8. diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index 7a4f47b4c..c787b99f3 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true # Be sure to restart your server when you modify this file. diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index dc8474221..e4788a591 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true # Be sure to restart your server when you modify this file. diff --git a/config/initializers/logstasher.rb b/config/initializers/logstasher.rb index 4f0de7cf4..97f6d5432 100644 --- a/config/initializers/logstasher.rb +++ b/config/initializers/logstasher.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true if LogStasher.enabled? @@ -5,8 +6,8 @@ # This block is run in application_controller context, # so you have access to all controller methods begin - fields[:user] = if current_user&.login - current_user.login + fields[:user] = if T.unsafe(self).current_user&.login + T.unsafe(self).current_user.login else 'guest' end diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index be6fedc53..0afb7f137 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true # Be sure to restart your server when you modify this file. diff --git a/config/initializers/mini_profiler.rb b/config/initializers/mini_profiler.rb index 2f122d5bd..b3f153856 100644 --- a/config/initializers/mini_profiler.rb +++ b/config/initializers/mini_profiler.rb @@ -1,9 +1,11 @@ +# typed: strict # frozen_string_literal: true Rack::MiniProfiler.config.position = 'bottom-right' -if Rails.env.production? && ENV['REDIS_URL'] - uri = URI.parse(ENV['REDIS_URL']) +redis_url = ENV['REDIS_URL'] +if Rails.env.production? && redis_url + uri = URI.parse(redis_url) Rack::MiniProfiler.config.storage_options = { host: uri.host, port: uri.port, password: uri.password } Rack::MiniProfiler.config.storage = Rack::MiniProfiler::RedisStore end diff --git a/config/initializers/rack_attack.rb b/config/initializers/rack_attack.rb index e2ed47366..16c6004d8 100644 --- a/config/initializers/rack_attack.rb +++ b/config/initializers/rack_attack.rb @@ -1,8 +1,9 @@ +# typed: strict # frozen_string_literal: true require 'rack/attack' -LOGGER = Logger.new('log/rack-attack.log') +LOGGER = T.let(Logger.new('log/rack-attack.log'), Logger) ActiveSupport::Notifications.subscribe('rack.attack') do |_name, _start, _finish, _request_id, req| req = req[:request] msg = [req.env['rack.attack.match_type'], req.ip, req.request_method, req.fullpath, ('"' + req.user_agent.to_s + '"')].join(' ') @@ -16,6 +17,10 @@ # RACK Request: https://github.com/rack/rack/blob/main/lib/rack/request.rb class Rack::Attack + extend T::Sig + + # The token is a raw request param, so it can be any shape. + sig { params(access_token: T.untyped).returns(T.untyped) } def self.user_identifier_discriminator(access_token) db_token = Doorkeeper::AccessToken.find_by(token: access_token) return access_token unless db_token diff --git a/config/initializers/rack_initializer.rb b/config/initializers/rack_initializer.rb index f30fc5757..31a7a5e5f 100644 --- a/config/initializers/rack_initializer.rb +++ b/config/initializers/rack_initializer.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true diff --git a/config/initializers/rack_timeout.rb b/config/initializers/rack_timeout.rb index f97976052..0d30e6483 100644 --- a/config/initializers/rack_timeout.rb +++ b/config/initializers/rack_timeout.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true # set the timeout to 2 minutes diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index c4a9cf358..88bbe7f42 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true # Be sure to restart your server when you modify this file. diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb index 246168a42..93e01cc2d 100644 --- a/config/initializers/wrap_parameters.rb +++ b/config/initializers/wrap_parameters.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true # Be sure to restart your server when you modify this file. @@ -7,6 +8,7 @@ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. ActiveSupport.on_load(:action_controller) do + T.bind(self, T.any(T.class_of(ActionController::Base), T.class_of(ActionController::API))) wrap_parameters format: [:json] if respond_to?(:wrap_parameters) end diff --git a/config/routes.rb b/config/routes.rb index 3dc83e7a7..7b3e21f93 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true TmcServer::Application.routes.draw do diff --git a/config/site_tailoring.example.rb b/config/site_tailoring.example.rb index 20afcbed7..cc316c961 100644 --- a/config/site_tailoring.example.rb +++ b/config/site_tailoring.example.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true # Optionally copy this file to site_tailoring.rb and diff --git a/config/sorbet_runtime.rb b/config/sorbet_runtime.rb new file mode 100644 index 000000000..81fde3ea8 --- /dev/null +++ b/config/sorbet_runtime.rb @@ -0,0 +1,81 @@ +# typed: strict +# frozen_string_literal: true + +# Reports sorbet-runtime violations in production instead of raising (except T.must), where a wrong sig must not take the site down. +# Other environments keep sorbet's raising defaults. Required from config/application.rb so it also covers boot. +module SorbetRuntimeReporting + extend T::Sig + + # Bounds memory; once full the set restarts, so a location can be reported again. + MAX_REPORTED_LOCATIONS = 1000 + MUST_KINDS = T.let(['T.must', 'T.must_because'].freeze, T::Array[String]) + RUNTIME_GEM_DIR = T.let(Gem.loaded_specs['sorbet-runtime']&.full_gem_path, T.nilable(String)) + + @reported_locations = T.let(Set.new, T::Set[String]) + @reported_locations_mutex = T.let(Mutex.new, Thread::Mutex) + + # Logs the violation and notifies NewRelic, once per process for each location, so a + # wrong sig on a per-row method can't flood the logs. + sig { params(error: Exception, location: T.nilable(String)).void } + def self.report(error, location) + return unless first_report_at?(location || error.message) + + backtrace = error.backtrace || [] + # Both are nil until the application has initialized. + root = T.let(Rails.root, T.nilable(Pathname)) + logger = T.let(Rails.logger, T.nilable(ActiveSupport::BroadcastLogger)) + cleaned_backtrace = root ? Rails.backtrace_cleaner.clean(backtrace) : backtrace + cleaned_backtrace = backtrace if cleaned_backtrace.empty? + message = "#{error.class}: #{error.message}\n#{cleaned_backtrace.join("\n")}" + logger ? logger.error(message) : warn(message) + # Expected: execution continues, so the request itself has not failed. + NewRelic::Agent.notice_error(error, expected: true) if defined?(NewRelic::Agent) + end + + # The first frame outside sorbet-runtime, as "path:line". + sig { params(error: Exception).returns(T.nilable(String)) } + def self.origin(error) + runtime_gem_dir = RUNTIME_GEM_DIR + frame = error.backtrace_locations&.find { |location| !runtime_gem_dir || !location.path.to_s.start_with?(runtime_gem_dir) } + frame && "#{frame.path}:#{frame.lineno}" + end + + # Makes violations log instead of raise, except T.must, which raises so the error names the line + # that got nil instead of a NoMethodError further on. + sig { void } + def self.install_production_handlers! + T::Configuration.exclude_value_in_type_errors + + T::Configuration.call_validation_error_handler = lambda do |signature, opts| + error = TypeError.new(opts[:pretty_message]) + error.set_backtrace(caller) + caller_location = opts[:location] + report(error, "#{signature.method_name}@#{caller_location&.path}:#{caller_location&.lineno}") + end + + T::Configuration.inline_type_error_handler = lambda do |error, opts| + raise error if MUST_KINDS.include?(opts[:kind]) + report(error, origin(error)) + end + + T::Configuration.sig_validation_error_handler = lambda do |error, opts| + report(error, opts[:method]&.source_location&.join(':')) + end + + # The method then runs unchecked. + T::Configuration.sig_builder_error_handler = lambda do |error, location| + report(error, location ? "#{location.path}:#{location.lineno}" : nil) + end + end + + sig { params(location: String).returns(T::Boolean) } + def self.first_report_at?(location) + @reported_locations_mutex.synchronize do + @reported_locations.clear if @reported_locations.size >= MAX_REPORTED_LOCATIONS + !@reported_locations.add?(location).nil? + end + end + private_class_method :first_report_at? +end + +SorbetRuntimeReporting.install_production_handlers! if Rails.env.production? diff --git a/db/seeds.rb b/db/seeds.rb index 7d257d1de..0a038a6fe 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,2 +1,3 @@ +# typed: strict User.create!(login: 'admin', password: 'admin', administrator: true, email: 'admin@example.com', legitimate_student: false) User.create!(login: 'test', password: 'test', administrator: false, email: 'test@example.com') diff --git a/lib/app_secrets.rb b/lib/app_secrets.rb index 6aef1f3b1..1f11a3944 100644 --- a/lib/app_secrets.rb +++ b/lib/app_secrets.rb @@ -1,13 +1,25 @@ +# typed: strict # frozen_string_literal: true # config/secrets.yml, read without Rails.application.secrets (deprecated in Rails 7.1, gone in 7.2). # In lib/ because initializers need it before autoloading is available. module AppSecrets class << self + extend T::Sig + + sig { returns(ActiveSupport::OrderedOptions) } def config - @config ||= Rails.application.config_for(:secrets) + @config ||= T.let(Rails.application.config_for(:secrets), T.nilable(ActiveSupport::OrderedOptions)) end - delegate_missing_to :config + # Each is nil when the environment's secrets don't set it. + sig { returns(T.nilable(String)) } + def openid_connect_signing_key = config[:openid_connect_signing_key] + sig { returns(T.nilable(String)) } + def tmc_server_secret_for_communicating_to_secret_project = config[:tmc_server_secret_for_communicating_to_secret_project] + sig { returns(T.nilable(String)) } + def courses_mooc_fi_introspection_client_id = config[:courses_mooc_fi_introspection_client_id] + sig { returns(T.nilable(String)) } + def courses_mooc_fi_introspection_secret = config[:courses_mooc_fi_introspection_secret] end end diff --git a/lib/background_task_registry.rb b/lib/background_task_registry.rb index 5dce71773..9f6d67acf 100644 --- a/lib/background_task_registry.rb +++ b/lib/background_task_registry.rb @@ -1,16 +1,23 @@ +# typed: strict # frozen_string_literal: true +# The tasks script/background_daemon runs: every class in app/background_tasks, each responding to run and wait_delay. module BackgroundTaskRegistry + extend T::Sig + + sig { params(cls: T::Class[Object]).void } def self.register(cls) classes << cls end + sig { returns(T::Array[T::Class[Object]]) } def self.classes - @classes ||= [] + @classes ||= T.let([], T.nilable(T::Array[T::Class[Object]])) end + sig { returns(T::Array[Object]) } def self.all_tasks - @instances ||= classes.map(&:new) + @instances ||= T.let(classes.map(&:new), T.nilable(T::Array[Object])) end end diff --git a/lib/course_info.rb b/lib/course_info.rb index e0df4530d..23099bfd8 100644 --- a/lib/course_info.rb +++ b/lib/course_info.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'natsort' @@ -5,22 +6,25 @@ # Builds /courses/:id.json class CourseInfo + extend T::Sig + sig { params(user: User, helpers: T.all(ActionView::Base, ExercisesHelper)).void } def initialize(user, helpers) @user = user @helpers = helpers + @unlocked_exercises = T.let(Set.new, T::Set[T.nilable(String)]) - @course_list = CourseList.new(user, helpers) + @course_list = T.let(CourseList.new(user, helpers), CourseList) end + sig { params(organization: Organization, course: Course, opts: T::Hash[Symbol, T.untyped]).returns(T::Hash[Symbol, T.untyped]) } def course_data(organization, course, opts = {}) exercises = course.exercises.includes(:course, :available_points).to_a.natsort_by(&:name) @unlocked_exercises = course.unlocked_exercise_names_for(@user, exercises) - submissions_by_exercise = {} + submissions_by_exercise = T.let({}, T::Hash[T.nilable(String), T::Array[Submission]]) Submission.where(course_id: course.id, user_id: @user.id).each do |sub| - submissions_by_exercise[sub.exercise_name] ||= [] - submissions_by_exercise[sub.exercise_name] << sub + (submissions_by_exercise[sub.exercise_name] ||= []) << sub end exercises.each do |ex| ex.set_submissions_by!(@user, submissions_by_exercise[ex.name] || []) @@ -30,6 +34,7 @@ def course_data(organization, course, opts = {}) exercises: exercises.map { |ex| exercise_data(ex) }.reject(&:nil?)) end + sig { params(course: Course).returns(T::Hash[Symbol, T.untyped]) } def course_data_core_api(course) # UncomputedUnlock.resolve(course, @user) exercises = course.exercises.includes(:course, :available_points) @@ -45,7 +50,10 @@ def course_data_core_api(course) # Cache submissions so that we can calculate quickly whether the exercise # was completed or attampted and so on... - submissions_by_exercise = Submission.where(course: course, user: @user).group_by { |submission| submission.exercise_name } + submissions_by_exercise = T.let( + Submission.where(course: course, user: @user).group_by { |submission| submission.exercise_name }, + T::Hash[T.nilable(String), T::Array[Submission]] + ) exercises.each do |ex| ex.set_submissions_by!(@user, submissions_by_exercise[ex.name] || []) end @@ -66,15 +74,16 @@ def course_data_core_api(course) end private + sig { params(exercise: Exercise).returns(T.nilable(T::Hash[Symbol, T.untyped])) } def exercise_data(exercise) return nil unless exercise.visible_to?(@user) # optimization: use @unlocked_exercises to avoid querying unlocks repeatedly locked = !@unlocked_exercises.include?(exercise.name) - show_points = !exercise.hide_submission_results? && !exercise.course.hide_submission_results? + show_points = !exercise.hide_submission_results? && !T.must(exercise.course).hide_submission_results? attempted = exercise.attempted_by?(@user) - data = { + data = T.let({ id: exercise.id, name: exercise.name, locked: locked, @@ -94,7 +103,7 @@ def exercise_data(exercise) valgrind_strategy: exercise.valgrind_strategy, code_review_requests_enabled: exercise.code_review_requests_enabled?, run_tests_locally_action_enabled: exercise.run_tests_locally_action_enabled? - } + }, T::Hash[Symbol, T.untyped]) data[:solution_zip_url] = @helpers.exercise_solution_zip_url(exercise) if @user.administrator? data[:exercise_submissions_url] = @helpers.exercise_url(exercise, format: 'json', api_version: ApiVersion::API_VERSION) @@ -106,13 +115,14 @@ def exercise_data(exercise) data end + sig { params(exercise: Exercise).returns(T::Hash[Symbol, T.untyped]) } def exercise_data_core_api(exercise) # optimization: use @unlocked_exercises to avoid querying unlocks repeatedly locked = !@unlocked_exercises.include?(exercise.name) - show_points = !exercise.hide_submission_results? && !exercise.course.hide_submission_results? + show_points = !exercise.hide_submission_results? && !T.must(exercise.course).hide_submission_results? attempted = exercise.attempted_by?(@user) - data = { + data = T.let({ id: exercise.id, name: exercise.name, locked: locked, @@ -134,26 +144,20 @@ def exercise_data_core_api(exercise) valgrind_strategy: exercise.valgrind_strategy, code_review_requests_enabled: exercise.code_review_requests_enabled?, run_tests_locally_action_enabled: exercise.run_tests_locally_action_enabled? - } + }, T::Hash[Symbol, T.untyped]) data[:solution_zip_url] = @helpers.download_api_v8_core_exercise_solution_url(exercise) if @user.administrator? data end - def exercises - @exercises ||= course.exercises.select { |e| e.points_visible_to?(@user) } - end - - def sheets - @sheets ||= course.gdocs_sheets(exercises).natsort - end - + sig { params(e: Exercise).returns(String) } def exercise_return_url(e) @helpers.exercise_submissions_url(e, format: 'json').to_s end + sig { params(exercise: Exercise).returns(T.nilable(Submission)) } def get_latest_submission(exercise) - exercise.submissions_by(@user).min_by(&:created_at) + exercise.submissions_by(@user).min_by { |submission| T.must(submission.created_at) } end end diff --git a/lib/course_list.rb b/lib/course_list.rb index a0a608f08..8fe1983ff 100644 --- a/lib/course_list.rb +++ b/lib/course_list.rb @@ -1,25 +1,35 @@ +# typed: strict # frozen_string_literal: true require 'natsort' # Builds /courses.json class CourseList + extend T::Sig + + sig { params(user: User, helpers: ActionView::Base).void } def initialize(user, helpers) @user = user @helpers = helpers end + # opts: :include_points and :include_unlock_conditions add those per-course sections. + sig do + params(organization: Organization, courses: T::Enumerable[Course], opts: T::Hash[Symbol, T.untyped]) + .returns(T::Array[T::Hash[Symbol, T.untyped]]) + end def course_list_data(organization, courses, opts = {}) courses.map { |c| course_data(organization, c, opts) } end + sig { params(courses: T::Enumerable[Course], opts: T::Hash[Symbol, T.untyped]).returns(T::Array[T::Hash[Symbol, T.untyped]]) } def course_list_data_no_organisation(courses, opts = {}) - courses.map { |c| course_data(c.organization, c, opts) } + courses.map { |c| course_data(T.must(c.organization), c, opts) } end + sig { params(organization: Organization, course: Course, opts: T::Hash[Symbol, T.untyped]).returns(T::Hash[Symbol, T.untyped]) } def course_data(organization, course, opts = {}) - @course = course - data = { + data = T.let({ id: course.id, name: course.name, title: course.title, @@ -28,9 +38,13 @@ def course_data(organization, course, opts = {}) reviews_url: @helpers.organization_course_reviews_url(organization, course, format: :json), comet_url: '', spyware_urls: SiteSetting.value('spyware_servers') - } + }, T::Hash[Symbol, T.untyped]) + return data unless opts[:include_points] || opts[:include_unlock_conditions] + + exercises = course.exercises.select { |e| e.points_visible_to?(@user) } if opts[:include_points] + sheets = course.gdocs_sheets(exercises).natsort data[:points] = { sheets: sheets.map do |sheet| { @@ -45,9 +59,10 @@ def course_data(organization, course, opts = {}) if opts[:include_unlock_conditions] data[:unlock_conditions] = [ exercises.map do |ex| + unlock_spec = ex.unlock_spec { name: ex.name, - conditions: JSON.parse(ex.unlock_spec) + conditions: unlock_spec ? JSON.parse(unlock_spec) : [] } end ] @@ -55,13 +70,4 @@ def course_data(organization, course, opts = {}) data end - - private - def exercises - @exercises ||= @course.exercises.select { |e| e.points_visible_to?(@user) } - end - - def sheets - @sheets ||= @course.gdocs_sheets(exercises).natsort - end end diff --git a/lib/course_refresh_database_updater.rb b/lib/course_refresh_database_updater.rb index 2f1b94560..170e35156 100644 --- a/lib/course_refresh_database_updater.rb +++ b/lib/course_refresh_database_updater.rb @@ -1,61 +1,87 @@ +# typed: strict # frozen_string_literal: true require 'benchmark' require 'system_commands' class CourseRefreshDatabaseUpdater + extend T::Sig + + # refreshed_course_data: RustLangsCliExecutor.refresh's result. Raises Failure after rolling back. + sig { params(course: Course, refreshed_course_data: T.untyped).returns(Report) } def refresh_course(course, refreshed_course_data) Impl.new.refresh_course(course, refreshed_course_data) end class Report + extend T::Sig + sig { void } def initialize - @errors = [] - @warnings = [] - @notices = [] - @timings = {} + @errors = T.let([], T::Array[String]) + @warnings = T.let([], T::Array[String]) + @notices = T.let([], T::Array[String]) + @timings = T.let({}, T::Hash[Symbol, Benchmark::Tms]) end + sig { returns(T::Array[String]) } attr_reader :errors + sig { returns(T::Array[String]) } attr_reader :warnings + sig { returns(T::Array[String]) } attr_reader :notices + sig { returns(T::Hash[Symbol, Benchmark::Tms]) } attr_reader :timings end class Failure < StandardError + extend T::Sig + sig { params(report: Report).void } def initialize(report) super(report.errors.join("\n")) @report = report end + sig { returns(Report) } attr_reader :report end private class Impl + extend T::Sig include SystemCommands - def measure_and_log(method_name, *args) - log(method_name, Benchmark.measure { send(method_name, *args) }) + sig { void } + def initialize + @report = T.let(Report.new, Report) + @rust_data = T.let({}, T::Hash[String, T.untyped]) + @course = T.let(nil, T.nilable(Course)) + end + + sig { params(method_name: Symbol).void } + def measure_and_log(method_name) + log(method_name, Benchmark.measure { method(method_name).call }) end + sig { params(method_name: Symbol, result: Benchmark::Tms).void } def log(method_name, result) Rails.logger.info "Refresh: #{method_name} - #{result}" @report.timings[method_name] = result end + sig { params(opts: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) } def merge_course_specific_suboptions(opts) - if opts.key?('courses') && opts['courses'].key?(@course.name) - opts = opts.merge(opts['courses'][@course.name]) + if opts.key?('courses') && opts['courses'].key?(course.name) + opts = opts.merge(opts['courses'][course.name]) end opts.delete 'courses' opts end + sig { params(course: Course, data: T.untyped).returns(Report) } def refresh_course(course, data) - @report = Report.new @rust_data = data['output-data'] Course.transaction(requires_new: true) do - @course = Course.find(course.id) + refreshed = Course.find(course.id) + @course = refreshed measure_and_log :update_course_options measure_and_log :add_records_for_new_exercises @@ -67,14 +93,12 @@ def refresh_course(course, data) measure_and_log :invalidate_unlocks measure_and_log :kafka_publish_exercises - @course.refreshed_at = Time.now - @course.initial_refresh_ready = true unless @course.initial_refresh_ready - @course.save! - @course.exercises.each(&:save!) - - CourseRefreshDatabaseUpdater.simulate_failure! if ::Rails.env.test? && CourseRefreshDatabaseUpdater.respond_to?('simulate_failure!') - rescue StandardError, ScriptError - @report.errors << $!.message + "\n" + $!.backtrace.join("\n") + refreshed.refreshed_at = Time.zone.now + refreshed.initial_refresh_ready = true unless refreshed.initial_refresh_ready + refreshed.save! + refreshed.exercises.each(&:save!) + rescue StandardError, ScriptError => e + @report.errors << e.message + "\n" + T.must(e.backtrace).join("\n") raise ActiveRecord::Rollback end @@ -83,40 +107,51 @@ def refresh_course(course, data) @report end + # Only valid inside refresh_course's transaction. + sig { returns(Course) } + def course + T.must(@course) + end + + sig { void } def update_course_options - @course.options = merge_course_specific_suboptions(@rust_data['course-options'].clone) + course.options = merge_course_specific_suboptions(@rust_data['course-options'].clone) end + sig { void } def add_records_for_new_exercises rust_ex = @rust_data['exercises'].map { |ex| ex['name'] } - course_ex = @course.exercises.map { |ex| ex.name } + course_ex = course.exercises.map { |ex| ex.name } added_exercises = rust_ex - course_ex added_exercises.each do |exercise| @report.notices << "Added exercise #{exercise}" - @course.exercises.new(name: exercise) + course.exercises.new(name: exercise) end end + sig { void } def delete_records_for_removed_exercises - removed_exercises = @course.exercises.reject { |e| @rust_data['exercises'].map { |ex| ex['name'] }.include?(e.name) } + removed_exercises = course.exercises.reject { |e| @rust_data['exercises'].map { |ex| ex['name'] }.include?(e.name) } removed_exercises.each do |e| @report.notices << "Removed exercise #{e.name}" - @course.exercises.destroy(e) + course.exercises.destroy(e) e.destroy end end + sig { void } def set_exercise_options - specs_by_group = @course.exercises.reject(&:new_record?).group_by(&:exercise_group_name).transform_values { |es| es.map(&:unlock_spec).uniq } - @course.exercises.each do |e| + specs_by_group = course.exercises.reject(&:new_record?).group_by(&:exercise_group_name).transform_values { |es| es.map(&:unlock_spec).uniq } + course.exercises.each do |e| e.has_tests = true # we don't yet detect whether an exercise includes tests e.options = {} # exercise metadata.yml reading support removed, set default options inherit_group_unlock_spec(e, specs_by_group[e.exercise_group_name] || []) if e.new_record? - e.disabled! if e.new_record? && e.course.refreshed? # disable new exercises + e.disabled! if e.new_record? && course.refreshed? # disable new exercises end end # Without this a new exercise in a locked group is open to everyone until a teacher saves the group's conditions again. + sig { params(exercise: Exercise, specs: T::Array[T.nilable(String)]).void } def inherit_group_unlock_spec(exercise, specs) if specs.length > 1 @report.warnings << "Exercise #{exercise.name} was added to a group whose exercises have different unlock conditions; set them on the manage unlocks page" @@ -128,10 +163,11 @@ def inherit_group_unlock_spec(exercise, specs) @report.warnings << "Exercise #{exercise.name} could not inherit the unlock conditions of its group: #{e.message}" end + sig { void } def set_docker_image default_image = Exercise.new.docker_image @rust_data['exercises'].each do |exercise| - ex = @course.exercises.find { |e| e.name == exercise['name'] } + ex = course.exercises.find { |e| e.name == exercise['name'] } next unless ex if (exercise['tmcproject-yml'] || {}).include? 'sandbox_image' ex.docker_image = exercise['tmcproject-yml']['sandbox_image'] @@ -141,38 +177,15 @@ def set_docker_image end end - def set_memory_limit - @rust_data['exercises'].each do |exercise| - ex = @course.exercises.find { |e| e.name == exercise['name'] } - next unless ex - if (exercise['tmcproject-yml'] || {}).include? 'memory_gb' - ex.memory_limit = exercise['tmcproject-yml']['memory_gb'] - else - ex.memory_limit = 1 - end - end - end - - def set_cpu_limit - @rust_data['exercises'].each do |exercise| - ex = @course.exercises.find { |e| e.name == exercise['name'] } - next unless ex - if (exercise['tmcproject-yml'] || {}).include? 'cpus' - ex.cpu_limit = exercise['tmcproject-yml']['cpus'] - else - ex.cpu_limit = 1 - end - end - end - + sig { void } def update_available_points @rust_data['exercises'].each do |exercise| added = [] removed = [] - ex = @course.exercises.find { |e| e.name == exercise['name'] } + ex = course.exercises.find { |e| e.name == exercise['name'] } unless ex - Rails.logger.warn("Could not find exercise with name #{exercise['name']} in database for course #{@course.name}") + Rails.logger.warn("Could not find exercise with name #{exercise['name']} in database for course #{course.name}") next end @@ -200,9 +213,10 @@ def update_available_points end end + sig { void } def update_exercise_checksums @rust_data['exercises'].each do |exercise| - ex = @course.exercises.find { |e| e.name == exercise['name'] } + ex = course.exercises.find { |e| e.name == exercise['name'] } next unless ex if ex.checksum != exercise['checksum'] @report.notices << "Exercise #{ex.name} updated" unless ex.checksum.empty? @@ -211,12 +225,14 @@ def update_exercise_checksums end end + sig { void } def invalidate_unlocks - UncomputedUnlock.create_all_for_course(@course) + UncomputedUnlock.create_all_for_course(course) end + sig { void } def kafka_publish_exercises - KafkaBatchUpdatePoints.create!(course_id: @course.id, task_type: 'exercises') if @course.moocfi_id && !@course.moocfi_id.blank? + KafkaBatchUpdatePoints.create!(course_id: course.id, task_type: 'exercises') if course.moocfi_id && !course.moocfi_id.blank? end end end diff --git a/lib/date_and_time_utils.rb b/lib/date_and_time_utils.rb index 5683ccd5e..db51dde2f 100644 --- a/lib/date_and_time_utils.rb +++ b/lib/date_and_time_utils.rb @@ -1,7 +1,15 @@ +# typed: strict # frozen_string_literal: true module DateAndTimeUtils + extend T::Sig + + # input: a date/time string, Date or Time; blank gives nil, anything else raises. + sig do + params(input: T.untyped, options: T::Hash[Symbol, T.untyped]) + .returns(T.nilable(T.any(Time, ActiveSupport::TimeWithZone, DateTime))) + end def self.to_time(input, options = {}) options = { prefer_end_of_day: false @@ -24,6 +32,7 @@ def self.to_time(input, options = {}) d end + sig { params(input: String).returns(T.any(Date, ActiveSupport::TimeWithZone)) } def self.parse_date_or_time(input) s = input.strip @@ -45,6 +54,7 @@ def self.parse_date_or_time(input) result end + sig { params(time: T.untyped, options: T::Hash[Symbol, T.untyped]).returns(T.nilable(String)) } def self.to_utc_str(time, options = {}) t = to_time(time, options) if !t.nil? @@ -54,6 +64,8 @@ def self.to_utc_str(time, options = {}) end end + # str: any value from a user-written spec; non-strings give false. + sig { params(str: T.untyped).returns(T::Boolean) } def self.looks_like_date_or_time(str) !!parse_date_or_time(str) rescue StandardError diff --git a/lib/doc_gen.rb b/lib/doc_gen.rb index fefa03300..c9799e8f4 100644 --- a/lib/doc_gen.rb +++ b/lib/doc_gen.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'fileutils' @@ -7,15 +8,21 @@ # Used for generating documents from acceptance tests. # See e.g. spec/usermanual class DocGen + extend T::Sig # include IntegrationTestActions + sig { returns(String) } attr_reader :doc_name + # self_in_test: the running RSpec example, which carries the Capybara DSL. + sig { params(name: String, self_in_test: T.untyped).void } def initialize(name, self_in_test) @doc_name = name @test_case = self_in_test + @img_counter = T.let(nil, T.nilable(Integer)) end + sig { params(template_path: T.any(String, Pathname)).void } def render_template(template_path) template = File.read(template_path) b = send(:binding) @@ -25,37 +32,43 @@ def render_template(template_path) File.open(output_path, 'wb') { |f| f.write(text) } end + sig { params(_options: T.untyped).returns(String) } def screenshot(_options = {}) name = next_screenshot_name screenshot_to_file("#{root_path}/screenshots/#{name}", _options) '(screenshot)' end + sig { params(matcher: String).returns(T.untyped) } def highlight(matcher) @test_case.page.execute_script("jQuery('#{matcher}').addClass('highlighted');") end + sig { params(name: Symbol, args: T.untyped, block: T.nilable(Proc)).returns(T.untyped) } def method_missing(name, *args, &block) @test_case.send(name, *args, &block) end private + sig { returns(String) } def root_path "#{Rails.root}/doc/usermanual" end + sig { returns(String) } def output_path "#{root_path}/#{@doc_name}.html" end + sig { returns(String) } def next_screenshot_name - @img_counter ||= 0 - @img_counter += 1 + @img_counter = (@img_counter || 0) + 1 "#{@doc_name}-#{@img_counter}.png" end + sig { params(path: T.any(String, Pathname), _options: T.untyped).returns(T.untyped) } def screenshot_to_file(path, _options) - default_options = { full: true } + default_options = T.let({ full: true }, T::Hash[Symbol, T.untyped]) options = default_options.merge(_options) FileUtils.mkdir_p(File.dirname(path)) options[:wide] ? @test_case.page.driver.browser.resize(1200, 800) : @test_case.page.driver.browser.resize(1024, 768) diff --git a/lib/doc_gen/shell_session.rb b/lib/doc_gen/shell_session.rb index 99e2089fe..9bb73cb2f 100644 --- a/lib/doc_gen/shell_session.rb +++ b/lib/doc_gen/shell_session.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'cgi' # for escapeHTML @@ -6,19 +7,24 @@ class DocGen # A shell session where the interaction can be printed to the generated document. class ShellSession + extend T::Sig + sig { returns(String) } attr_accessor :prompt + sig { returns(String) } attr_accessor :working_dir + sig { void } def initialize - @prompt = '$ ' - @working_dir = Dir.pwd + @prompt = T.let('$ ', String) + @working_dir = T.let(Dir.pwd, String) end # Usage: # shell.example do |sh| # sh.run "ls" # end - def example + sig { params(blk: T.proc.params(example: ExampleBlock).void).returns(String) } + def example(&blk) example = ExampleBlock.new(self) yield(example) '
' + example.transcript + '
' @@ -26,26 +32,31 @@ def example private class ExampleBlock + extend T::Sig + sig { returns(String) } attr_reader :transcript + sig { params(session: ShellSession).void } def initialize(session) @session = session - @transcript = +'' + @transcript = T.let(+'', String) end + sig { returns(String) } def blank_line @transcript << '
' end + sig { params(command: String).void } def run(command) - output = nil - Dir.chdir @session.working_dir do - output = `#{command} 2>&1` + output = Dir.chdir @session.working_dir do + command_output = `#{command} 2>&1` unless $?.success? error_msg = +"Command `#{command}` failed with status #{$?}." - error_msg << " The output was:\n#{output}" unless output.strip.empty? + error_msg << " The output was:\n#{command_output}" unless command_output.strip.empty? raise error_msg end + command_output end prompt_html = CGI.escapeHTML(@session.prompt) diff --git a/lib/exercise_completion_status_generator.rb b/lib/exercise_completion_status_generator.rb index f4766758c..fe9e697e5 100644 --- a/lib/exercise_completion_status_generator.rb +++ b/lib/exercise_completion_status_generator.rb @@ -1,7 +1,12 @@ +# typed: strict # frozen_string_literal: true # Generates a progress percentage [0..100] telling how much a user has completed of a course's exercises. class ExerciseCompletionStatusGenerator + extend T::Sig + + # Maps exercise id to percentage, or nil for exercises with no points or not attempted. + sig { params(user: User, course: Course).returns(T::Hash[Integer, T.nilable(Integer)]) } def self.completion_status(user, course) return {} if course.hide_submission_results? awarded_points = user.awarded_points.where(course_id: course.id).pluck(:name) @@ -12,7 +17,7 @@ def self.completion_status(user, course) processed: true ).pluck(:exercise_name) - completion_status = all_exercises.each_with_object({}) do |exercise, map| + completion_status = all_exercises.each_with_object(T.let({}, T::Hash[Integer, T.nilable(Integer)])) do |exercise, map| points_of_exercise = exercise.available_points.map(&:name) attempted = attempted_exercise_names.include?(exercise.name) map[exercise.id] = completion_status_of_exercise(points_of_exercise, awarded_points, attempted) @@ -23,12 +28,14 @@ def self.completion_status(user, course) end private + sig { params(required_points: T::Array[String], awarded_points: T::Array[String], attempted: T::Boolean).returns(T.nilable(Integer)) } def self.completion_status_of_exercise(required_points, awarded_points, attempted) return nil if required_points.empty? return nil if required_points == (required_points - awarded_points) && !attempted percentage_of_completed_exercises(required_points - awarded_points, required_points) end + sig { params(not_awarded: T::Array[String], required: T::Array[String]).returns(Integer) } def self.percentage_of_completed_exercises(not_awarded, required) return 100 if not_awarded.empty? (100 * (required.size - not_awarded.size)) / required.size diff --git a/lib/file_tree_hasher.rb b/lib/file_tree_hasher.rb index 70130ea7b..021a553c6 100644 --- a/lib/file_tree_hasher.rb +++ b/lib/file_tree_hasher.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'find' @@ -9,6 +10,8 @@ # # The has depends on the files' paths as well as contents. class FileTreeHasher + extend T::Sig + sig { params(root_path: T.any(String, Pathname)).returns(String) } def self.hash_file_tree(root_path) paths = [] root_path = File.expand_path(root_path) diff --git a/lib/kafka_updater.rb b/lib/kafka_updater.rb index 94459f26a..a0bf48ea9 100644 --- a/lib/kafka_updater.rb +++ b/lib/kafka_updater.rb @@ -1,19 +1,26 @@ +# typed: strict # frozen_string_literal: true require 'rest-client' class KafkaUpdater + extend T::Sig + + # Arguments are site settings, nil when unset; the tasks only call the updaters when all are present. + sig { params(kafka_bridge_url: T.nilable(String), kafka_bridge_secret: T.nilable(String), service_id: T.nilable(String)).void } def initialize(kafka_bridge_url, kafka_bridge_secret, service_id) @kafka_bridge_url = kafka_bridge_url @kafka_bridge_secret = kafka_bridge_secret @service_id = service_id end + sig { params(task: KafkaBatchUpdatePoints).returns(String) } def task_type(task) return task.task_type if task.task_type.present? 'unknown' end + sig { params(task: KafkaBatchUpdatePoints).returns(T::Boolean) } def update_user_progress(task) finished_successfully = false user = User.find_by(id: task.user_id) @@ -21,7 +28,7 @@ def update_user_progress(task) Rails.logger.warn("KafkaUpdater#update_user_progress: missing user id=#{task.user_id} task_id=#{task.id}") return true end - course = Course.find(task.course_id) + course = Course.find_by!(id: task.course_id) Rails.logger.info("Publishing progress for user #{user.id} with moocfi id: #{course.moocfi_id}.") if !course.moocfi_id || course.moocfi_id.blank? Rails.logger.error('Cannot publish progress because moocfi id is not specified') @@ -30,11 +37,12 @@ def update_user_progress(task) parts = course.gdocs_sheets points_per_user = AwardedPoint.count_per_user_in_course_with_sheet(course, parts, user) available_points = AvailablePoint.course_sheet_points(course, parts) - unless points_per_user[user.username] + user_points = points_per_user[user.username] + unless user_points Rails.logger.info('No points found. Skipping') return true end - progress = points_per_user[user.username].map do |group_name, awarded_points| + progress = user_points.map do |group_name, awarded_points| max_points = available_points[group_name] || 0 stupid_name = "osa#{group_name.tr('^0-9', '').rjust(2, "0")}" { @@ -59,9 +67,10 @@ def update_user_progress(task) finished_successfully end + sig { params(task: KafkaBatchUpdatePoints).returns(T::Boolean) } def update_course_progress(task) finished_successfully = false - course = Course.find(task.course_id) + course = Course.find_by!(id: task.course_id) Rails.logger.info("Batch publishing progress for course #{course.name} with moocfi id: #{course.moocfi_id}.") if !course.moocfi_id Rails.logger.error('Cannot publish progress because moocfi id is not specified') @@ -104,6 +113,7 @@ def update_course_progress(task) finished_successfully end + sig { params(task: KafkaBatchUpdatePoints).returns(T::Boolean) } def update_user_points(task) finished_successfully = false user = User.find_by(id: task.user_id) @@ -111,14 +121,14 @@ def update_user_points(task) Rails.logger.warn("KafkaUpdater#update_user_points: missing user id=#{task.user_id} task_id=#{task.id}") return true end - course = Course.find(task.course_id) + course = Course.find_by!(id: task.course_id) Rails.logger.info("Publishing points for user #{user.id} with moocfi id: #{course.moocfi_id}.") if !course.moocfi_id Rails.logger.error('Cannot publish points because moocfi id is not specified. Removing extra task (this task never should have been created.)') task.destroy! return finished_successfully end - exercise = Exercise.find(task.exercise_id) + exercise = Exercise.find_by!(id: task.exercise_id) awarded_points = exercise.points_for(user) completed = exercise.completed_by?(user) message = { @@ -140,9 +150,10 @@ def update_user_points(task) finished_successfully end + sig { params(task: KafkaBatchUpdatePoints).returns(T::Boolean) } def update_course_points(task) finished_successfully = false - course = Course.find(task.course_id) + course = Course.find_by!(id: task.course_id) Rails.logger.info("Batch publishing points for course #{course.name} with moocfi id: #{course.moocfi_id}") if !course.moocfi_id Rails.logger.error('Cannot publish points because moocfi id is not specified') @@ -196,9 +207,10 @@ def update_course_points(task) finished_successfully end + sig { params(task: KafkaBatchUpdatePoints).returns(T::Boolean) } def update_exercises(task) finished_successfully = false - course = Course.find(task.course_id) + course = Course.find_by!(id: task.course_id) Rails.logger.info("Batch publishing exercises for course #{course.name} with moocfi id: #{course.moocfi_id}.") if !course.moocfi_id Rails.logger.error('Cannot publish exercises because moocfi id is not specified') @@ -207,7 +219,8 @@ def update_exercises(task) exercises = Exercise.where(course_id: course.id).where(disabled_status: 0) data = exercises.map do |exercise| max_points = AvailablePoint.where(exercise_id: exercise.id).count - stupid_name = "osa#{exercise.gdocs_sheet.tr('^0-9', '').rjust(2, "0")}" + # Exercises with hidden points have no gdocs_sheet, so this raises and fails the whole task. + stupid_name = "osa#{T.must(exercise.gdocs_sheet).tr('^0-9', '').rjust(2, "0")}" exerciseData = { name: exercise.name, id: exercise.id.to_s, @@ -230,6 +243,7 @@ def update_exercises(task) finished_successfully end + sig { params(task: KafkaBatchUpdatePoints).returns(T::Boolean) } def update_user_course_points(task) finished_successfully = false user = User.find_by(id: task.user_id) @@ -237,7 +251,7 @@ def update_user_course_points(task) Rails.logger.warn("KafkaUpdater#update_user_course_points: missing user id=#{task.user_id} task_id=#{task.id}") return true end - course = Course.find(task.course_id) + course = Course.find_by!(id: task.course_id) Rails.logger.info("Publishing points for user #{user.id} with moocfi id: #{course.moocfi_id}.") if !course.moocfi_id Rails.logger.error('Cannot publish points because moocfi id is not specified') @@ -280,6 +294,7 @@ def update_user_course_points(task) end private + sig { params(topic: String, payload: T::Hash[Symbol, T.untyped]).returns(T.nilable(RestClient::Response)) } def make_kafka_request(topic, payload) return if @kafka_bridge_url == 'test' diff --git a/lib/natsort.rb b/lib/natsort.rb index 0a4e8b568..c88bf70db 100644 --- a/lib/natsort.rb +++ b/lib/natsort.rb @@ -1,20 +1,24 @@ +# typed: strict # frozen_string_literal: true require 'natcmp' # Adds natsort methods to Ruby arrays and similar collections. +# Sigs live in sorbet/rbi/shims/lib_natsort.rbi: an inline sig can't name Enumerable's Elem at runtime. module Enumerable def natsort sort { |a, b| Natcmp.natcmp(a, b) } end - def natsort! - sort! { |a, b| Natcmp.natcmp(a, b) } - end - def natsort_by sort { |a, b| Natcmp.natcmp(yield(a), yield(b)) } end +end + +class Array + def natsort! + sort! { |a, b| Natcmp.natcmp(a, b) } + end def natsort_by! sort! { |a, b| Natcmp.natcmp(yield(a), yield(b)) } diff --git a/lib/point_comparison.rb b/lib/point_comparison.rb index 5a0807c6b..d17219910 100644 --- a/lib/point_comparison.rb +++ b/lib/point_comparison.rb @@ -1,19 +1,25 @@ +# typed: strict # frozen_string_literal: true require 'natcmp' # Provides an ordering for AvailablePoint and AwardedPoint based on natcmp'ing their names. module PointComparison + extend T::Sig extend Comparable + sig { params(other: T.any(AvailablePoint, AwardedPoint)).returns(Integer) } def <=>(other) + T.bind(self, T.any(AvailablePoint, AwardedPoint)) Natcmp.natcmp(name, other.name) end + sig { params(a: String, b: String).returns(Integer) } def self.compare_point_names(a, b) Natcmp.natcmp(a, b) end + sig { params(point_names: T::Array[String]).returns(T::Array[String]) } def self.sort_point_names(point_names) point_names.sort { |a, b| compare_point_names(a, b) } end diff --git a/lib/ruby_init_script.rb b/lib/ruby_init_script.rb index 1dcd66473..ef276f55c 100644 --- a/lib/ruby_init_script.rb +++ b/lib/ruby_init_script.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'shellwords' @@ -8,16 +9,21 @@ # Manages a sysv init script that calls a Ruby program that accepts the standard start|stop|restart|status parameters. # Compatible with RVM. class RubyInitScript + extend T::Sig + + sig { params(options: T::Hash[Symbol, T.untyped]).void } def initialize(options = {}) - @options = default_options.merge(options) + @rvm_info = T.let(nil, T.untyped) + @options = T.let(default_options.merge(options), T::Hash[Symbol, T.untyped]) preprocess_options check_options end + sig { returns(T::Hash[Symbol, T.untyped]) } def default_options { name: nil, - erb_path: __dir__ + '/ruby_init_script/initscript.erb', + erb_path: File.expand_path('ruby_init_script/initscript.erb', __dir__), rails_env: 'production', working_dir: ::Rails.root, executable_path: nil, @@ -26,6 +32,7 @@ def default_options } end + sig { returns(String) } def script_source # TODO: This breaks if rvm is not installed rvm_current = `rvm current` @@ -37,15 +44,11 @@ def script_source else puts "Not using RVM. Don't forget to invoke this with rvmsudo if you use RVM." ruby_path = `which ruby`.chomp - env = {} + env = T.let({}, T::Hash[String, String]) end env['RAILS_ENV'] = @options[:rails_env] if @options[:rails_env] - def get_binding(_name, _working_dir, _executable_path, _ruby_path, _user, _env) - binding - end - erb = ERB.new(File.read(@options[:erb_path])) b = get_binding( @@ -60,6 +63,7 @@ def get_binding(_name, _working_dir, _executable_path, _ruby_path, _user, _env) erb.result(b) end + sig { void } def install script = script_source @@ -71,6 +75,7 @@ def install system("update-rc.d #{init_script_full_name} defaults 90 10") end + sig { void } def uninstall system("update-rc.d -f #{init_script_full_name} remove") if File.exist?(init_script_path) @@ -80,25 +85,45 @@ def uninstall end end + sig { returns(String) } def init_script_full_name @options[:name] end + sig { returns(String) } def init_script_path "/etc/init.d/#{init_script_full_name}" end + sig { returns(String) } def short_description @options[:short_description] || init_script_full_name end private + # Binding for the init script template, which reads these locals. + sig do + params( + _name: String, + _working_dir: String, + _executable_path: String, + _ruby_path: String, + _user: String, + _env: T::Hash[String, String] + ).returns(Binding) + end + def get_binding(_name, _working_dir, _executable_path, _ruby_path, _user, _env) + binding + end + + sig { void } def preprocess_options @options.each_key do |k| @options[k] = @options[k].to_s if @options[k].is_a? Pathname end end + sig { void } def check_options raise ':name required' unless @options[:name] raise ':erb_path required' unless @options[:erb_path] @@ -106,6 +131,8 @@ def check_options raise ':executable_path required' unless @options[:executable_path] end + # Parsed `rvm info` YAML, keyed by ruby name. + sig { returns(T.untyped) } def rvm_info @rvm_info ||= begin output = `rvm info 2>/dev/null` # We silence the "RVM is not a function" warning on stderr. diff --git a/lib/rust_langs_cli_executor.rb b/lib/rust_langs_cli_executor.rb index e3e5c84c8..8d0443d8a 100644 --- a/lib/rust_langs_cli_executor.rb +++ b/lib/rust_langs_cli_executor.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'fileutils' @@ -5,6 +6,18 @@ # If you want to change the TMC Langs Rust version, see app/background_tasks/rust_langs_downloader_task.rb module RustLangsCliExecutor + extend T::Sig + + # Returns the last JSON line tmc-langs printed. + sig do + params( + clone_path: String, + output_path: String, + submission_path: String, + extra_params: T::Hash[T.untyped, T.untyped], + config: T::Hash[Symbol, T.untyped] + ).returns(T.untyped) + end def self.prepare_submission(clone_path, output_path, submission_path, extra_params = {}, config = {}) command = "#{self.langs_executable_path}/current prepare-submission --clone-path '#{clone_path}' --output-path '#{output_path}' --submission-path '#{submission_path}'" command = command + ' --no-archive-prefix' if config[:no_archive_prefix] @@ -26,8 +39,10 @@ def self.prepare_submission(clone_path, output_path, submission_path, extra_para result end + # Returns the data of tmc-langs' last output line, or nil if it printed a non-JSON line. + sig { params(course_template_refresh_task: CourseTemplateRefresh).returns(T.untyped) } def self.refresh(course_template_refresh_task) - course_template = course_template_refresh_task.course_template + course_template = T.must(course_template_refresh_task.course_template) command = "#{self.langs_executable_path}/current refresh-course"\ " --cache-path #{course_template.cache_path}"\ " --cache-root #{Course.cache_root}"\ @@ -36,7 +51,7 @@ def self.refresh(course_template_refresh_task) " --source-url #{course_template.source_url}" Rails.logger.info(command) - @course_refresh = course_template_refresh_task + parsed_data = T.let(nil, T.untyped) Open3.popen2(command) do |stdin, stdout, status_thread| Timeout.timeout(600, Timeout::Error, 'Refresh process took more than 10 minutes...') do @@ -45,11 +60,11 @@ def self.refresh(course_template_refresh_task) data = parse_as_JSON(line) return unless data - @parsed_data = self.process_refresh_command_output(data) + parsed_data = self.process_refresh_command_output(data) if data['output-kind'] == 'status-update' - ActionCable.server.broadcast("CourseTemplateRefreshChannel-#{course_template.id}", @parsed_data) unless @parsed_data[:percent_done] == 1.0 - @course_refresh.percent_done = @parsed_data[:percent_done] - @course_refresh.create_phase(@parsed_data[:message], @parsed_data[:time]) + ActionCable.server.broadcast("CourseTemplateRefreshChannel-#{course_template.id}", parsed_data) unless parsed_data[:percent_done] == 1.0 + course_template_refresh_task.percent_done = parsed_data[:percent_done] + course_template_refresh_task.create_phase(parsed_data[:message], parsed_data[:time]) end end end @@ -58,22 +73,25 @@ def self.refresh(course_template_refresh_task) status_thread.kill raise e end - @course_refresh.percent_done = 0.95 - @course_refresh.save! - @parsed_data + course_template_refresh_task.percent_done = BigDecimal('0.95') + course_template_refresh_task.save! + parsed_data end private + sig { params(output: String).returns(T.untyped) } def self.parse_as_JSON(output) JSON.parse output rescue StandardError => e Rails.logger.info("Could not parse output line. #{e}") end + sig { returns(String) } def self.langs_executable_path Pathname.new("#{::Rails.root}/vendor/tmc-langs-rust").relative_path_from(Pathname.new(Dir.pwd)).to_s end + sig { params(command_output: String).returns(T.untyped) } def self.process_prepare_submission_command_output(command_output) output_lines = command_output.split("\n") valid_lines = output_lines.map do |line| @@ -93,6 +111,7 @@ def self.process_prepare_submission_command_output(command_output) last_line end + sig { params(command_output: T.untyped).returns(T.untyped) } def self.process_refresh_command_output(command_output) data = command_output['data'] if command_output['status'] == 'crashed' diff --git a/lib/safe_unzipper.rb b/lib/safe_unzipper.rb index 9f18caefc..278beeac2 100644 --- a/lib/safe_unzipper.rb +++ b/lib/safe_unzipper.rb @@ -1,8 +1,11 @@ +# typed: strict # frozen_string_literal: true require 'system_commands' class SafeUnzipper + extend T::Sig + sig { params(zip_path: T.any(String, Pathname), dest_dir: T.any(String, Pathname)).void } def unzip(zip_path, dest_dir) dest_dir = File.absolute_path(dest_dir) # Ideally we'd protect against `unzip` exploits too by running in a sandbox @@ -11,6 +14,7 @@ def unzip(zip_path, dest_dir) end private + sig { params(root_dir_abs: String, file: String).void } def clean_up(root_dir_abs, file) if File.symlink?(file) dest = File.absolute_path(File.readlink(file), File.dirname(file)) diff --git a/lib/sandbox_results_saver.rb b/lib/sandbox_results_saver.rb index 1b978f829..3a29247c0 100644 --- a/lib/sandbox_results_saver.rb +++ b/lib/sandbox_results_saver.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true # Saves results from a remote sandbox to the database. @@ -6,8 +7,12 @@ require 'test_run_grader' module SandboxResultsSaver + extend T::Sig + class InvalidTokenError < RuntimeError; end + # results: the sandbox's reply fields, keyed by name. + sig { params(submission: Submission, results: T::Hash[String, T.untyped]).void } def self.save_results(submission, results) ActiveRecord::Base.transaction do raise InvalidTokenError, 'Invalid or expired token' if results['token'] != submission.secret_token @@ -42,7 +47,7 @@ def self.save_results(submission, results) 'Running the submission failed. Exit code: ' + results['exit_code'] + ' (did you use an exit() command?)' end # Move to tmc-langs-rust - if submission.stdout.include?('Temporary failure in name resolution: Unknown host maven.mooc.fi') + if submission.stdout&.include?('Temporary failure in name resolution: Unknown host maven.mooc.fi') submission.pretest_error = "Unable to run tests because this course's teacher has not configured this exercise template correctly.\nPlease contact your teacher so that they can fix the template and rerun your submission.\nIf your solution is correct, you'll get the points from this exercise once the teacher reruns your submission." end when 'finished' @@ -54,12 +59,13 @@ def self.save_results(submission, results) submission.secret_token = nil submission.processed = true - submission.processing_completed_at = Time.now + submission.processing_completed_at = Time.zone.now submission.save! end end private + sig { params(submission: Submission, test_output: T.untyped).void } def self.handle_tmc_langs_output(submission, test_output) if test_output.key? 'logs' if test_output['logs'].key? 'stdout' @@ -87,6 +93,8 @@ def self.handle_tmc_langs_output(submission, test_output) end end + # Returns the decoded tmc-langs run result, or an error message string if it can't be decoded. + sig { params(test_output: T.untyped).returns(T.untyped) } def self.decode_test_output(test_output) if test_output.blank? return 'Missing test output. Did you terminate your program with an exit() command? Also make sure your program did not run out of memory. For example excessive printing (thousands of lines) may cause this.' diff --git a/lib/student_submission_migrator.rb b/lib/student_submission_migrator.rb index 5754ad8ff..05f94730d 100644 --- a/lib/student_submission_migrator.rb +++ b/lib/student_submission_migrator.rb @@ -1,15 +1,19 @@ +# typed: strict # frozen_string_literal: true # Used to migrate students between similar courses. This requires for the GIT repos to be checkout to same version to ensure safe transition class StudentSubmissionMigrator + extend T::Sig class CannotRefreshError < RuntimeError; end class RefreshFailedError < CannotRefreshError; end + sig { params(old_course: Course, new_course: Course, user: User).void } def initialize(old_course, new_course, user) @old_course = old_course @new_course = new_course @user = user end + sig { void } def migrate! validate_migration! ActiveRecord::Base.transaction do @@ -22,6 +26,7 @@ def migrate! end end + sig { returns(T::Boolean) } def migration_is_allowed allowed_migrations = SiteSetting.value(:allow_migrations_between_courses) return false if allowed_migrations.nil? @@ -33,11 +38,13 @@ def migration_is_allowed end private + sig { void } def validate_migration! raise CannotRefreshError, 'Cannot migrate with courses which have diffenent git revisions' unless @old_course.git_revision == @new_course.git_revision raise CannotRefreshError, 'Migration between these courses is not allowed' unless migration_is_allowed end + sig { params(submission: Submission).void } def migrate_submission_and_data(submission) new_submission = submission.dup new_submission.course = @new_course @@ -50,15 +57,19 @@ def migrate_submission_and_data(submission) new_submission.reload new_submission.update_columns(created_at: submission.created_at, processing_attempts_started_at: submission.processing_attempts_started_at) MigratedSubmissions.create!(from_course_id: @old_course.id, to_course_id: @new_course.id, original_submission_id: submission.id, new_submission_id: new_submission.id) - Unlock.refresh_unlocks(new_submission.course, submission.user) + # Submission's belongs_to :course and :user are required. + Unlock.refresh_unlocks(T.must(new_submission.course), T.must(submission.user)) end + sig { params(submission: Submission, new_submission: Submission).void } def migrate_submission_data(submission, new_submission) - new_submission_data = submission.submission_data.dup + # Every submission is created with its return file, which lives in submission_data. + new_submission_data = T.must(submission.submission_data).dup new_submission_data.submission = new_submission new_submission_data.save! end + sig { params(submission: Submission, new_submission: Submission).void } def migrate_test_case_runs(submission, new_submission) submission.test_case_runs.each do |test_case_run| new_test_case_run = test_case_run.dup @@ -68,6 +79,7 @@ def migrate_test_case_runs(submission, new_submission) end end + sig { params(submission: Submission, new_submission: Submission).void } def migrate_awarded_points(submission, new_submission) submission.awarded_points.each do |awarded_point| new_point = awarded_point.dup @@ -78,6 +90,7 @@ def migrate_awarded_points(submission, new_submission) end end + sig { void } def update_app_data allowed_migrations = SiteSetting.value(:allow_migrations_between_courses) return if allowed_migrations.nil? diff --git a/lib/submission_list.rb b/lib/submission_list.rb index af4b581e8..9a396bbc8 100644 --- a/lib/submission_list.rb +++ b/lib/submission_list.rb @@ -1,15 +1,21 @@ +# typed: strict # frozen_string_literal: true class SubmissionList + extend T::Sig + + sig { params(user: User, helpers: ActionView::Base).void } def initialize(user, helpers) @user = user @helpers = helpers end + sig { params(submissions: T::Enumerable[Submission]).returns(T::Array[T::Hash[Symbol, T.untyped]]) } def submission_list_data(submissions) submissions.map { |s| submission_data(s) } end + sig { params(submission: Submission).returns(T::Hash[Symbol, T.untyped]) } def submission_data(submission) { exercise_name: submission.exercise_name, @@ -27,7 +33,9 @@ def submission_data(submission) } end + sig { params(submission: Submission).returns(T.nilable(String)) } def paste_url(submission) - @helpers.paste_url(submission.paste_key) if submission.paste_key + paste_key = submission.paste_key + @helpers.paste_url(paste_key) if paste_key end end diff --git a/lib/submission_packager.rb b/lib/submission_packager.rb index 4011ad726..3b2534831 100644 --- a/lib/submission_packager.rb +++ b/lib/submission_packager.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'tmpdir' @@ -8,6 +9,7 @@ # Takes a submission zip and makes a tar file suitable for the sandbox class SubmissionPackager + extend T::Sig # Packages a submitted ZIP of the given exercise into a TAR or a ZIP with tests # added from the clone (to ensure they haven't been tampered with). # @@ -23,6 +25,7 @@ class SubmissionPackager # - no_tmc_run: does not include the tmc-run file # - format: may be set to :zip to get a zip file. Defaults to :tar. + sig { params(submission: T.untyped).returns(String) } def get_full_zip(submission) Dir.mktmpdir do |tmpdir| zip_path = "#{tmpdir}/submission.zip" diff --git a/lib/submission_processor.rb b/lib/submission_processor.rb index b66945d0b..6db6ff7ed 100644 --- a/lib/submission_processor.rb +++ b/lib/submission_processor.rb @@ -1,17 +1,21 @@ +# typed: strict # frozen_string_literal: true # Attempts to send submissions for processing to a free tmc-sandbox. # Also called by the reprocessor background task to attempt reprocessing if # the sandbox was previously unavailable. class SubmissionProcessor + extend T::Sig + # Tries to send the submission to a sandbox and updates its status. # If not sandboxes are available, then the submission is left to the reprocessor daemon. + sig { params(submission: Submission).void } def process_submission(submission) - submission.processing_tried_at = Time.now + submission.processing_tried_at = Time.zone.now submission.save! if RemoteSandbox.try_to_send_submission_to_free_server(submission, submission.result_url) - submission.processing_began_at = Time.now + submission.processing_began_at = Time.zone.now submission.times_sent_to_sandbox += 1 submission.save! Rails.logger.info "Submission #{submission.id} sent to sandbox." @@ -20,6 +24,7 @@ def process_submission(submission) # Called periodically by script/background_daemon. # It tries to send submissions to a sandbox + sig { void } def process_some_submissions Submission.to_be_reprocessed.limit(2).each do |submission| Rails.logger.info "Attempting to process submission #{submission.id}" diff --git a/lib/system_commands.rb b/lib/system_commands.rb index f6ac825fe..35c22f771 100644 --- a/lib/system_commands.rb +++ b/lib/system_commands.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'shellwords' @@ -7,14 +8,21 @@ # Ruby's standard methods "system" and the backtick operator are # bad at capturing output and errors. module SystemCommands + extend T::Sig + extend T::Helpers + requires_ancestor { Kernel } + module_function # Prefer sh! instead + sig { params(cmd: String).void } def system!(cmd) ok = system(cmd) raise "Command `#{cmd}` failed with status #{$?.inspect}" unless ok end + # args: command words (escaped unless escape: false), optionally ending in an options hash. + sig { params(args: T.untyped).returns({ status: Process::Status, output: String }) } def sh!(*args) options = { assert_silent: false, @@ -49,11 +57,13 @@ def sh!(*args) } end + sig { params(args: T.untyped).returns(String) } def mk_command(*args) cmd_parts = args.flatten cmd_parts.map { |arg| Shellwords.escape(arg.to_s) }.join(' ') end + sig { params(args: T.untyped).returns(String) } def make_bash_array(*args) '(' + mk_command(args) + ')' end diff --git a/lib/tailoring.rb b/lib/tailoring.rb index 3e59f353d..a2158b6d6 100644 --- a/lib/tailoring.rb +++ b/lib/tailoring.rb @@ -1,20 +1,25 @@ +# typed: strict # frozen_string_literal: true # Optionally inherited by config/site_tailoring.rb class Tailoring + extend T::Sig # If false, only show bare point names in points table + sig { returns(T::Boolean) } def show_exercise_names_in_points_table true end # Must return a string (raw or html-safe) as the title of # the given exercise in the /courses/:course_id/points view. + sig { params(exercise: Exercise).returns(T.nilable(String)) } def exercise_name_for_points_table(exercise) exercise.name end + sig { returns(Tailoring) } def self.get - @tailoring ||= begin + @tailoring ||= T.let(begin path = "#{::Rails.root}/config/site_tailoring.rb" if File.exist?(path) require path @@ -22,6 +27,6 @@ def self.get else Tailoring.new end - end + end, T.nilable(Tailoring)) end end diff --git a/lib/test_run_grader.rb b/lib/test_run_grader.rb index 0e26b6595..836cdd097 100644 --- a/lib/test_run_grader.rb +++ b/lib/test_run_grader.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require 'point_comparison' @@ -23,25 +24,33 @@ # - cause: the same exception structure again, or nil # module TestRunGrader + extend T::Sig + extend T::Helpers extend TestRunGrader + requires_ancestor { Kernel } + # results: the decoded tmc-langs run result. + sig { params(submission: Submission, results: T::Hash[String, T.untyped]).void } def grade_results(submission, results) - raise "Exercise #{submission.exercise_name} was removed" unless submission.exercise + exercise = submission.exercise + raise "Exercise #{submission.exercise_name} was removed" unless exercise + # belongs_to :user is required, so a saved submission has one. + user = T.must(submission.user) submission.test_case_runs.destroy_all - create_test_case_runs(submission, results) + TestRunGrader.create_test_case_runs(submission, exercise, results) - review_points = submission.exercise.available_points.where(requires_review: true).map(&:name) - award_points(submission, results, review_points) - UncomputedUnlock.create!(course: submission.course, user: submission.user) + review_points = exercise.available_points.where(requires_review: true).map(&:name) + TestRunGrader.award_points(submission, exercise, user, results, review_points) + UncomputedUnlock.create!(course: submission.course, user: user) # Unlock.refresh_unlocks(submission.course, submission.user) - if should_flag_for_review?(submission, review_points) + if should_flag_for_review?(submission, user, review_points) submission.requires_review = true Submission.where( course_id: submission.course_id, exercise_name: submission.exercise_name, - user_id: submission.user.id, + user_id: user.id, requires_review: true ).update_all(requires_review: false) end @@ -50,8 +59,9 @@ def grade_results(submission, results) end private - def self.create_test_case_runs(submission, results) - all_passed = true + sig { params(submission: Submission, exercise: Exercise, results: T::Hash[String, T.untyped]).void } + def self.create_test_case_runs(submission, exercise, results) + all_passed = T.let(true, T::Boolean) results['testResults'].each do |test_result| passed = test_result['successful'] tcr = TestCaseRun.new( @@ -64,9 +74,10 @@ def self.create_test_case_runs(submission, results) all_passed = false unless passed submission.test_case_runs << tcr end - submission.all_tests_passed = all_passed && validations_passed?(submission.validations) && valgrind_passed?(submission) + submission.all_tests_passed = all_passed && validations_passed?(submission.validations) && valgrind_passed?(submission, exercise) end + sig { params(validations: T.untyped).returns(T::Boolean) } def validations_passed?(validations) if !validations.nil? && validations['strategy'] && validations['strategy'] == 'FAIL' return false if validations['validationErrors']&.any? @@ -74,27 +85,36 @@ def validations_passed?(validations) true end - def valgrind_passed?(submission) - if submission.exercise.valgrind_strategy == 'fail' + sig { params(submission: Submission, exercise: Exercise).returns(T::Boolean) } + def valgrind_passed?(submission, exercise) + if exercise.valgrind_strategy == 'fail' submission.valgrind.blank? else true end end - def self.award_points(submission, results, review_points) - user = submission.user - exercise = submission.exercise - course = exercise.course + sig do + params( + submission: Submission, + exercise: Exercise, + user: User, + results: T::Hash[String, T.untyped], + review_points: T::Array[String] + ).void + end + def self.award_points(submission, exercise, user, results, review_points) + # belongs_to :course is required. + course = T.must(exercise.course) available_points = exercise.available_points.to_a.map(&:name) awarded_points = AwardedPoint.course_user_points(course, user).map(&:name) soft_deadline = exercise.soft_deadline_for(user) awarded_after_soft_deadline = false - awarded_after_soft_deadline = true if soft_deadline && Exercise.deadline_expired?(soft_deadline, submission.created_at) + awarded_after_soft_deadline = true if soft_deadline && Exercise.deadline_expired?(soft_deadline, T.must(submission.created_at)) - points = [] + points = T.let([], T::Array[String]) ((available_points & points_from_test_results(results)) - review_points).each do |point_name| - next unless validations_passed?(submission.validations) && valgrind_passed?(submission) + next unless validations_passed?(submission.validations) && valgrind_passed?(submission, exercise) points << point_name next if awarded_points.include?(point_name) submission.awarded_points << AwardedPoint.new( @@ -111,8 +131,9 @@ def self.award_points(submission, results, review_points) submission.points = points.uniq.natsort.join(' ') unless points.empty? end + sig { params(results: T::Hash[String, T.untyped]).returns(T::Array[String]) } def self.points_from_test_results(results) - point_status = {} # point -> true / false / nil i.e. ok so far / failed / unseen + point_status = T.let({}, T::Hash[String, T.nilable(T::Boolean)]) # point -> true / false / nil i.e. ok so far / failed / unseen results['testResults'].each do |result| result['points'].each do |name| unless point_status[name].eql?(false) # skip if already failed @@ -125,13 +146,15 @@ def self.points_from_test_results(results) PointComparison.sort_point_names(point_names) end + sig { params(obj: T.untyped).returns(T.nilable(String)) } def self.to_json_or_null(obj) ActiveSupport::JSON.encode(obj) unless obj.nil? end - def should_flag_for_review?(submission, review_points) + sig { params(submission: Submission, user: User, review_points: T::Array[String]).returns(T::Boolean) } + def should_flag_for_review?(submission, user, review_points) return false if submission.requests_review - awarded_points = submission.user.awarded_points.where(course_id: submission.course.id).map(&:name) + awarded_points = user.awarded_points.where(course_id: submission.course_id).map(&:name) !(review_points - awarded_points).empty? end end diff --git a/lib/tmc_dir_utils.rb b/lib/tmc_dir_utils.rb index 6a70f2ae7..78fe62ec3 100644 --- a/lib/tmc_dir_utils.rb +++ b/lib/tmc_dir_utils.rb @@ -1,11 +1,17 @@ +# typed: strict # frozen_string_literal: true require 'pathname' require 'find' module TmcDirUtils + extend T::Sig + extend T::Helpers + requires_ancestor { Kernel } + extend TmcDirUtils + sig { params(root: T.any(String, Pathname), to_find: String).returns(T.nilable(Pathname)) } def find_dir_containing(root, to_find) Pathname(root).find do |path| next unless path.directory? diff --git a/lib/twitter_bootstrap_breadcrumbs.rb b/lib/twitter_bootstrap_breadcrumbs.rb index 1953579d5..6b68645f4 100644 --- a/lib/twitter_bootstrap_breadcrumbs.rb +++ b/lib/twitter_bootstrap_breadcrumbs.rb @@ -1,39 +1,47 @@ +# typed: strict # frozen_string_literal: true module BreadCrumbs - def self.included(base) - base.extend(ClassMethods) - end + extend T::Sig + extend T::Helpers + requires_ancestor { ActionController::Base } module ClassMethods + extend T::Sig + extend T::Helpers + requires_ancestor { T.class_of(ActionController::Base) } + + # options: before_action options such as only:. + sig { params(name: T.nilable(T.any(String, Symbol)), url: T.any(String, Symbol, Proc), options: T::Hash[Symbol, T.untyped]).void } def add_breadcrumb(name, url, options = {}) class_name = self.name before_action options do |controller| - name = controller.send :translate_breadcrumb, name, class_name if name.is_a?(Symbol) - controller.send :add_breadcrumb, name, url + crumb_name = name.is_a?(Symbol) ? controller.send(:translate_breadcrumb, name, class_name) : name + controller.send :add_breadcrumb, crumb_name, url end end end + mixes_in_class_methods(ClassMethods) + protected + # A Symbol name is an I18n key under breadcrumbs.; a url that mentions a + # route helper or ivar is evaluated in the controller. + sig { params(name: T.nilable(T.any(String, Symbol)), url: T.any(String, Symbol, Proc), options: T::Hash[Symbol, T.untyped]).void } def add_breadcrumb(name, url = '', options = {}) - @breadcrumbs ||= [] - name = translate_breadcrumb(name, self.class.name) if name.is_a?(Symbol) + breadcrumbs = @breadcrumbs ||= T.let([], T.nilable(T::Array[T::Hash[Symbol, T.untyped]])) + name = translate_breadcrumb(name, T.must(self.class.name)) if name.is_a?(Symbol) url = eval(url.to_s) if url.class != Proc && url =~ /_path|_url|@/ # rubocop:disable Performance/RegexpMatch - @breadcrumbs << { name: name, url: url, options: options } + breadcrumbs << { name: name, url: url, options: options } end + sig { params(name: Symbol, class_name: String).returns(String) } def translate_breadcrumb(name, class_name) scope = [:breadcrumbs] namespace = class_name.underscore.split('/') - namespace.last.sub!('_controller', '') + T.must(namespace.last).sub!('_controller', '') scope += namespace I18n.t name, scope: scope end - - def render_breadcrumbs(divider = '/') - s = render partial: 'twitter-bootstrap/breadcrumbs', locals: { divider: divider } - s.first - end end diff --git a/lib/version.rb b/lib/version.rb index a2929daab..eddc540d9 100644 --- a/lib/version.rb +++ b/lib/version.rb @@ -1,30 +1,36 @@ +# typed: strict # frozen_string_literal: true # Represents a version number (e.g. 1.30.5). # # Provides a comparison operator that handles e.g. '1.21.0 > 1.3.5'. class Version + extend T::Sig include Comparable + sig { params(version: T.untyped).void } def initialize(version) if version.is_a?(String) - @parts = version.split('.').map(&:to_i) + @parts = T.let(version.split('.').map(&:to_i), T::Array[Numeric]) elsif version.is_a?(Numeric) - @parts = [version] + @parts = T.let([version], T::Array[Numeric]) else raise "Invalid version number: #{version.inspect}" end end + sig { returns(T::Array[Numeric]) } attr_reader :parts + sig { params(other: T.untyped).returns(Integer) } def <=>(other) if other.is_a?(Version) p1 = parts.clone p2 = other.parts.clone p1 << 0 while p1.length < p2.length p2 << 0 while p2.length < p1.length - p1.zip(p2).each do |n1, n2| + p1.each_with_index do |n1, i| + n2 = p2.fetch(i) if n1 < n2 return -1 elsif n1 > n2 @@ -37,6 +43,7 @@ def <=>(other) end end + sig { returns(String) } def to_s parts.join('.') end diff --git a/script/passenger_worker_cleaner.rb b/script/passenger_worker_cleaner.rb index e34f793e0..fc98a3860 100755 --- a/script/passenger_worker_cleaner.rb +++ b/script/passenger_worker_cleaner.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# typed: false # frozen_string_literal: true require 'open3' diff --git a/sorbet/config b/sorbet/config new file mode 100644 index 000000000..c4575bdaf --- /dev/null +++ b/sorbet/config @@ -0,0 +1,18 @@ +--dir +. +--ignore=/vendor/ +--ignore=/tmp/ +--ignore=/coverage/ +--ignore=/log/ +--ignore=/node_modules/ +--ignore=/ext/ +--ignore=/public/ +--ignore=/storage/ +--ignore=/.direnv/ +--ignore=/.git/ +--parser=prism +--suppress-payload-superclass-redefinition-for=RDoc::Markup::Heading +--ignore=/db/migrate/ +--ignore=/db/schema.rb +--ignore=/config/extra_fields/ +--enable-experimental-requires-ancestor diff --git a/sorbet/rbi/annotations/.gitattributes b/sorbet/rbi/annotations/.gitattributes new file mode 100644 index 000000000..d2eacd2c6 --- /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 000000000..4b4d708ba --- /dev/null +++ b/sorbet/rbi/annotations/actionmailer.rbi @@ -0,0 +1,15 @@ +# 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 + +module ActionMailer::TestHelper + sig { params(block: T.proc.void).returns(T::Array[Mail::Message]) } + def capture_emails(&block); end +end diff --git a/sorbet/rbi/annotations/actionpack.rbi b/sorbet/rbi/annotations/actionpack.rbi new file mode 100644 index 000000000..4af55bf58 --- /dev/null +++ b/sorbet/rbi/annotations/actionpack.rbi @@ -0,0 +1,452 @@ +# 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 + +# @version >= 5.2.0 +module ActionController::ContentSecurityPolicy::ClassMethods + # @shim: required to declare T.attached_class + extend T::Generic + + has_attached_class! :out + + sig { params(enabled: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(policy: ActionDispatch::ContentSecurityPolicy).void)).void } + def content_security_policy(enabled = true, **options, &block); end +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, block: T.nilable(T.proc.params(key: T.any(String, Symbol)).returns(T.untyped))).returns(T.untyped) } + def fetch(key, *args, &block); 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 { params(block: T.nilable(T.proc.params(value: T.untyped).returns(T.untyped))).returns(ActionController::Parameters) } + def transform_values!(&block); end + + sig { params(block: T.nilable(T.proc.params(value: T.untyped).returns(T.untyped))).returns(ActionController::Parameters) } + def transform_values(&block); 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 + +# @version >= 6.1.0 +module ActionController::PermissionsPolicy::ClassMethods + # @shim: required to declare T.attached_class + extend T::Generic + + has_attached_class! :out + + sig { params(options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(policy: ActionDispatch::PermissionsPolicy).void)).void } + def permissions_policy(**options, &block); 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 000000000..9c939f032 --- /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 000000000..ae939e7d9 --- /dev/null +++ b/sorbet/rbi/annotations/activejob.rbi @@ -0,0 +1,62 @@ +# 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 + +module ActiveJob::TestHelper + sig { params(number: Integer, only: T.untyped, except: T.untyped, queue: T.nilable(T.any(String, Symbol)), block: T.nilable(T.proc.void)).returns(TrueClass) } + def assert_enqueued_jobs(number, only: nil, except: nil, queue: nil, &block); end + + sig { params(only: T.untyped, except: T.untyped, queue: T.nilable(T.any(String, Symbol)), block: T.nilable(T.proc.void)).returns(TrueClass) } + def assert_no_enqueued_jobs(only: nil, except: nil, queue: nil, &block); end + + sig { params(number: Integer, only: T.untyped, except: T.untyped, queue: T.nilable(T.any(String, Symbol)), block: T.nilable(T.proc.void)).returns(TrueClass) } + def assert_performed_jobs(number, only: nil, except: nil, queue: nil, &block); end + + sig { params(only: T.untyped, except: T.untyped, queue: T.nilable(T.any(String, Symbol)), block: T.nilable(T.proc.void)).returns(TrueClass) } + def assert_no_performed_jobs(only: nil, except: nil, queue: nil, &block); end + + sig { params(only: T.untyped, except: T.untyped, queue: T.nilable(T.any(String, Symbol)), at: T.untyped).returns(Integer) } + sig { type_parameters(:Block).params(only: T.untyped, except: T.untyped, queue: T.nilable(T.any(String, Symbol)), at: T.untyped, block: T.proc.returns(T.type_parameter(:Block))).returns(T.type_parameter(:Block)) } + def perform_enqueued_jobs(only: nil, except: nil, queue: nil, at: nil, &block); end +end diff --git a/sorbet/rbi/annotations/activemodel.rbi b/sorbet/rbi/annotations/activemodel.rbi new file mode 100644 index 000000000..90efab49a --- /dev/null +++ b/sorbet/rbi/annotations/activemodel.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 ActiveModel::Attributes + sig { returns(T::Array[String]) } + def attribute_names; end + + sig { returns(T::Hash[String, T.untyped]) } + def attributes; end +end + +module ActiveModel::Attributes::ClassMethods + sig { returns(T::Array[String]) } + def attribute_names; end +end + +module ActiveModel::Dirty + sig { returns(T::Array[String]) } + def changed; end + + sig { returns(T::Boolean) } + def changed?; end + + sig { returns(ActiveSupport::HashWithIndifferentAccess) } + def changed_attributes; end + + sig { returns(ActiveSupport::HashWithIndifferentAccess) } + def changes; end + + sig { returns(ActiveSupport::HashWithIndifferentAccess) } + def previous_changes; end +end + +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 000000000..ea44fd37c --- /dev/null +++ b/sorbet/rbi/annotations/activerecord.rbi @@ -0,0 +1,151 @@ +# 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 ActiveRecord::AttributeMethods::ClassMethods + sig { returns(T::Array[String]) } + def attribute_names; end +end + +module ActiveRecord::AttributeMethods::Dirty + sig { returns(ActiveSupport::HashWithIndifferentAccess) } + def attributes_in_database; end + + sig { returns(T::Array[String]) } + def changed_attribute_names_to_save; end + + sig { returns(ActiveSupport::HashWithIndifferentAccess) } + def changes_to_save; end + + sig { returns(T::Boolean) } + def has_changes_to_save?; end + + sig { returns(ActiveSupport::HashWithIndifferentAccess) } + def saved_changes; end + + sig { returns(T::Boolean) } + def saved_changes?; end +end + +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 + +module ActiveRecord::Persistence + sig { type_parameters(:Klass).params(klass: T::Class[T.type_parameter(:Klass)]).returns(T.type_parameter(:Klass)) } + def becomes(klass); end + + sig { type_parameters(:Klass).params(klass: T::Class[T.type_parameter(:Klass)]).returns(T.type_parameter(:Klass)) } + def becomes!(klass); end + + sig { returns(T::Boolean) } + def destroyed?; end + + sig { returns(T::Boolean) } + def new_record?; end + + sig { returns(T::Boolean) } + def persisted?; end + + sig { returns(T::Boolean) } + def previously_new_record?; end + + sig { returns(T::Boolean) } + def previously_persisted?; end +end diff --git a/sorbet/rbi/annotations/activesupport.rbi b/sorbet/rbi/annotations/activesupport.rbi new file mode 100644 index 000000000..2b56fb6b3 --- /dev/null +++ b/sorbet/rbi/annotations/activesupport.rbi @@ -0,0 +1,558 @@ +# 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 + +module ActiveSupport::Concern + sig { params(base: T.untyped, block: T.nilable(T.proc.bind(T.untyped).void)).void } + def included(base = nil, &block); end + + # @version >= 6.1.0 + sig { params(base: T.untyped, block: T.nilable(T.proc.bind(T.untyped).void)).void } + def prepended(base = nil, &block); end + + # @version >= 4.2.0 + sig { params(class_methods_module_definition: T.nilable(T.proc.bind(T.untyped).void)).void } + def class_methods(&class_methods_module_definition); 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 local?; end +end + +class ActiveSupport::HashWithIndifferentAccess < Hash + K = type_member { {fixed: T.any(String, Symbol)} } + V = type_member { {fixed: T.untyped} } + Elem = type_member { {fixed: T.untyped} } + + sig { returns(ActiveSupport::HashWithIndifferentAccess) } + def with_indifferent_access; end + + sig { type_parameters(:V2, :ConflictRes).params(other_hash: T::Hash[T.untyped, T.type_parameter(:V2)], block: T.nilable( + T.proc.params( + key: String, + old_val: T.untyped, + new_val: T.type_parameter(:V2), + ).returns(T.type_parameter(:ConflictRes)) + )).returns(ActiveSupport::HashWithIndifferentAccess) } + def deep_merge(other_hash, &block); end + + sig { type_parameters(:V2, :ConflictRes).params(other_hash: T::Hash[T.untyped, T.type_parameter(:V2)], block: T.nilable( + T.proc.params( + key: String, + old_val: T.untyped, + new_val: T.type_parameter(:V2), + ).returns(T.type_parameter(:ConflictRes)) + )).returns(ActiveSupport::HashWithIndifferentAccess) } + def deep_merge!(other_hash, &block); 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 + + sig { returns(ActiveSupport::HashWithIndifferentAccess) } + def with_indifferent_access; end + + sig { type_parameters(:K2, :V2, :ConflictRes).params(other_hash: T::Hash[T.type_parameter(:K2), T.type_parameter(:V2)], block: T.nilable( + T.proc.params( + key: T.any(K, T.type_parameter(:K2)), + old_val: V, + new_val: T.type_parameter(:V2), + ).returns(T.type_parameter(:ConflictRes)) + )).returns(T::Hash[T.any(K, T.type_parameter(:K2)), T.any(V, T.type_parameter(:V2), T.type_parameter(:ConflictRes))]) } + def deep_merge(other_hash, &block); end + + sig { type_parameters(:K2, :V2, :ConflictRes).params(other_hash: T::Hash[T.type_parameter(:K2), T.type_parameter(:V2)], block: T.nilable( + T.proc.params( + key: T.any(K, T.type_parameter(:K2)), + old_val: V, + new_val: T.type_parameter(:V2), + ).returns(T.type_parameter(:ConflictRes)) + )).returns(T::Hash[T.any(K, T.type_parameter(:K2)), T.any(V, T.type_parameter(:V2), T.type_parameter(:ConflictRes))]) } + def deep_merge!(other_hash, &block); 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 +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 + +module ActiveSupport::Testing::ErrorReporterAssertions + # @version >= 7.1.0.rc1 + sig { params(error_class: T.class_of(Exception), block: T.proc.void).returns(ActiveSupport::Testing::ErrorReporterAssertions::ErrorCollector::Report) } + def assert_error_reported(error_class = T.unsafe(nil), &block); end +end diff --git a/sorbet/rbi/annotations/faraday.rbi b/sorbet/rbi/annotations/faraday.rbi new file mode 100644 index 000000000..1ddc4758f --- /dev/null +++ b/sorbet/rbi/annotations/faraday.rbi @@ -0,0 +1,45 @@ +# 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 Faraday + class << self + sig { params(url: T.untyped, options: T::Hash[Symbol, T.untyped], block: T.nilable(T.proc.params(connection: Faraday::Connection).void)).returns(Faraday::Connection) } + def new(url = nil, options = {}, &block); end + + # @method_missing: proxied to Faraday.default_connection, a Faraday::Connection + sig { params(url: T.nilable(T.any(String, URI::Generic)), params: T.nilable(T::Hash[T.untyped, T.untyped]), headers: T.nilable(T::Hash[T.untyped, T.untyped]), block: T.nilable(T.proc.params(request: Faraday::Request).void)).returns(Faraday::Response) } + def get(url = nil, params = nil, headers = nil, &block); end + + # @method_missing: proxied to Faraday.default_connection, a Faraday::Connection + sig { params(url: T.nilable(T.any(String, URI::Generic)), params: T.nilable(T::Hash[T.untyped, T.untyped]), headers: T.nilable(T::Hash[T.untyped, T.untyped]), block: T.nilable(T.proc.params(request: Faraday::Request).void)).returns(Faraday::Response) } + def head(url = nil, params = nil, headers = nil, &block); end + + # @method_missing: proxied to Faraday.default_connection, a Faraday::Connection + sig { params(url: T.nilable(T.any(String, URI::Generic)), params: T.nilable(T::Hash[T.untyped, T.untyped]), headers: T.nilable(T::Hash[T.untyped, T.untyped]), block: T.nilable(T.proc.params(request: Faraday::Request).void)).returns(Faraday::Response) } + def delete(url = nil, params = nil, headers = nil, &block); end + + # @method_missing: proxied to Faraday.default_connection, a Faraday::Connection + sig { params(url: T.nilable(T.any(String, URI::Generic)), params: T.nilable(T::Hash[T.untyped, T.untyped]), headers: T.nilable(T::Hash[T.untyped, T.untyped]), block: T.nilable(T.proc.params(request: Faraday::Request).void)).returns(Faraday::Response) } + def trace(url = nil, params = nil, headers = nil, &block); end + + # @method_missing: proxied to Faraday.default_connection, a Faraday::Connection + sig { params(url: T.nilable(T.any(String, URI::Generic)), body: T.untyped, headers: T.nilable(T::Hash[T.untyped, T.untyped]), block: T.nilable(T.proc.params(request: Faraday::Request).void)).returns(Faraday::Response) } + def post(url = nil, body = nil, headers = nil, &block); end + + # @method_missing: proxied to Faraday.default_connection, a Faraday::Connection + sig { params(url: T.nilable(T.any(String, URI::Generic)), body: T.untyped, headers: T.nilable(T::Hash[T.untyped, T.untyped]), block: T.nilable(T.proc.params(request: Faraday::Request).void)).returns(Faraday::Response) } + def put(url = nil, body = nil, headers = nil, &block); end + + # @method_missing: proxied to Faraday.default_connection, a Faraday::Connection + sig { params(url: T.nilable(T.any(String, URI::Generic)), body: T.untyped, headers: T.nilable(T::Hash[T.untyped, T.untyped]), block: T.nilable(T.proc.params(request: Faraday::Request).void)).returns(Faraday::Response) } + def patch(url = nil, body = nil, headers = nil, &block); end + end +end + +class Faraday::Response + sig { returns(T::Boolean) } + def success?; end +end diff --git a/sorbet/rbi/annotations/globalid.rbi b/sorbet/rbi/annotations/globalid.rbi new file mode 100644 index 000000000..916b21d22 --- /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/i18n.rbi b/sorbet/rbi/annotations/i18n.rbi new file mode 100644 index 000000000..2de3719db --- /dev/null +++ b/sorbet/rbi/annotations/i18n.rbi @@ -0,0 +1,40 @@ +# 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 I18n::Base + # A list set through `#available_locales=` is symbolized on the way in, but the + # fallback to `backend.available_locales` is returned as the backend built it, + # and a custom backend is free to hand back strings. + sig { returns(T::Array[T.any(String, Symbol)]) } + def available_locales; end + + sig { params(value: T.nilable(T.any(String, Symbol, T::Array[T.any(String, Symbol)]))).returns(T.nilable(T.any(String, Symbol, T::Array[T.any(String, Symbol)]))) } + def available_locales=(value); end + + sig { returns(Symbol) } + def default_locale; end + + sig { params(value: T.nilable(T.any(String, Symbol))).returns(T.nilable(T.any(String, Symbol))) } + def default_locale=(value); end + + sig { returns(String) } + def default_separator; end + + sig { params(value: String).returns(String) } + def default_separator=(value); end + + sig { returns(T::Boolean) } + def enforce_available_locales; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def enforce_available_locales=(value); end + + sig { returns(T.any(Symbol, FalseClass)) } + def locale; end + + sig { params(value: T.nilable(T.any(String, Symbol, FalseClass))).returns(T.nilable(T.any(String, Symbol, FalseClass))) } + def locale=(value); end +end diff --git a/sorbet/rbi/annotations/minitest.rbi b/sorbet/rbi/annotations/minitest.rbi new file mode 100644 index 000000000..a7059f097 --- /dev/null +++ b/sorbet/rbi/annotations/minitest.rbi @@ -0,0 +1,120 @@ +# 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 + + # @version < 6.0.0 + 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 000000000..218bf0c9d --- /dev/null +++ b/sorbet/rbi/annotations/railties.rbi @@ -0,0 +1,100 @@ +# 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(Rails::Autoloaders) } + def autoloaders; 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 + + # @version >= 7.1.0.rc1 + sig { returns(ActiveSupport::BroadcastLogger) } + 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::Autoloaders + Elem = type_member(:out) { { fixed: Zeitwerk::Loader } } + + sig { params(block: T.proc.params(arg0: Elem).returns(T.untyped)).returns(T.untyped) } + def each(&block); end + + sig { returns(Zeitwerk::Loader) } + def main; end + + sig { returns(Zeitwerk::Loader) } + def once; end +end + +class Rails::Engine < ::Rails::Railtie + class << self + # @shim: delegated to the instance using `method_missing` + sig { void } + def load_seed; end + + # @shim: delegated to the instance using `method_missing` + sig { returns(Pathname) } + def root; end + + # @shim: delegated to the instance using `method_missing` + sig { params(block: T.nilable(T.proc.bind(ActionDispatch::Routing::Mapper).void)).returns(ActionDispatch::Routing::RouteSet) } + def routes(&block); end + end + + sig { void } + def load_seed; end + + sig { params(block: T.nilable(T.proc.bind(ActionDispatch::Routing::Mapper).void)).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 + + class << self + sig { params(block: T.proc.bind(Rake::DSL).params(app: Rails::Application).void).void } + def rake_tasks(&block); end + 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 000000000..0d2cb4e48 --- /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 000000000..d9bb82a4d --- /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 000000000..826d65cab --- /dev/null +++ b/sorbet/rbi/dsl/abstract_controller/caching.rbi @@ -0,0 +1,31 @@ +# 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 _view_cache_dependencies; end + def _view_cache_dependencies=(value); end + def _view_cache_dependencies?; end + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end + + module GeneratedInstanceMethods + def _view_cache_dependencies; end + def _view_cache_dependencies=(value); end + def _view_cache_dependencies?; end + 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 000000000..d04a840a8 --- /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 000000000..97d95a8e8 --- /dev/null +++ b/sorbet/rbi/dsl/abstract_controller/callbacks.rbi @@ -0,0 +1,24 @@ +# 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 + def __callbacks?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + 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 000000000..3f1bbc125 --- /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 000000000..4a3bfe1e4 --- /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 000000000..14ffe072e --- /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 000000000..6bd1913ef --- /dev/null +++ b/sorbet/rbi/dsl/action_cable/channel/callbacks.rbi @@ -0,0 +1,24 @@ +# 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 + def __callbacks?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + 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 000000000..9e62b4fbb --- /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 000000000..21a0a147c --- /dev/null +++ b/sorbet/rbi/dsl/action_cable/connection/callbacks.rbi @@ -0,0 +1,24 @@ +# 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 + def __callbacks?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + 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 000000000..e835fe780 --- /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/caching.rbi b/sorbet/rbi/dsl/action_controller/caching.rbi new file mode 100644 index 000000000..f88717f92 --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/caching.rbi @@ -0,0 +1,30 @@ +# 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 _view_cache_dependencies; end + def _view_cache_dependencies=(value); end + def _view_cache_dependencies?; end + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end + + module GeneratedInstanceMethods + def _view_cache_dependencies; end + def _view_cache_dependencies=(value); end + def _view_cache_dependencies?; end + 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 000000000..a35b10224 --- /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 000000000..fb4f36501 --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/content_security_policy.rbi @@ -0,0 +1,32 @@ +# 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 __callbacks?; end + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + 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 000000000..91ac61162 --- /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 000000000..ab5f950c3 --- /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 000000000..d6602b7c8 --- /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 000000000..d68546701 --- /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 000000000..059161cc7 --- /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 000000000..dbfe5f4bf --- /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 000000000..4b12f1edd --- /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 000000000..32ac3ea1e --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/redirecting.rbi @@ -0,0 +1,25 @@ +# 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 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 000000000..0c6e186d3 --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/renderers.rbi @@ -0,0 +1,24 @@ +# 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 + 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 000000000..5d5b25b57 --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/renderers/all.rbi @@ -0,0 +1,25 @@ +# 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 + 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 000000000..d12ad2fcc --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/request_forgery_protection.rbi @@ -0,0 +1,32 @@ +# 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 __callbacks?; end + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + 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 000000000..b58f09628 --- /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/respond_with.rbi b/sorbet/rbi/dsl/action_controller/respond_with.rbi new file mode 100644 index 000000000..e5c3d0f08 --- /dev/null +++ b/sorbet/rbi/dsl/action_controller/respond_with.rbi @@ -0,0 +1,30 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionController::RespondWith`. +# Please instead update this file by running `bin/tapioca dsl ActionController::RespondWith`. + + +module ActionController::RespondWith + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def mimes_for_respond_to; end + def mimes_for_respond_to=(value); end + def mimes_for_respond_to?; end + def responder; end + def responder=(value); end + def responder?; end + end + + module GeneratedInstanceMethods + def mimes_for_respond_to; end + def mimes_for_respond_to=(value); end + def mimes_for_respond_to?; end + def responder; end + def responder=(value); end + def responder?; 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 000000000..ee0cd10b1 --- /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 000000000..8b1aa82c2 --- /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 000000000..002fcd57b --- /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 000000000..671b3ac71 --- /dev/null +++ b/sorbet/rbi/dsl/action_dispatch/integration_test.rbi @@ -0,0 +1,12 @@ +# 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 + include GeneratedMountedHelpers +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 000000000..8810693c2 --- /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 000000000..8bb4a03f4 --- /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 000000000..e0925fe9d --- /dev/null +++ b/sorbet/rbi/dsl/action_mailbox/inbound_email.rbi @@ -0,0 +1,1088 @@ +# 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 { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::ActionMailbox::InboundEmail]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::ActionMailbox::InboundEmail]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); 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 + 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 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 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 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 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 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 delete(*records); 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 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 000000000..48d9b0ec4 --- /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 000000000..34b0e1556 --- /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 000000000..db0d35054 --- /dev/null +++ b/sorbet/rbi/dsl/action_mailer/callbacks.rbi @@ -0,0 +1,23 @@ +# 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 + def __callbacks?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + 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 000000000..a4d7c6c0b --- /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 000000000..ca921d316 --- /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 000000000..ef86f9058 --- /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 000000000..a5101467b --- /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 000000000..5bd7ad4a6 --- /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 000000000..cab5a0491 --- /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 000000000..8a30cadee --- /dev/null +++ b/sorbet/rbi/dsl/action_text/encrypted_rich_text.rbi @@ -0,0 +1,990 @@ +# 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 { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::ActionText::EncryptedRichText]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::ActionText::EncryptedRichText]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); 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 + 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 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 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 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 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 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 delete(*records); 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 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 000000000..66bc2acb4 --- /dev/null +++ b/sorbet/rbi/dsl/action_text/rich_text.rbi @@ -0,0 +1,991 @@ +# 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 { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::ActionText::RichText]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::ActionText::RichText]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); 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 + 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 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 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 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 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 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 delete(*records); 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 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_token.rbi b/sorbet/rbi/dsl/action_token.rbi new file mode 100644 index 000000000..0a9ba339e --- /dev/null +++ b/sorbet/rbi/dsl/action_token.rbi @@ -0,0 +1,1434 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActionToken`. +# Please instead update this file by running `bin/tapioca dsl ActionToken`. + + +class ActionToken + include GeneratedAssociationMethods + include GeneratedAttributeMethods + include EnumMethodsModule + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig { returns(T::Hash[T.any(String, Symbol), Integer]) } + def actions; end + + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(::ActionToken) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::ActionToken).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: ::ActionToken).void)).returns(::ActionToken) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(T::Array[::ActionToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(::ActionToken) + 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: ::ActionToken).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::ActionToken).void)).returns(::ActionToken) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(T::Array[::ActionToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(::ActionToken) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::ActionToken).void)).returns(::ActionToken) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(T::Array[::ActionToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(::ActionToken) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(T::Array[::ActionToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(::ActionToken) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(T::Array[::ActionToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(::ActionToken) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::ActionToken]) } + def destroy_all; end + + sig { returns(T::Array[::ActionToken]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::ActionToken]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::ActionToken)) } + def fifth; end + + sig { returns(::ActionToken) } + 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(::ActionToken) + 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[::ActionToken]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::ActionToken).void).returns(T.nilable(::ActionToken)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::ActionToken)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::ActionToken) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::ActionToken).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::ActionToken]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::ActionToken]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::ActionToken]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(T::Array[::ActionToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(::ActionToken) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(T::Array[::ActionToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(::ActionToken) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(T::Array[::ActionToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(::ActionToken) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::ActionToken)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::ActionToken) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::ActionToken) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::ActionToken)) } + sig { params(limit: Integer).returns(T::Array[::ActionToken]) } + def first(limit = nil); end + + sig { returns(::ActionToken) } + def first!; end + + sig { returns(T.nilable(::ActionToken)) } + def forty_two; end + + sig { returns(::ActionToken) } + def forty_two!; end + + sig { returns(T.nilable(::ActionToken)) } + def fourth; end + + sig { returns(::ActionToken) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::ActionToken)) } + sig { params(limit: Integer).returns(T::Array[::ActionToken]) } + def last(limit = nil); end + + sig { returns(::ActionToken) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::ActionToken).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: ::ActionToken).void)).returns(::ActionToken) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(T::Array[::ActionToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActionToken).void) + ).returns(::ActionToken) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::ActionToken).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::ActionToken).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(::ActionToken)) } + def second; end + + sig { returns(::ActionToken) } + def second!; end + + sig { returns(T.nilable(::ActionToken)) } + def second_to_last; end + + sig { returns(::ActionToken) } + def second_to_last!; end + + sig { returns(::ActionToken) } + 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: ::ActionToken).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::ActionToken)) } + sig { params(limit: Integer).returns(T::Array[::ActionToken]) } + def take(limit = nil); end + + sig { returns(::ActionToken) } + def take!; end + + sig { returns(T.nilable(::ActionToken)) } + def third; end + + sig { returns(::ActionToken) } + def third!; end + + sig { returns(T.nilable(::ActionToken)) } + def third_to_last; end + + sig { returns(::ActionToken) } + def third_to_last!; end + end + + module EnumMethodsModule + sig { void } + def confirm_email!; end + + sig { returns(T::Boolean) } + def confirm_email?; end + + sig { void } + def enroll_course!; end + + sig { returns(T::Boolean) } + def enroll_course?; end + + sig { void } + def reset_password!; end + + sig { returns(T::Boolean) } + def reset_password?; 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 { 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 confirm_email(*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 enroll_course(*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_confirm_email(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_enroll_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_reset_password(*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 reset_password(*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: ::ActionToken).returns(BasicObject)).returns(T::Array[::ActionToken]) } + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::String) } + def action; end + + sig { params(value: T.any(::String, ::Symbol, ::Integer)).returns(T.any(::String, ::Symbol, ::Integer)) } + def action=(value); end + + sig { returns(T::Boolean) } + def action?; end + + sig { returns(T.nilable(::String)) } + def action_before_last_save; end + + sig { returns(T.untyped) } + def action_before_type_cast; end + + sig { returns(T::Boolean) } + def action_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def action_change; end + + sig { returns(T.nilable([::String, ::String])) } + def action_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def action_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def action_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def action_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def action_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def action_previously_was; end + + sig { returns(T.nilable(::String)) } + def action_was; end + + sig { void } + def action_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 expires_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def expires_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 { void } + def restore_action!; 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_token!; end + + sig { void } + def restore_updated_at!; end + + sig { void } + def restore_user_id!; end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_action; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_action?(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_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_token; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_token?(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_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_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(::String) } + def token; end + + sig { params(value: ::String).returns(::String) } + def token=(value); end + + sig { returns(T::Boolean) } + def token?; end + + sig { returns(T.nilable(::String)) } + def token_before_last_save; end + + sig { returns(T.untyped) } + def token_before_type_cast; end + + sig { returns(T::Boolean) } + def token_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def token_change; end + + sig { returns(T.nilable([::String, ::String])) } + def token_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def token_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def token_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def token_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def token_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def token_previously_was; end + + sig { returns(T.nilable(::String)) } + def token_was; end + + sig { void } + def token_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 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_action?(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_token?(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 confirm_email(*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 enroll_course(*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_confirm_email(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_enroll_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_reset_password(*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 reset_password(*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: ::ActionToken).returns(BasicObject)).returns(T::Array[::ActionToken]) } + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::ActionToken } } + + sig { returns(T::Array[::ActionToken]) } + def to_a; end + + sig { returns(T::Array[::ActionToken]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::ActionToken } } + + 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: ::ActionToken } } + + 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: ::ActionToken } } + + sig do + params( + records: T.any(::ActionToken, T::Enumerable[T.any(::ActionToken, T::Enumerable[::ActionToken])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::ActionToken, T::Enumerable[T.any(::ActionToken, T::Enumerable[::ActionToken])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::ActionToken, T::Enumerable[T.any(::ActionToken, T::Enumerable[::ActionToken])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::ActionToken, Integer, String, T::Enumerable[T.any(::ActionToken, Integer, String, T::Enumerable[::ActionToken])]) + ).returns(T::Array[::ActionToken]) + end + def delete(*records); end + + sig do + params( + records: T.any(::ActionToken, Integer, String, T::Enumerable[T.any(::ActionToken, Integer, String, T::Enumerable[::ActionToken])]) + ).returns(T::Array[::ActionToken]) + end + def destroy(*records); end + + sig { returns(T::Array[::ActionToken]) } + def load_target; end + + sig do + params( + records: T.any(::ActionToken, T::Enumerable[T.any(::ActionToken, T::Enumerable[::ActionToken])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::ActionToken, T::Enumerable[T.any(::ActionToken, T::Enumerable[::ActionToken])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::ActionToken, T::Enumerable[T.any(::ActionToken, T::Enumerable[::ActionToken])]) + ).returns(T::Array[::ActionToken]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::ActionToken]) } + def target; end + + sig { returns(T::Array[::ActionToken]) } + def to_a; end + + sig { returns(T::Array[::ActionToken]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::ActionToken } } + + sig { returns(T::Array[::ActionToken]) } + def to_a; end + + sig { returns(T::Array[::ActionToken]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::ActionToken } } + + 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: ::ActionToken } } + + 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 000000000..30087f3ec --- /dev/null +++ b/sorbet/rbi/dsl/action_view/helpers.rbi @@ -0,0 +1,15 @@ +# 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 + include GeneratedMountedHelpers + + 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 000000000..10a330a0a --- /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 000000000..ca1d562d2 --- /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 000000000..733cb5f4f --- /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 000000000..60e70254a --- /dev/null +++ b/sorbet/rbi/dsl/action_view/layouts.rbi @@ -0,0 +1,25 @@ +# 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; 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 000000000..52ac48949 --- /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 000000000..b780394a5 --- /dev/null +++ b/sorbet/rbi/dsl/active_job/callbacks.rbi @@ -0,0 +1,24 @@ +# 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 + def __callbacks?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def __callbacks?; end + 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 000000000..f1c1f6c40 --- /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 000000000..7fa4a61ef --- /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 000000000..d3759116a --- /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 000000000..7d7053a1c --- /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 000000000..e728614c0 --- /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 000000000..ec03184cc --- /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 000000000..8539af17e --- /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/attribute_methods.rbi b/sorbet/rbi/dsl/active_model/attribute_methods.rbi new file mode 100644 index 000000000..8e58d7b91 --- /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 000000000..d300cb5f4 --- /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/conversion.rbi b/sorbet/rbi/dsl/active_model/conversion.rbi new file mode 100644 index 000000000..9289cdd0f --- /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 000000000..7eb00d3d0 --- /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/serializers/json.rbi b/sorbet/rbi/dsl/active_model/serializers/json.rbi new file mode 100644 index 000000000..ab70ce933 --- /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 000000000..5b129e015 --- /dev/null +++ b/sorbet/rbi/dsl/active_model/validations.rbi @@ -0,0 +1,28 @@ +# 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 __callbacks?; end + def _validators; end + def _validators=(value); end + def _validators?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + 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 000000000..7ca05416d --- /dev/null +++ b/sorbet/rbi/dsl/active_model/validations/callbacks.rbi @@ -0,0 +1,23 @@ +# 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 + def __callbacks?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + 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 000000000..d65dd4371 --- /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 000000000..516acdb79 --- /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 000000000..9d06e2766 --- /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 000000000..be40114db --- /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 000000000..147e1c9f4 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/attributes.rbi @@ -0,0 +1,20 @@ +# 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 GeneratedClassMethods + + module GeneratedClassMethods + def attributes_to_define_after_schema_loads; end + def attributes_to_define_after_schema_loads=(value); end + def attributes_to_define_after_schema_loads?; end + end + + module GeneratedInstanceMethods; 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 000000000..5a31b22ce --- /dev/null +++ b/sorbet/rbi/dsl/active_record/callbacks.rbi @@ -0,0 +1,23 @@ +# 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 + def __callbacks?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + 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 000000000..fff522685 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/core.rbi @@ -0,0 +1,62 @@ +# 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 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 + 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 000000000..a89d70e05 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/counter_cache.rbi @@ -0,0 +1,20 @@ +# 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 + end + + module GeneratedInstanceMethods; 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 000000000..73b5a4628 --- /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 000000000..53130bd50 --- /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 000000000..6fc6d69eb --- /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 000000000..99efc8b40 --- /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 000000000..85bd9dafa --- /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 000000000..6bbad79fe --- /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/normalization.rbi b/sorbet/rbi/dsl/active_record/normalization.rbi new file mode 100644 index 000000000..24b3404bd --- /dev/null +++ b/sorbet/rbi/dsl/active_record/normalization.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::Normalization`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::Normalization`. + + +module ActiveRecord::Normalization + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def normalized_attributes; end + def normalized_attributes=(value); end + def normalized_attributes?; end + end + + module GeneratedInstanceMethods + def normalized_attributes; end + def normalized_attributes=(value); end + def normalized_attributes?; 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 000000000..c6477f57b --- /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 000000000..e31d674cc --- /dev/null +++ b/sorbet/rbi/dsl/active_record/reflection.rbi @@ -0,0 +1,33 @@ +# 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 + 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 + 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 000000000..229070b39 --- /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 000000000..28518b0c3 --- /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 000000000..6c06f86b7 --- /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 000000000..59b5278ae --- /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/session_store/session.rbi b/sorbet/rbi/dsl/active_record/session_store/session.rbi new file mode 100644 index 000000000..82f1982c7 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/session_store/session.rbi @@ -0,0 +1,1280 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::SessionStore::Session`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::SessionStore::Session`. + + +class ActiveRecord::SessionStore::Session + 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: ::ActiveRecord::SessionStore::Session).void) + ).returns(::ActiveRecord::SessionStore::Session) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::ActiveRecord::SessionStore::Session).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: ::ActiveRecord::SessionStore::Session).void) + ).returns(::ActiveRecord::SessionStore::Session) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(T::Array[::ActiveRecord::SessionStore::Session]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(::ActiveRecord::SessionStore::Session) + 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: ::ActiveRecord::SessionStore::Session).void + ).returns(Integer) + end + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(::ActiveRecord::SessionStore::Session) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(T::Array[::ActiveRecord::SessionStore::Session]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(::ActiveRecord::SessionStore::Session) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(::ActiveRecord::SessionStore::Session) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(T::Array[::ActiveRecord::SessionStore::Session]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(::ActiveRecord::SessionStore::Session) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(T::Array[::ActiveRecord::SessionStore::Session]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(::ActiveRecord::SessionStore::Session) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(T::Array[::ActiveRecord::SessionStore::Session]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(::ActiveRecord::SessionStore::Session) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::ActiveRecord::SessionStore::Session]) } + def destroy_all; end + + sig { returns(T::Array[::ActiveRecord::SessionStore::Session]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::ActiveRecord::SessionStore::Session]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::ActiveRecord::SessionStore::Session)) } + def fifth; end + + sig { returns(::ActiveRecord::SessionStore::Session) } + 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(::ActiveRecord::SessionStore::Session) + 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[::ActiveRecord::SessionStore::Session]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::ActiveRecord::SessionStore::Session).void + ).returns(T.nilable(::ActiveRecord::SessionStore::Session)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::ActiveRecord::SessionStore::Session)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::ActiveRecord::SessionStore::Session) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::ActiveRecord::SessionStore::Session).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::ActiveRecord::SessionStore::Session]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::ActiveRecord::SessionStore::Session]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::ActiveRecord::SessionStore::Session]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(T::Array[::ActiveRecord::SessionStore::Session]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(::ActiveRecord::SessionStore::Session) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(T::Array[::ActiveRecord::SessionStore::Session]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(::ActiveRecord::SessionStore::Session) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(T::Array[::ActiveRecord::SessionStore::Session]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(::ActiveRecord::SessionStore::Session) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::ActiveRecord::SessionStore::Session)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::ActiveRecord::SessionStore::Session) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::ActiveRecord::SessionStore::Session) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::ActiveRecord::SessionStore::Session)) } + sig { params(limit: Integer).returns(T::Array[::ActiveRecord::SessionStore::Session]) } + def first(limit = nil); end + + sig { returns(::ActiveRecord::SessionStore::Session) } + def first!; end + + sig { returns(T.nilable(::ActiveRecord::SessionStore::Session)) } + def forty_two; end + + sig { returns(::ActiveRecord::SessionStore::Session) } + def forty_two!; end + + sig { returns(T.nilable(::ActiveRecord::SessionStore::Session)) } + def fourth; end + + sig { returns(::ActiveRecord::SessionStore::Session) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::ActiveRecord::SessionStore::Session)) } + sig { params(limit: Integer).returns(T::Array[::ActiveRecord::SessionStore::Session]) } + def last(limit = nil); end + + sig { returns(::ActiveRecord::SessionStore::Session) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActiveRecord::SessionStore::Session).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: ::ActiveRecord::SessionStore::Session).void) + ).returns(::ActiveRecord::SessionStore::Session) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(T::Array[::ActiveRecord::SessionStore::Session]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ActiveRecord::SessionStore::Session).void) + ).returns(::ActiveRecord::SessionStore::Session) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActiveRecord::SessionStore::Session).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ActiveRecord::SessionStore::Session).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(::ActiveRecord::SessionStore::Session)) } + def second; end + + sig { returns(::ActiveRecord::SessionStore::Session) } + def second!; end + + sig { returns(T.nilable(::ActiveRecord::SessionStore::Session)) } + def second_to_last; end + + sig { returns(::ActiveRecord::SessionStore::Session) } + def second_to_last!; end + + sig { returns(::ActiveRecord::SessionStore::Session) } + 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: ::ActiveRecord::SessionStore::Session).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::ActiveRecord::SessionStore::Session)) } + sig { params(limit: Integer).returns(T::Array[::ActiveRecord::SessionStore::Session]) } + def take(limit = nil); end + + sig { returns(::ActiveRecord::SessionStore::Session) } + def take!; end + + sig { returns(T.nilable(::ActiveRecord::SessionStore::Session)) } + def third; end + + sig { returns(::ActiveRecord::SessionStore::Session) } + def third!; end + + sig { returns(T.nilable(::ActiveRecord::SessionStore::Session)) } + def third_to_last; end + + sig { returns(::ActiveRecord::SessionStore::Session) } + def third_to_last!; 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 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: ::ActiveRecord::SessionStore::Session).returns(BasicObject) + ).returns(T::Array[::ActiveRecord::SessionStore::Session]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 data; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def data=(value); end + + sig { returns(T::Boolean) } + def data?; end + + sig { returns(T.nilable(::String)) } + def data_before_last_save; end + + sig { returns(T.untyped) } + def data_before_type_cast; end + + sig { returns(T::Boolean) } + def data_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def data_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def data_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def data_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def data_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def data_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def data_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def data_previously_was; end + + sig { returns(T.nilable(::String)) } + def data_was; end + + sig { void } + def data_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 { void } + def restore_created_at!; end + + sig { void } + def restore_data!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_session_id!; end + + sig { void } + def restore_updated_at!; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_data; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_data?(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_session_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_session_id?(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_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 session_id; end + + sig { params(value: ::String).returns(::String) } + def session_id=(value); end + + sig { returns(T::Boolean) } + def session_id?; end + + sig { returns(T.nilable(::String)) } + def session_id_before_last_save; end + + sig { returns(T.untyped) } + def session_id_before_type_cast; end + + sig { returns(T::Boolean) } + def session_id_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def session_id_change; end + + sig { returns(T.nilable([::String, ::String])) } + def session_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def session_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def session_id_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def session_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def session_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def session_id_previously_was; end + + sig { returns(T.nilable(::String)) } + def session_id_was; end + + sig { void } + def session_id_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_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_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_session_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 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: ::ActiveRecord::SessionStore::Session).returns(BasicObject) + ).returns(T::Array[::ActiveRecord::SessionStore::Session]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::ActiveRecord::SessionStore::Session } } + + sig { returns(T::Array[::ActiveRecord::SessionStore::Session]) } + def to_a; end + + sig { returns(T::Array[::ActiveRecord::SessionStore::Session]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::ActiveRecord::SessionStore::Session } } + + 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: ::ActiveRecord::SessionStore::Session } } + + 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: ::ActiveRecord::SessionStore::Session } } + + sig do + params( + records: T.any(::ActiveRecord::SessionStore::Session, T::Enumerable[T.any(::ActiveRecord::SessionStore::Session, T::Enumerable[::ActiveRecord::SessionStore::Session])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::ActiveRecord::SessionStore::Session, T::Enumerable[T.any(::ActiveRecord::SessionStore::Session, T::Enumerable[::ActiveRecord::SessionStore::Session])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::ActiveRecord::SessionStore::Session, T::Enumerable[T.any(::ActiveRecord::SessionStore::Session, T::Enumerable[::ActiveRecord::SessionStore::Session])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::ActiveRecord::SessionStore::Session, Integer, String, T::Enumerable[T.any(::ActiveRecord::SessionStore::Session, Integer, String, T::Enumerable[::ActiveRecord::SessionStore::Session])]) + ).returns(T::Array[::ActiveRecord::SessionStore::Session]) + end + def delete(*records); end + + sig do + params( + records: T.any(::ActiveRecord::SessionStore::Session, Integer, String, T::Enumerable[T.any(::ActiveRecord::SessionStore::Session, Integer, String, T::Enumerable[::ActiveRecord::SessionStore::Session])]) + ).returns(T::Array[::ActiveRecord::SessionStore::Session]) + end + def destroy(*records); end + + sig { returns(T::Array[::ActiveRecord::SessionStore::Session]) } + def load_target; end + + sig do + params( + records: T.any(::ActiveRecord::SessionStore::Session, T::Enumerable[T.any(::ActiveRecord::SessionStore::Session, T::Enumerable[::ActiveRecord::SessionStore::Session])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::ActiveRecord::SessionStore::Session, T::Enumerable[T.any(::ActiveRecord::SessionStore::Session, T::Enumerable[::ActiveRecord::SessionStore::Session])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::ActiveRecord::SessionStore::Session, T::Enumerable[T.any(::ActiveRecord::SessionStore::Session, T::Enumerable[::ActiveRecord::SessionStore::Session])]) + ).returns(T::Array[::ActiveRecord::SessionStore::Session]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::ActiveRecord::SessionStore::Session]) } + def target; end + + sig { returns(T::Array[::ActiveRecord::SessionStore::Session]) } + def to_a; end + + sig { returns(T::Array[::ActiveRecord::SessionStore::Session]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::ActiveRecord::SessionStore::Session } } + + sig { returns(T::Array[::ActiveRecord::SessionStore::Session]) } + def to_a; end + + sig { returns(T::Array[::ActiveRecord::SessionStore::Session]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::ActiveRecord::SessionStore::Session } } + + 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: ::ActiveRecord::SessionStore::Session } } + + 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_record/signed_id.rbi b/sorbet/rbi/dsl/active_record/signed_id.rbi new file mode 100644 index 000000000..0db888ffb --- /dev/null +++ b/sorbet/rbi/dsl/active_record/signed_id.rbi @@ -0,0 +1,23 @@ +# 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_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 000000000..31ee3190a --- /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 000000000..4e1eec698 --- /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_record/validations.rbi b/sorbet/rbi/dsl/active_record/validations.rbi new file mode 100644 index 000000000..dba004cc0 --- /dev/null +++ b/sorbet/rbi/dsl/active_record/validations.rbi @@ -0,0 +1,29 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveRecord::Validations`. +# Please instead update this file by running `bin/tapioca dsl ActiveRecord::Validations`. + + +module ActiveRecord::Validations + include GeneratedInstanceMethods + + mixes_in_class_methods ::ActiveModel::Validations::ClassMethods + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def __callbacks?; end + def _validators; end + def _validators=(value); end + def _validators?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def __callbacks?; end + def _validators; end + def _validators?; end + 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 000000000..7b4806800 --- /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 000000000..6e33495b7 --- /dev/null +++ b/sorbet/rbi/dsl/active_storage/attachment.rbi @@ -0,0 +1,1391 @@ +# 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 + 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: ::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 { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::ActiveStorage::Attachment]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::ActiveStorage::Attachment]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, 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(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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); 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 + end + + module GeneratedAssociationMethods + sig { returns(T.nilable(::ActiveStorage::Blob)) } + def blob; end + + sig { params(value: T.nilable(::ActiveStorage::Blob)).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(::ActiveStorage::Blob) } + def build_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Blob) } + def create_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Blob) } + 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.nilable(::ActiveStorage::Blob)) } + 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 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::Integer) } + def blob_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def blob_id=(value); end + + sig { returns(T::Boolean) } + def blob_id?; end + + sig { returns(T.nilable(::Integer)) } + def blob_id_before_last_save; end + + sig { returns(T.untyped) } + def blob_id_before_type_cast; end + + sig { returns(T::Boolean) } + def blob_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def blob_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def blob_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def blob_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def blob_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def blob_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def blob_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def blob_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def blob_id_was; end + + sig { void } + def blob_id_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 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 record_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def record_id=(value); end + + sig { returns(T::Boolean) } + def record_id?; end + + sig { returns(T.nilable(::Integer)) } + def record_id_before_last_save; end + + sig { returns(T.untyped) } + def record_id_before_type_cast; end + + sig { returns(T::Boolean) } + def record_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def record_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def record_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def record_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def record_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def record_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def record_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def record_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def record_id_was; end + + sig { void } + def record_id_will_change!; end + + sig { returns(::String) } + def record_type; end + + sig { params(value: ::String).returns(::String) } + def record_type=(value); end + + sig { returns(T::Boolean) } + def record_type?; end + + sig { returns(T.nilable(::String)) } + def record_type_before_last_save; end + + sig { returns(T.untyped) } + def record_type_before_type_cast; end + + sig { returns(T::Boolean) } + def record_type_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def record_type_change; end + + sig { returns(T.nilable([::String, ::String])) } + def record_type_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def record_type_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def record_type_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def record_type_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def record_type_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def record_type_previously_was; end + + sig { returns(T.nilable(::String)) } + def record_type_was; end + + sig { void } + def record_type_will_change!; end + + sig { void } + def restore_blob_id!; 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_name!; end + + sig { void } + def restore_record_id!; end + + sig { void } + def restore_record_type!; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_blob_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_blob_id?(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_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_record_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_record_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_record_type; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_record_type?(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_blob_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_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_record_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_record_type?(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 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 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 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 delete(*records); 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 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 000000000..0a3e8b7aa --- /dev/null +++ b/sorbet/rbi/dsl/active_storage/blob.rbi @@ -0,0 +1,1659 @@ +# 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 + include GeneratedAttributeMethods + 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 { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::ActiveStorage::Blob]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::ActiveStorage::Blob]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, 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(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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); 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 + 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(::ActiveStorage::Attachment::PrivateCollectionProxy) } + def attachments; end + + sig { params(value: T::Enumerable[::ActiveStorage::Attachment]).void } + def attachments=(value); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Attachment) } + def build_preview_image_attachment(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Blob) } + def build_preview_image_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Attachment) } + def create_preview_image_attachment(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Attachment) } + def create_preview_image_attachment!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Blob) } + def create_preview_image_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Blob) } + def create_preview_image_blob!(*args, &blk); end + + sig { returns(T.nilable(::ActiveStorage::Attachment)) } + def preview_image_attachment; end + + sig { params(value: T.nilable(::ActiveStorage::Attachment)).void } + def preview_image_attachment=(value); end + + sig { returns(T.nilable(::ActiveStorage::Blob)) } + def preview_image_blob; end + + sig { params(value: T.nilable(::ActiveStorage::Blob)).void } + def preview_image_blob=(value); end + + sig { returns(T.nilable(::ActiveStorage::Attachment)) } + def reload_preview_image_attachment; end + + sig { returns(T.nilable(::ActiveStorage::Blob)) } + 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(::ActiveStorage::VariantRecord::PrivateCollectionProxy) } + def variant_records; end + + sig { params(value: T::Enumerable[::ActiveStorage::VariantRecord]).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 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 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(::String) } + def checksum; end + + sig { params(value: ::String).returns(::String) } + def checksum=(value); end + + sig { returns(T::Boolean) } + def checksum?; end + + sig { returns(T.nilable(::String)) } + def checksum_before_last_save; end + + sig { returns(T.untyped) } + def checksum_before_type_cast; end + + sig { returns(T::Boolean) } + def checksum_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def checksum_change; end + + sig { returns(T.nilable([::String, ::String])) } + def checksum_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def checksum_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def checksum_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def checksum_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def checksum_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def checksum_previously_was; end + + sig { returns(T.nilable(::String)) } + def checksum_was; end + + sig { void } + def checksum_will_change!; end + + sig { returns(T.nilable(::String)) } + def content_type; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def content_type=(value); end + + sig { returns(T::Boolean) } + def content_type?; end + + sig { returns(T.nilable(::String)) } + def content_type_before_last_save; end + + sig { returns(T.untyped) } + def content_type_before_type_cast; end + + sig { returns(T::Boolean) } + def content_type_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def content_type_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def content_type_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def content_type_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def content_type_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def content_type_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def content_type_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def content_type_previously_was; end + + sig { returns(T.nilable(::String)) } + def content_type_was; end + + sig { void } + def content_type_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(::String) } + def filename; end + + sig { params(value: ::String).returns(::String) } + def filename=(value); end + + sig { returns(T::Boolean) } + def filename?; end + + sig { returns(T.nilable(::String)) } + def filename_before_last_save; end + + sig { returns(T.untyped) } + def filename_before_type_cast; end + + sig { returns(T::Boolean) } + def filename_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def filename_change; end + + sig { returns(T.nilable([::String, ::String])) } + def filename_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def filename_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def filename_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def filename_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def filename_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def filename_previously_was; end + + sig { returns(T.nilable(::String)) } + def filename_was; end + + sig { void } + def filename_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.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_byte_size!; end + + sig { void } + def restore_checksum!; end + + sig { void } + def restore_content_type!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_filename!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_key!; end + + sig { void } + def restore_metadata!; end + + sig { void } + def restore_service_name!; 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([::String, ::String])) } + def saved_change_to_checksum; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_checksum?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_content_type; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_content_type?(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([::String, ::String])) } + def saved_change_to_filename; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_filename?(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.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_service_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_service_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(::String) } + def service_name; end + + sig { params(value: ::String).returns(::String) } + def service_name=(value); end + + sig { returns(T::Boolean) } + def service_name?; end + + sig { returns(T.nilable(::String)) } + def service_name_before_last_save; end + + sig { returns(T.untyped) } + def service_name_before_type_cast; end + + sig { returns(T::Boolean) } + def service_name_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def service_name_change; end + + sig { returns(T.nilable([::String, ::String])) } + def service_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def service_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def service_name_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def service_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def service_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def service_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def service_name_was; end + + sig { void } + def service_name_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_checksum?(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_content_type?(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_filename?(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_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_service_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 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 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 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 delete(*records); 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 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 000000000..be334c3f0 --- /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 000000000..bf0cac6c4 --- /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/purge_job.rbi b/sorbet/rbi/dsl/active_storage/purge_job.rbi new file mode 100644 index 000000000..bbbc6355b --- /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 000000000..7e6fe684b --- /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 000000000..d4a390a49 --- /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 000000000..e7962640a --- /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 000000000..c63b66635 --- /dev/null +++ b/sorbet/rbi/dsl/active_storage/variant_record.rbi @@ -0,0 +1,1250 @@ +# 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 + include GeneratedAttributeMethods + 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 { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::ActiveStorage::VariantRecord]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::ActiveStorage::VariantRecord]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, 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(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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); 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 + end + + module GeneratedAssociationMethods + sig { returns(T.nilable(::ActiveStorage::Blob)) } + def blob; end + + sig { params(value: T.nilable(::ActiveStorage::Blob)).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(::ActiveStorage::Blob) } + def build_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Attachment) } + def build_image_attachment(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Blob) } + def build_image_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Blob) } + def create_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Blob) } + def create_blob!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Attachment) } + def create_image_attachment(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Attachment) } + def create_image_attachment!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Blob) } + def create_image_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Blob) } + def create_image_blob!(*args, &blk); end + + sig { returns(T.nilable(::ActiveStorage::Attachment)) } + def image_attachment; end + + sig { params(value: T.nilable(::ActiveStorage::Attachment)).void } + def image_attachment=(value); end + + sig { returns(T.nilable(::ActiveStorage::Blob)) } + def image_blob; end + + sig { params(value: T.nilable(::ActiveStorage::Blob)).void } + def image_blob=(value); end + + sig { returns(T.nilable(::ActiveStorage::Blob)) } + def reload_blob; end + + sig { returns(T.nilable(::ActiveStorage::Attachment)) } + def reload_image_attachment; end + + sig { returns(T.nilable(::ActiveStorage::Blob)) } + 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 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::Integer) } + def blob_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def blob_id=(value); end + + sig { returns(T::Boolean) } + def blob_id?; end + + sig { returns(T.nilable(::Integer)) } + def blob_id_before_last_save; end + + sig { returns(T.untyped) } + def blob_id_before_type_cast; end + + sig { returns(T::Boolean) } + def blob_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def blob_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def blob_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def blob_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def blob_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def blob_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def blob_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def blob_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def blob_id_was; end + + sig { void } + def blob_id_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 { void } + def restore_blob_id!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_variation_digest!; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_blob_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_blob_id?(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_variation_digest; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_variation_digest?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(::String) } + def variation_digest; end + + sig { params(value: ::String).returns(::String) } + def variation_digest=(value); end + + sig { returns(T::Boolean) } + def variation_digest?; end + + sig { returns(T.nilable(::String)) } + def variation_digest_before_last_save; end + + sig { returns(T.untyped) } + def variation_digest_before_type_cast; end + + sig { returns(T::Boolean) } + def variation_digest_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def variation_digest_change; end + + sig { returns(T.nilable([::String, ::String])) } + def variation_digest_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def variation_digest_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def variation_digest_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def variation_digest_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def variation_digest_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def variation_digest_previously_was; end + + sig { returns(T.nilable(::String)) } + def variation_digest_was; end + + sig { void } + def variation_digest_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_blob_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?(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_variation_digest?(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 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 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 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 delete(*records); 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 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 000000000..64b88fa85 --- /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 000000000..4c1ad1358 --- /dev/null +++ b/sorbet/rbi/dsl/active_support/callbacks.rbi @@ -0,0 +1,23 @@ +# 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 + def __callbacks?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + 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 000000000..cf65f829e --- /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/test_case.rbi b/sorbet/rbi/dsl/active_support/test_case.rbi new file mode 100644 index 000000000..99fd1e263 --- /dev/null +++ b/sorbet/rbi/dsl/active_support/test_case.rbi @@ -0,0 +1,10 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ActiveSupport::TestCase`. +# Please instead update this file by running `bin/tapioca dsl ActiveSupport::TestCase`. + + +class ActiveSupport::TestCase + include ActiveRecord::TestFixtures +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 000000000..ba004cf53 --- /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/api/v8/apidocs_controller.rbi b/sorbet/rbi/dsl/api/v8/apidocs_controller.rbi new file mode 100644 index 000000000..5d7065239 --- /dev/null +++ b/sorbet/rbi/dsl/api/v8/apidocs_controller.rbi @@ -0,0 +1,42 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Api::V8::ApidocsController`. +# Please instead update this file by running `bin/tapioca dsl Api::V8::ApidocsController`. + + +class Api::V8::ApidocsController + include GeneratedUrlHelpersModule + include GeneratedPathHelpersModule + include GeneratedMountedHelpers + + sig { returns(HelperProxy) } + def helpers; end + + module HelperMethods + include ::ActionText::ContentHelper + include ::ActionText::TagHelper + include ::ActionController::Base::HelperMethods + include ::ApplicationHelper + include ::AuthorizeCollectionHelper + include ::BadUtf8Helper + include ::BootstrapFlashHelper + include ::CourseTimingsHelper + include ::CoursesHelper + include ::ExercisesHelper + include ::ExtraFieldHelper + include ::FeedbackAnswersHelper + include ::FlashBlockHelper + include ::PasteHelper + include ::PointsHelper + include ::SessionsHelper + include ::SubmissionsHelper + include ::TwitterBreadcrumbsHelper + include ::FontAwesome::Rails::IconHelper + include ::Doorkeeper::DashboardHelper + end + + class HelperProxy < ::ActionView::Base + include HelperMethods + end +end diff --git a/sorbet/rbi/dsl/application_controller.rbi b/sorbet/rbi/dsl/application_controller.rbi new file mode 100644 index 000000000..479ba4adb --- /dev/null +++ b/sorbet/rbi/dsl/application_controller.rbi @@ -0,0 +1,42 @@ +# 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 + include GeneratedMountedHelpers + + sig { returns(HelperProxy) } + def helpers; end + + module HelperMethods + include ::ActionText::ContentHelper + include ::ActionText::TagHelper + include ::ActionController::Base::HelperMethods + include ::ApplicationHelper + include ::AuthorizeCollectionHelper + include ::BadUtf8Helper + include ::BootstrapFlashHelper + include ::CourseTimingsHelper + include ::CoursesHelper + include ::ExercisesHelper + include ::ExtraFieldHelper + include ::FeedbackAnswersHelper + include ::FlashBlockHelper + include ::PasteHelper + include ::PointsHelper + include ::SessionsHelper + include ::SubmissionsHelper + include ::TwitterBreadcrumbsHelper + include ::FontAwesome::Rails::IconHelper + include ::Doorkeeper::DashboardHelper + end + + class HelperProxy < ::ActionView::Base + include HelperMethods + end +end diff --git a/sorbet/rbi/dsl/assistantship.rbi b/sorbet/rbi/dsl/assistantship.rbi new file mode 100644 index 000000000..3b821afe1 --- /dev/null +++ b/sorbet/rbi/dsl/assistantship.rbi @@ -0,0 +1,1292 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Assistantship`. +# Please instead update this file by running `bin/tapioca dsl Assistantship`. + + +class Assistantship + 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: ::Assistantship).void) + ).returns(::Assistantship) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::Assistantship).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: ::Assistantship).void)).returns(::Assistantship) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Assistantship).void) + ).returns(T::Array[::Assistantship]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Assistantship).void) + ).returns(::Assistantship) + 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: ::Assistantship).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Assistantship).void)).returns(::Assistantship) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Assistantship).void) + ).returns(T::Array[::Assistantship]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Assistantship).void) + ).returns(::Assistantship) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Assistantship).void)).returns(::Assistantship) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Assistantship).void) + ).returns(T::Array[::Assistantship]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Assistantship).void) + ).returns(::Assistantship) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Assistantship).void) + ).returns(T::Array[::Assistantship]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Assistantship).void) + ).returns(::Assistantship) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Assistantship).void) + ).returns(T::Array[::Assistantship]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Assistantship).void) + ).returns(::Assistantship) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::Assistantship]) } + def destroy_all; end + + sig { returns(T::Array[::Assistantship]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Assistantship]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Assistantship)) } + def fifth; end + + sig { returns(::Assistantship) } + 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(::Assistantship) + 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[::Assistantship]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::Assistantship).void + ).returns(T.nilable(::Assistantship)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Assistantship)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Assistantship) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::Assistantship).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::Assistantship]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::Assistantship]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::Assistantship]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Assistantship).void) + ).returns(T::Array[::Assistantship]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Assistantship).void) + ).returns(::Assistantship) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Assistantship).void) + ).returns(T::Array[::Assistantship]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Assistantship).void) + ).returns(::Assistantship) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Assistantship).void) + ).returns(T::Array[::Assistantship]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Assistantship).void) + ).returns(::Assistantship) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Assistantship)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Assistantship) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Assistantship) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Assistantship)) } + sig { params(limit: Integer).returns(T::Array[::Assistantship]) } + def first(limit = nil); end + + sig { returns(::Assistantship) } + def first!; end + + sig { returns(T.nilable(::Assistantship)) } + def forty_two; end + + sig { returns(::Assistantship) } + def forty_two!; end + + sig { returns(T.nilable(::Assistantship)) } + def fourth; end + + sig { returns(::Assistantship) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::Assistantship)) } + sig { params(limit: Integer).returns(T::Array[::Assistantship]) } + def last(limit = nil); end + + sig { returns(::Assistantship) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::Assistantship).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: ::Assistantship).void)).returns(::Assistantship) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Assistantship).void) + ).returns(T::Array[::Assistantship]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Assistantship).void) + ).returns(::Assistantship) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Assistantship).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Assistantship).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(::Assistantship)) } + def second; end + + sig { returns(::Assistantship) } + def second!; end + + sig { returns(T.nilable(::Assistantship)) } + def second_to_last; end + + sig { returns(::Assistantship) } + def second_to_last!; end + + sig { returns(::Assistantship) } + 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: ::Assistantship).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Assistantship)) } + sig { params(limit: Integer).returns(T::Array[::Assistantship]) } + def take(limit = nil); end + + sig { returns(::Assistantship) } + def take!; end + + sig { returns(T.nilable(::Assistantship)) } + def third; end + + sig { returns(::Assistantship) } + def third!; end + + sig { returns(T.nilable(::Assistantship)) } + def third_to_last; end + + sig { returns(::Assistantship) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def build_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def build_user(*args, &blk); end + + sig { returns(T.nilable(::Course)) } + def course; end + + sig { params(value: T.nilable(::Course)).void } + def course=(value); end + + sig { returns(T::Boolean) } + def course_changed?; end + + sig { returns(T::Boolean) } + def course_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course!(*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(::Course)) } + def reload_course; end + + sig { returns(T.nilable(::User)) } + def reload_user; end + + sig { void } + def reset_course; 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 { 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 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: ::Assistantship).returns(BasicObject)).returns(T::Array[::Assistantship]) } + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.nilable(::Integer)) } + def course_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def course_id=(value); end + + sig { returns(T::Boolean) } + def course_id?; end + + sig { returns(T.nilable(::Integer)) } + def course_id_before_last_save; end + + sig { returns(T.untyped) } + def course_id_before_type_cast; end + + sig { returns(T::Boolean) } + def course_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def course_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def course_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def course_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def course_id_was; end + + sig { void } + def course_id_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 { void } + def restore_course_id!; 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_updated_at!; end + + sig { void } + def restore_user_id!; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_course_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_course_id?(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_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(::ActiveSupport::TimeWithZone), T.nilable(::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(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_course_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_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 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: ::Assistantship).returns(BasicObject)).returns(T::Array[::Assistantship]) } + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Assistantship } } + + sig { returns(T::Array[::Assistantship]) } + def to_a; end + + sig { returns(T::Array[::Assistantship]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Assistantship } } + + 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: ::Assistantship } } + + 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: ::Assistantship } } + + sig do + params( + records: T.any(::Assistantship, T::Enumerable[T.any(::Assistantship, T::Enumerable[::Assistantship])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Assistantship, T::Enumerable[T.any(::Assistantship, T::Enumerable[::Assistantship])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Assistantship, T::Enumerable[T.any(::Assistantship, T::Enumerable[::Assistantship])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::Assistantship, Integer, String, T::Enumerable[T.any(::Assistantship, Integer, String, T::Enumerable[::Assistantship])]) + ).returns(T::Array[::Assistantship]) + end + def delete(*records); end + + sig do + params( + records: T.any(::Assistantship, Integer, String, T::Enumerable[T.any(::Assistantship, Integer, String, T::Enumerable[::Assistantship])]) + ).returns(T::Array[::Assistantship]) + end + def destroy(*records); end + + sig { returns(T::Array[::Assistantship]) } + def load_target; end + + sig do + params( + records: T.any(::Assistantship, T::Enumerable[T.any(::Assistantship, T::Enumerable[::Assistantship])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Assistantship, T::Enumerable[T.any(::Assistantship, T::Enumerable[::Assistantship])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Assistantship, T::Enumerable[T.any(::Assistantship, T::Enumerable[::Assistantship])]) + ).returns(T::Array[::Assistantship]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Assistantship]) } + def target; end + + sig { returns(T::Array[::Assistantship]) } + def to_a; end + + sig { returns(T::Array[::Assistantship]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Assistantship } } + + sig { returns(T::Array[::Assistantship]) } + def to_a; end + + sig { returns(T::Array[::Assistantship]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Assistantship } } + + 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: ::Assistantship } } + + 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/available_point.rbi b/sorbet/rbi/dsl/available_point.rbi new file mode 100644 index 000000000..6226f7ff5 --- /dev/null +++ b/sorbet/rbi/dsl/available_point.rbi @@ -0,0 +1,1237 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `AvailablePoint`. +# Please instead update this file by running `bin/tapioca dsl AvailablePoint`. + + +class AvailablePoint + 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: ::AvailablePoint).void) + ).returns(::AvailablePoint) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::AvailablePoint).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: ::AvailablePoint).void)).returns(::AvailablePoint) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::AvailablePoint).void) + ).returns(T::Array[::AvailablePoint]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::AvailablePoint).void) + ).returns(::AvailablePoint) + 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: ::AvailablePoint).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::AvailablePoint).void)).returns(::AvailablePoint) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::AvailablePoint).void) + ).returns(T::Array[::AvailablePoint]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::AvailablePoint).void) + ).returns(::AvailablePoint) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::AvailablePoint).void)).returns(::AvailablePoint) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::AvailablePoint).void) + ).returns(T::Array[::AvailablePoint]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::AvailablePoint).void) + ).returns(::AvailablePoint) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::AvailablePoint).void) + ).returns(T::Array[::AvailablePoint]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::AvailablePoint).void) + ).returns(::AvailablePoint) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::AvailablePoint).void) + ).returns(T::Array[::AvailablePoint]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::AvailablePoint).void) + ).returns(::AvailablePoint) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::AvailablePoint]) } + def destroy_all; end + + sig { returns(T::Array[::AvailablePoint]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::AvailablePoint]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::AvailablePoint)) } + def fifth; end + + sig { returns(::AvailablePoint) } + 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(::AvailablePoint) + 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[::AvailablePoint]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::AvailablePoint).void + ).returns(T.nilable(::AvailablePoint)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::AvailablePoint)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::AvailablePoint) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::AvailablePoint).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::AvailablePoint]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::AvailablePoint]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::AvailablePoint]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::AvailablePoint).void) + ).returns(T::Array[::AvailablePoint]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::AvailablePoint).void) + ).returns(::AvailablePoint) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::AvailablePoint).void) + ).returns(T::Array[::AvailablePoint]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::AvailablePoint).void) + ).returns(::AvailablePoint) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::AvailablePoint).void) + ).returns(T::Array[::AvailablePoint]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::AvailablePoint).void) + ).returns(::AvailablePoint) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::AvailablePoint)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::AvailablePoint) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::AvailablePoint) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::AvailablePoint)) } + sig { params(limit: Integer).returns(T::Array[::AvailablePoint]) } + def first(limit = nil); end + + sig { returns(::AvailablePoint) } + def first!; end + + sig { returns(T.nilable(::AvailablePoint)) } + def forty_two; end + + sig { returns(::AvailablePoint) } + def forty_two!; end + + sig { returns(T.nilable(::AvailablePoint)) } + def fourth; end + + sig { returns(::AvailablePoint) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::AvailablePoint)) } + sig { params(limit: Integer).returns(T::Array[::AvailablePoint]) } + def last(limit = nil); end + + sig { returns(::AvailablePoint) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::AvailablePoint).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: ::AvailablePoint).void)).returns(::AvailablePoint) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::AvailablePoint).void) + ).returns(T::Array[::AvailablePoint]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::AvailablePoint).void) + ).returns(::AvailablePoint) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::AvailablePoint).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::AvailablePoint).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(::AvailablePoint)) } + def second; end + + sig { returns(::AvailablePoint) } + def second!; end + + sig { returns(T.nilable(::AvailablePoint)) } + def second_to_last; end + + sig { returns(::AvailablePoint) } + def second_to_last!; end + + sig { returns(::AvailablePoint) } + 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: ::AvailablePoint).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::AvailablePoint)) } + sig { params(limit: Integer).returns(T::Array[::AvailablePoint]) } + def take(limit = nil); end + + sig { returns(::AvailablePoint) } + def take!; end + + sig { returns(T.nilable(::AvailablePoint)) } + def third; end + + sig { returns(::AvailablePoint) } + def third!; end + + sig { returns(T.nilable(::AvailablePoint)) } + def third_to_last; end + + sig { returns(::AvailablePoint) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def build_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Exercise) } + def build_exercise(*args, &blk); end + + sig { returns(T.nilable(::Course)) } + def course; end + + sig { params(value: T.nilable(::Course)).void } + def course=(value); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Exercise) } + def create_exercise(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Exercise) } + def create_exercise!(*args, &blk); end + + sig { returns(T.nilable(::Exercise)) } + def exercise; end + + sig { params(value: T.nilable(::Exercise)).void } + def exercise=(value); end + + sig { returns(T::Boolean) } + def exercise_changed?; end + + sig { returns(T::Boolean) } + def exercise_previously_changed?; end + + sig { returns(T.nilable(::Course)) } + def reload_course; end + + sig { returns(T.nilable(::Exercise)) } + def reload_exercise; end + + sig { void } + def reset_course; end + + sig { void } + def reset_exercise; 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 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: ::AvailablePoint).returns(BasicObject) + ).returns(T::Array[::AvailablePoint]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::Integer) } + def exercise_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def exercise_id=(value); end + + sig { returns(T::Boolean) } + def exercise_id?; end + + sig { returns(T.nilable(::Integer)) } + def exercise_id_before_last_save; end + + sig { returns(T.untyped) } + def exercise_id_before_type_cast; end + + sig { returns(T::Boolean) } + def exercise_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def exercise_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def exercise_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def exercise_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def exercise_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def exercise_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def exercise_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def exercise_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def exercise_id_was; end + + sig { void } + def exercise_id_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 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(T::Boolean) } + def requires_review; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def requires_review=(value); end + + sig { returns(T::Boolean) } + def requires_review?; end + + sig { returns(T.nilable(T::Boolean)) } + def requires_review_before_last_save; end + + sig { returns(T.untyped) } + def requires_review_before_type_cast; end + + sig { returns(T::Boolean) } + def requires_review_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def requires_review_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def requires_review_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def requires_review_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def requires_review_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def requires_review_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def requires_review_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def requires_review_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def requires_review_was; end + + sig { void } + def requires_review_will_change!; end + + sig { void } + def restore_exercise_id!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_name!; end + + sig { void } + def restore_requires_review!; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_exercise_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_exercise_id?(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_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::Boolean, T::Boolean])) } + def saved_change_to_requires_review; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_requires_review?(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_exercise_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?(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_requires_review?(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 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: ::AvailablePoint).returns(BasicObject) + ).returns(T::Array[::AvailablePoint]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::AvailablePoint } } + + sig { returns(T::Array[::AvailablePoint]) } + def to_a; end + + sig { returns(T::Array[::AvailablePoint]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::AvailablePoint } } + + 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: ::AvailablePoint } } + + 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: ::AvailablePoint } } + + sig do + params( + records: T.any(::AvailablePoint, T::Enumerable[T.any(::AvailablePoint, T::Enumerable[::AvailablePoint])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::AvailablePoint, T::Enumerable[T.any(::AvailablePoint, T::Enumerable[::AvailablePoint])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::AvailablePoint, T::Enumerable[T.any(::AvailablePoint, T::Enumerable[::AvailablePoint])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::AvailablePoint, Integer, String, T::Enumerable[T.any(::AvailablePoint, Integer, String, T::Enumerable[::AvailablePoint])]) + ).returns(T::Array[::AvailablePoint]) + end + def delete(*records); end + + sig do + params( + records: T.any(::AvailablePoint, Integer, String, T::Enumerable[T.any(::AvailablePoint, Integer, String, T::Enumerable[::AvailablePoint])]) + ).returns(T::Array[::AvailablePoint]) + end + def destroy(*records); end + + sig { returns(T::Array[::AvailablePoint]) } + def load_target; end + + sig do + params( + records: T.any(::AvailablePoint, T::Enumerable[T.any(::AvailablePoint, T::Enumerable[::AvailablePoint])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::AvailablePoint, T::Enumerable[T.any(::AvailablePoint, T::Enumerable[::AvailablePoint])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::AvailablePoint, T::Enumerable[T.any(::AvailablePoint, T::Enumerable[::AvailablePoint])]) + ).returns(T::Array[::AvailablePoint]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::AvailablePoint]) } + def target; end + + sig { returns(T::Array[::AvailablePoint]) } + def to_a; end + + sig { returns(T::Array[::AvailablePoint]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::AvailablePoint } } + + sig { returns(T::Array[::AvailablePoint]) } + def to_a; end + + sig { returns(T::Array[::AvailablePoint]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::AvailablePoint } } + + 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: ::AvailablePoint } } + + 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/awarded_point.rbi b/sorbet/rbi/dsl/awarded_point.rbi new file mode 100644 index 000000000..b62116fea --- /dev/null +++ b/sorbet/rbi/dsl/awarded_point.rbi @@ -0,0 +1,1433 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `AwardedPoint`. +# Please instead update this file by running `bin/tapioca dsl AwardedPoint`. + + +class AwardedPoint + 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: ::AwardedPoint).void) + ).returns(::AwardedPoint) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::AwardedPoint).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: ::AwardedPoint).void)).returns(::AwardedPoint) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::AwardedPoint).void) + ).returns(T::Array[::AwardedPoint]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::AwardedPoint).void) + ).returns(::AwardedPoint) + 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: ::AwardedPoint).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::AwardedPoint).void)).returns(::AwardedPoint) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::AwardedPoint).void) + ).returns(T::Array[::AwardedPoint]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::AwardedPoint).void) + ).returns(::AwardedPoint) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::AwardedPoint).void)).returns(::AwardedPoint) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::AwardedPoint).void) + ).returns(T::Array[::AwardedPoint]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::AwardedPoint).void) + ).returns(::AwardedPoint) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::AwardedPoint).void) + ).returns(T::Array[::AwardedPoint]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::AwardedPoint).void) + ).returns(::AwardedPoint) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::AwardedPoint).void) + ).returns(T::Array[::AwardedPoint]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::AwardedPoint).void) + ).returns(::AwardedPoint) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::AwardedPoint]) } + def destroy_all; end + + sig { returns(T::Array[::AwardedPoint]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::AwardedPoint]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::AwardedPoint)) } + def fifth; end + + sig { returns(::AwardedPoint) } + 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(::AwardedPoint) + 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[::AwardedPoint]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::AwardedPoint).void + ).returns(T.nilable(::AwardedPoint)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::AwardedPoint)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::AwardedPoint) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::AwardedPoint).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::AwardedPoint]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::AwardedPoint]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::AwardedPoint]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::AwardedPoint).void) + ).returns(T::Array[::AwardedPoint]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::AwardedPoint).void) + ).returns(::AwardedPoint) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::AwardedPoint).void) + ).returns(T::Array[::AwardedPoint]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::AwardedPoint).void) + ).returns(::AwardedPoint) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::AwardedPoint).void) + ).returns(T::Array[::AwardedPoint]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::AwardedPoint).void) + ).returns(::AwardedPoint) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::AwardedPoint)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::AwardedPoint) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::AwardedPoint) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::AwardedPoint)) } + sig { params(limit: Integer).returns(T::Array[::AwardedPoint]) } + def first(limit = nil); end + + sig { returns(::AwardedPoint) } + def first!; end + + sig { returns(T.nilable(::AwardedPoint)) } + def forty_two; end + + sig { returns(::AwardedPoint) } + def forty_two!; end + + sig { returns(T.nilable(::AwardedPoint)) } + def fourth; end + + sig { returns(::AwardedPoint) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::AwardedPoint)) } + sig { params(limit: Integer).returns(T::Array[::AwardedPoint]) } + def last(limit = nil); end + + sig { returns(::AwardedPoint) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::AwardedPoint).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: ::AwardedPoint).void)).returns(::AwardedPoint) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::AwardedPoint).void) + ).returns(T::Array[::AwardedPoint]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::AwardedPoint).void) + ).returns(::AwardedPoint) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::AwardedPoint).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::AwardedPoint).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(::AwardedPoint)) } + def second; end + + sig { returns(::AwardedPoint) } + def second!; end + + sig { returns(T.nilable(::AwardedPoint)) } + def second_to_last; end + + sig { returns(::AwardedPoint) } + def second_to_last!; end + + sig { returns(::AwardedPoint) } + 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: ::AwardedPoint).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::AwardedPoint)) } + sig { params(limit: Integer).returns(T::Array[::AwardedPoint]) } + def take(limit = nil); end + + sig { returns(::AwardedPoint) } + def take!; end + + sig { returns(T.nilable(::AwardedPoint)) } + def third; end + + sig { returns(::AwardedPoint) } + def third!; end + + sig { returns(T.nilable(::AwardedPoint)) } + def third_to_last; end + + sig { returns(::AwardedPoint) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def build_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Submission) } + def build_submission(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def build_user(*args, &blk); end + + sig { returns(T.nilable(::Course)) } + def course; end + + sig { params(value: T.nilable(::Course)).void } + def course=(value); end + + sig { returns(T::Boolean) } + def course_changed?; end + + sig { returns(T::Boolean) } + def course_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Submission) } + def create_submission(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Submission) } + def create_submission!(*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(::Course)) } + def reload_course; end + + sig { returns(T.nilable(::Submission)) } + def reload_submission; end + + sig { returns(T.nilable(::User)) } + def reload_user; end + + sig { void } + def reset_course; end + + sig { void } + def reset_submission; end + + sig { void } + def reset_user; end + + sig { returns(T.nilable(::Submission)) } + def submission; end + + sig { params(value: T.nilable(::Submission)).void } + def submission=(value); end + + sig { returns(T::Boolean) } + def submission_changed?; end + + sig { returns(T::Boolean) } + def submission_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 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: ::AwardedPoint).returns(BasicObject)).returns(T::Array[::AwardedPoint]) } + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T::Boolean) } + def awarded_after_soft_deadline; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def awarded_after_soft_deadline=(value); end + + sig { returns(T::Boolean) } + def awarded_after_soft_deadline?; end + + sig { returns(T.nilable(T::Boolean)) } + def awarded_after_soft_deadline_before_last_save; end + + sig { returns(T.untyped) } + def awarded_after_soft_deadline_before_type_cast; end + + sig { returns(T::Boolean) } + def awarded_after_soft_deadline_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def awarded_after_soft_deadline_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def awarded_after_soft_deadline_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def awarded_after_soft_deadline_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def awarded_after_soft_deadline_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def awarded_after_soft_deadline_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def awarded_after_soft_deadline_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def awarded_after_soft_deadline_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def awarded_after_soft_deadline_was; end + + sig { void } + def awarded_after_soft_deadline_will_change!; end + + sig { returns(::Integer) } + def course_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def course_id=(value); end + + sig { returns(T::Boolean) } + def course_id?; end + + sig { returns(T.nilable(::Integer)) } + def course_id_before_last_save; end + + sig { returns(T.untyped) } + def course_id_before_type_cast; end + + sig { returns(T::Boolean) } + def course_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def course_id_was; end + + sig { void } + def course_id_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 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 { void } + def restore_awarded_after_soft_deadline!; end + + sig { void } + def restore_course_id!; 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_name!; end + + sig { void } + def restore_submission_id!; end + + sig { void } + def restore_user_id!; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_awarded_after_soft_deadline; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_awarded_after_soft_deadline?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_course_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_course_id?(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_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_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_submission_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_submission_id?(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(T.nilable(::Integer)) } + def submission_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def submission_id=(value); end + + sig { returns(T::Boolean) } + def submission_id?; end + + sig { returns(T.nilable(::Integer)) } + def submission_id_before_last_save; end + + sig { returns(T.untyped) } + def submission_id_before_type_cast; end + + sig { returns(T::Boolean) } + def submission_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def submission_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def submission_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def submission_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def submission_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def submission_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def submission_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def submission_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def submission_id_was; end + + sig { void } + def submission_id_will_change!; 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_awarded_after_soft_deadline?(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_course_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_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_submission_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_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 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: ::AwardedPoint).returns(BasicObject)).returns(T::Array[::AwardedPoint]) } + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::AwardedPoint } } + + sig { returns(T::Array[::AwardedPoint]) } + def to_a; end + + sig { returns(T::Array[::AwardedPoint]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::AwardedPoint } } + + 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: ::AwardedPoint } } + + 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: ::AwardedPoint } } + + sig do + params( + records: T.any(::AwardedPoint, T::Enumerable[T.any(::AwardedPoint, T::Enumerable[::AwardedPoint])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::AwardedPoint, T::Enumerable[T.any(::AwardedPoint, T::Enumerable[::AwardedPoint])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::AwardedPoint, T::Enumerable[T.any(::AwardedPoint, T::Enumerable[::AwardedPoint])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::AwardedPoint, Integer, String, T::Enumerable[T.any(::AwardedPoint, Integer, String, T::Enumerable[::AwardedPoint])]) + ).returns(T::Array[::AwardedPoint]) + end + def delete(*records); end + + sig do + params( + records: T.any(::AwardedPoint, Integer, String, T::Enumerable[T.any(::AwardedPoint, Integer, String, T::Enumerable[::AwardedPoint])]) + ).returns(T::Array[::AwardedPoint]) + end + def destroy(*records); end + + sig { returns(T::Array[::AwardedPoint]) } + def load_target; end + + sig do + params( + records: T.any(::AwardedPoint, T::Enumerable[T.any(::AwardedPoint, T::Enumerable[::AwardedPoint])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::AwardedPoint, T::Enumerable[T.any(::AwardedPoint, T::Enumerable[::AwardedPoint])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::AwardedPoint, T::Enumerable[T.any(::AwardedPoint, T::Enumerable[::AwardedPoint])]) + ).returns(T::Array[::AwardedPoint]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::AwardedPoint]) } + def target; end + + sig { returns(T::Array[::AwardedPoint]) } + def to_a; end + + sig { returns(T::Array[::AwardedPoint]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::AwardedPoint } } + + sig { returns(T::Array[::AwardedPoint]) } + def to_a; end + + sig { returns(T::Array[::AwardedPoint]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::AwardedPoint } } + + 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: ::AwardedPoint } } + + 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/banned_email.rbi b/sorbet/rbi/dsl/banned_email.rbi new file mode 100644 index 000000000..7dc482109 --- /dev/null +++ b/sorbet/rbi/dsl/banned_email.rbi @@ -0,0 +1,1173 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `BannedEmail`. +# Please instead update this file by running `bin/tapioca dsl BannedEmail`. + + +class BannedEmail + 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: ::BannedEmail).void) + ).returns(::BannedEmail) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::BannedEmail).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: ::BannedEmail).void)).returns(::BannedEmail) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::BannedEmail).void) + ).returns(T::Array[::BannedEmail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::BannedEmail).void) + ).returns(::BannedEmail) + 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: ::BannedEmail).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::BannedEmail).void)).returns(::BannedEmail) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::BannedEmail).void) + ).returns(T::Array[::BannedEmail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::BannedEmail).void) + ).returns(::BannedEmail) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::BannedEmail).void)).returns(::BannedEmail) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::BannedEmail).void) + ).returns(T::Array[::BannedEmail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::BannedEmail).void) + ).returns(::BannedEmail) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::BannedEmail).void) + ).returns(T::Array[::BannedEmail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::BannedEmail).void) + ).returns(::BannedEmail) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::BannedEmail).void) + ).returns(T::Array[::BannedEmail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::BannedEmail).void) + ).returns(::BannedEmail) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::BannedEmail]) } + def destroy_all; end + + sig { returns(T::Array[::BannedEmail]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::BannedEmail]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::BannedEmail)) } + def fifth; end + + sig { returns(::BannedEmail) } + 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(::BannedEmail) + 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[::BannedEmail]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::BannedEmail).void).returns(T.nilable(::BannedEmail)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::BannedEmail)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::BannedEmail) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::BannedEmail).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::BannedEmail]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::BannedEmail]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::BannedEmail]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::BannedEmail).void) + ).returns(T::Array[::BannedEmail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::BannedEmail).void) + ).returns(::BannedEmail) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::BannedEmail).void) + ).returns(T::Array[::BannedEmail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::BannedEmail).void) + ).returns(::BannedEmail) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::BannedEmail).void) + ).returns(T::Array[::BannedEmail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::BannedEmail).void) + ).returns(::BannedEmail) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::BannedEmail)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::BannedEmail) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::BannedEmail) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::BannedEmail)) } + sig { params(limit: Integer).returns(T::Array[::BannedEmail]) } + def first(limit = nil); end + + sig { returns(::BannedEmail) } + def first!; end + + sig { returns(T.nilable(::BannedEmail)) } + def forty_two; end + + sig { returns(::BannedEmail) } + def forty_two!; end + + sig { returns(T.nilable(::BannedEmail)) } + def fourth; end + + sig { returns(::BannedEmail) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::BannedEmail)) } + sig { params(limit: Integer).returns(T::Array[::BannedEmail]) } + def last(limit = nil); end + + sig { returns(::BannedEmail) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::BannedEmail).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: ::BannedEmail).void)).returns(::BannedEmail) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::BannedEmail).void) + ).returns(T::Array[::BannedEmail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::BannedEmail).void) + ).returns(::BannedEmail) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::BannedEmail).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::BannedEmail).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(::BannedEmail)) } + def second; end + + sig { returns(::BannedEmail) } + def second!; end + + sig { returns(T.nilable(::BannedEmail)) } + def second_to_last; end + + sig { returns(::BannedEmail) } + def second_to_last!; end + + sig { returns(::BannedEmail) } + 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: ::BannedEmail).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::BannedEmail)) } + sig { params(limit: Integer).returns(T::Array[::BannedEmail]) } + def take(limit = nil); end + + sig { returns(::BannedEmail) } + def take!; end + + sig { returns(T.nilable(::BannedEmail)) } + def third; end + + sig { returns(::BannedEmail) } + def third!; end + + sig { returns(T.nilable(::BannedEmail)) } + def third_to_last; end + + sig { returns(::BannedEmail) } + def third_to_last!; 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 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: ::BannedEmail).returns(BasicObject)).returns(T::Array[::BannedEmail]) } + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 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(::String) } + def email; end + + sig { params(value: ::String).returns(::String) } + def email=(value); end + + sig { returns(T::Boolean) } + def email?; end + + sig { returns(T.nilable(::String)) } + def email_before_last_save; end + + sig { returns(T.untyped) } + def email_before_type_cast; end + + sig { returns(T::Boolean) } + def email_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def email_change; end + + sig { returns(T.nilable([::String, ::String])) } + def email_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def email_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def email_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def email_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def email_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def email_previously_was; end + + sig { returns(T.nilable(::String)) } + def email_was; end + + sig { void } + def email_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 { void } + def restore_created_at!; end + + sig { void } + def restore_email!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; 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([::String, ::String])) } + def saved_change_to_email; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_email?(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([::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_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_email?(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_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 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: ::BannedEmail).returns(BasicObject)).returns(T::Array[::BannedEmail]) } + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::BannedEmail } } + + sig { returns(T::Array[::BannedEmail]) } + def to_a; end + + sig { returns(T::Array[::BannedEmail]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::BannedEmail } } + + 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: ::BannedEmail } } + + 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: ::BannedEmail } } + + sig do + params( + records: T.any(::BannedEmail, T::Enumerable[T.any(::BannedEmail, T::Enumerable[::BannedEmail])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::BannedEmail, T::Enumerable[T.any(::BannedEmail, T::Enumerable[::BannedEmail])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::BannedEmail, T::Enumerable[T.any(::BannedEmail, T::Enumerable[::BannedEmail])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::BannedEmail, Integer, String, T::Enumerable[T.any(::BannedEmail, Integer, String, T::Enumerable[::BannedEmail])]) + ).returns(T::Array[::BannedEmail]) + end + def delete(*records); end + + sig do + params( + records: T.any(::BannedEmail, Integer, String, T::Enumerable[T.any(::BannedEmail, Integer, String, T::Enumerable[::BannedEmail])]) + ).returns(T::Array[::BannedEmail]) + end + def destroy(*records); end + + sig { returns(T::Array[::BannedEmail]) } + def load_target; end + + sig do + params( + records: T.any(::BannedEmail, T::Enumerable[T.any(::BannedEmail, T::Enumerable[::BannedEmail])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::BannedEmail, T::Enumerable[T.any(::BannedEmail, T::Enumerable[::BannedEmail])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::BannedEmail, T::Enumerable[T.any(::BannedEmail, T::Enumerable[::BannedEmail])]) + ).returns(T::Array[::BannedEmail]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::BannedEmail]) } + def target; end + + sig { returns(T::Array[::BannedEmail]) } + def to_a; end + + sig { returns(T::Array[::BannedEmail]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::BannedEmail } } + + sig { returns(T::Array[::BannedEmail]) } + def to_a; end + + sig { returns(T::Array[::BannedEmail]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::BannedEmail } } + + 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: ::BannedEmail } } + + 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/can_can/controller_additions.rbi b/sorbet/rbi/dsl/can_can/controller_additions.rbi new file mode 100644 index 000000000..0b8df0ee2 --- /dev/null +++ b/sorbet/rbi/dsl/can_can/controller_additions.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `CanCan::ControllerAdditions`. +# Please instead update this file by running `bin/tapioca dsl CanCan::ControllerAdditions`. + + +module CanCan::ControllerAdditions + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def _cancan_skipper; end + def _cancan_skipper=(value); end + def _cancan_skipper?; end + end + + module GeneratedInstanceMethods + def _cancan_skipper; end + def _cancan_skipper=(value); end + def _cancan_skipper?; end + end +end diff --git a/sorbet/rbi/dsl/certificate.rbi b/sorbet/rbi/dsl/certificate.rbi new file mode 100644 index 000000000..d4300be1c --- /dev/null +++ b/sorbet/rbi/dsl/certificate.rbi @@ -0,0 +1,1401 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Certificate`. +# Please instead update this file by running `bin/tapioca dsl Certificate`. + + +class Certificate + 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: ::Certificate).void) + ).returns(::Certificate) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::Certificate).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: ::Certificate).void)).returns(::Certificate) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Certificate).void) + ).returns(T::Array[::Certificate]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Certificate).void) + ).returns(::Certificate) + 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: ::Certificate).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Certificate).void)).returns(::Certificate) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Certificate).void) + ).returns(T::Array[::Certificate]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Certificate).void) + ).returns(::Certificate) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Certificate).void)).returns(::Certificate) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Certificate).void) + ).returns(T::Array[::Certificate]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Certificate).void) + ).returns(::Certificate) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Certificate).void) + ).returns(T::Array[::Certificate]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Certificate).void) + ).returns(::Certificate) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Certificate).void) + ).returns(T::Array[::Certificate]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Certificate).void) + ).returns(::Certificate) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::Certificate]) } + def destroy_all; end + + sig { returns(T::Array[::Certificate]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Certificate]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Certificate)) } + def fifth; end + + sig { returns(::Certificate) } + 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(::Certificate) + 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[::Certificate]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::Certificate).void).returns(T.nilable(::Certificate)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Certificate)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Certificate) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::Certificate).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::Certificate]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::Certificate]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::Certificate]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Certificate).void) + ).returns(T::Array[::Certificate]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Certificate).void) + ).returns(::Certificate) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Certificate).void) + ).returns(T::Array[::Certificate]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Certificate).void) + ).returns(::Certificate) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Certificate).void) + ).returns(T::Array[::Certificate]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Certificate).void) + ).returns(::Certificate) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Certificate)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Certificate) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Certificate) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Certificate)) } + sig { params(limit: Integer).returns(T::Array[::Certificate]) } + def first(limit = nil); end + + sig { returns(::Certificate) } + def first!; end + + sig { returns(T.nilable(::Certificate)) } + def forty_two; end + + sig { returns(::Certificate) } + def forty_two!; end + + sig { returns(T.nilable(::Certificate)) } + def fourth; end + + sig { returns(::Certificate) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::Certificate)) } + sig { params(limit: Integer).returns(T::Array[::Certificate]) } + def last(limit = nil); end + + sig { returns(::Certificate) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::Certificate).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: ::Certificate).void)).returns(::Certificate) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Certificate).void) + ).returns(T::Array[::Certificate]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Certificate).void) + ).returns(::Certificate) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Certificate).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Certificate).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(::Certificate)) } + def second; end + + sig { returns(::Certificate) } + def second!; end + + sig { returns(T.nilable(::Certificate)) } + def second_to_last; end + + sig { returns(::Certificate) } + def second_to_last!; end + + sig { returns(::Certificate) } + 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: ::Certificate).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Certificate)) } + sig { params(limit: Integer).returns(T::Array[::Certificate]) } + def take(limit = nil); end + + sig { returns(::Certificate) } + def take!; end + + sig { returns(T.nilable(::Certificate)) } + def third; end + + sig { returns(::Certificate) } + def third!; end + + sig { returns(T.nilable(::Certificate)) } + def third_to_last; end + + sig { returns(::Certificate) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def build_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def build_user(*args, &blk); end + + sig { returns(T.nilable(::Course)) } + def course; end + + sig { params(value: T.nilable(::Course)).void } + def course=(value); end + + sig { returns(T::Boolean) } + def course_changed?; end + + sig { returns(T::Boolean) } + def course_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course!(*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(::Course)) } + def reload_course; end + + sig { returns(T.nilable(::User)) } + def reload_user; end + + sig { void } + def reset_course; 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 { 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 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: ::Certificate).returns(BasicObject)).returns(T::Array[::Certificate]) } + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.nilable(::Integer)) } + def course_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def course_id=(value); end + + sig { returns(T::Boolean) } + def course_id?; end + + sig { returns(T.nilable(::Integer)) } + def course_id_before_last_save; end + + sig { returns(T.untyped) } + def course_id_before_type_cast; end + + sig { returns(T::Boolean) } + def course_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def course_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def course_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def course_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def course_id_was; end + + sig { void } + def course_id_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 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(::String)) } + def pdf; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def pdf=(value); end + + sig { returns(T::Boolean) } + def pdf?; end + + sig { returns(T.nilable(::String)) } + def pdf_before_last_save; end + + sig { returns(T.untyped) } + def pdf_before_type_cast; end + + sig { returns(T::Boolean) } + def pdf_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def pdf_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def pdf_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def pdf_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def pdf_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def pdf_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def pdf_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def pdf_previously_was; end + + sig { returns(T.nilable(::String)) } + def pdf_was; end + + sig { void } + def pdf_will_change!; end + + sig { void } + def restore_course_id!; 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_name!; end + + sig { void } + def restore_pdf!; end + + sig { void } + def restore_updated_at!; end + + sig { void } + def restore_user_id!; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_course_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_course_id?(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_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_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(::String), T.nilable(::String)])) } + def saved_change_to_pdf; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_pdf?(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_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(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_course_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_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_pdf?(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 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: ::Certificate).returns(BasicObject)).returns(T::Array[::Certificate]) } + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Certificate } } + + sig { returns(T::Array[::Certificate]) } + def to_a; end + + sig { returns(T::Array[::Certificate]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Certificate } } + + 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: ::Certificate } } + + 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: ::Certificate } } + + sig do + params( + records: T.any(::Certificate, T::Enumerable[T.any(::Certificate, T::Enumerable[::Certificate])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Certificate, T::Enumerable[T.any(::Certificate, T::Enumerable[::Certificate])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Certificate, T::Enumerable[T.any(::Certificate, T::Enumerable[::Certificate])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::Certificate, Integer, String, T::Enumerable[T.any(::Certificate, Integer, String, T::Enumerable[::Certificate])]) + ).returns(T::Array[::Certificate]) + end + def delete(*records); end + + sig do + params( + records: T.any(::Certificate, Integer, String, T::Enumerable[T.any(::Certificate, Integer, String, T::Enumerable[::Certificate])]) + ).returns(T::Array[::Certificate]) + end + def destroy(*records); end + + sig { returns(T::Array[::Certificate]) } + def load_target; end + + sig do + params( + records: T.any(::Certificate, T::Enumerable[T.any(::Certificate, T::Enumerable[::Certificate])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Certificate, T::Enumerable[T.any(::Certificate, T::Enumerable[::Certificate])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Certificate, T::Enumerable[T.any(::Certificate, T::Enumerable[::Certificate])]) + ).returns(T::Array[::Certificate]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Certificate]) } + def target; end + + sig { returns(T::Array[::Certificate]) } + def to_a; end + + sig { returns(T::Array[::Certificate]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Certificate } } + + sig { returns(T::Array[::Certificate]) } + def to_a; end + + sig { returns(T::Array[::Certificate]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Certificate } } + + 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: ::Certificate } } + + 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/course.rbi b/sorbet/rbi/dsl/course.rbi new file mode 100644 index 000000000..db45b08af --- /dev/null +++ b/sorbet/rbi/dsl/course.rbi @@ -0,0 +1,3188 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Course`. +# Please instead update this file by running `bin/tapioca dsl Course`. + + +class Course + include GeneratedAssociationMethods + include GeneratedAttributeMethods + include EnumMethodsModule + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig { returns(T::Hash[T.any(String, Symbol), Integer]) } + def disabled_statuses; end + + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Course).void)).returns(::Course) } + def new(attributes = nil, &block); end + + sig { returns(T::Hash[T.any(String, Symbol), Integer]) } + def paste_visibilities; end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::Course).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: ::Course).void)).returns(::Course) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Course).void) + ).returns(T::Array[::Course]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Course).void)).returns(::Course) } + 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: ::Course).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Course).void)).returns(::Course) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Course).void) + ).returns(T::Array[::Course]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Course).void)).returns(::Course) } + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Course).void)).returns(::Course) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Course).void) + ).returns(T::Array[::Course]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Course).void)).returns(::Course) } + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Course).void) + ).returns(T::Array[::Course]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Course).void)).returns(::Course) } + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Course).void) + ).returns(T::Array[::Course]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Course).void)).returns(::Course) } + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::Course]) } + def destroy_all; end + + sig { returns(T::Array[::Course]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Course]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Course)) } + def fifth; end + + sig { returns(::Course) } + 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(::Course) + 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[::Course]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::Course).void).returns(T.nilable(::Course)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Course)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Course) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::Course).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::Course]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::Course]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::Course]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Course).void) + ).returns(T::Array[::Course]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Course).void)).returns(::Course) } + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Course).void) + ).returns(T::Array[::Course]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Course).void)).returns(::Course) } + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Course).void) + ).returns(T::Array[::Course]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Course).void)).returns(::Course) } + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Course)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Course) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Course) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Course)) } + sig { params(limit: Integer).returns(T::Array[::Course]) } + def first(limit = nil); end + + sig { returns(::Course) } + def first!; end + + sig { returns(T.nilable(::Course)) } + def forty_two; end + + sig { returns(::Course) } + def forty_two!; end + + sig { returns(T.nilable(::Course)) } + def fourth; end + + sig { returns(::Course) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::Course)) } + sig { params(limit: Integer).returns(T::Array[::Course]) } + def last(limit = nil); end + + sig { returns(::Course) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::Course).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: ::Course).void)).returns(::Course) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Course).void) + ).returns(T::Array[::Course]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Course).void)).returns(::Course) } + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Course).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Course).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(::Course)) } + def second; end + + sig { returns(::Course) } + def second!; end + + sig { returns(T.nilable(::Course)) } + def second_to_last; end + + sig { returns(::Course) } + def second_to_last!; end + + sig { returns(::Course) } + 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: ::Course).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Course)) } + sig { params(limit: Integer).returns(T::Array[::Course]) } + def take(limit = nil); end + + sig { returns(::Course) } + def take!; end + + sig { returns(T.nilable(::Course)) } + def third; end + + sig { returns(::Course) } + def third!; end + + sig { returns(T.nilable(::Course)) } + def third_to_last; end + + sig { returns(::Course) } + def third_to_last!; end + end + + module EnumMethodsModule + sig { void } + def completed_only!; end + + sig { returns(T::Boolean) } + def completed_only?; end + + sig { void } + def disabled!; end + + sig { returns(T::Boolean) } + def disabled?; end + + sig { void } + def enabled!; end + + sig { returns(T::Boolean) } + def enabled?; end + + sig { void } + def everyone!; end + + sig { returns(T::Boolean) } + def everyone?; end + + sig { void } + def no_tests_public!; end + + sig { returns(T::Boolean) } + def no_tests_public?; end + + sig { void } + def open!; end + + sig { returns(T::Boolean) } + def open?; end + + sig { void } + def secured!; end + + sig { returns(T::Boolean) } + def secured?; end + end + + module GeneratedAssociationMethods + sig { returns(T::Array[T.untyped]) } + def assistant_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def assistant_ids=(ids); end + + # This method is created by ActiveRecord on the `Course` class because it declared `has_many :assistants, through: :assistantships`. + # 🔗 [Rails guide for `has_many_through` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-through-association) + sig { returns(::User::PrivateCollectionProxy) } + def assistants; end + + sig { params(value: T::Enumerable[::User]).void } + def assistants=(value); end + + sig { returns(T::Array[T.untyped]) } + def assistantship_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def assistantship_ids=(ids); end + + # This method is created by ActiveRecord on the `Course` class because it declared `has_many :assistantships`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Assistantship::PrivateCollectionProxy) } + def assistantships; end + + sig { params(value: T::Enumerable[::Assistantship]).void } + def assistantships=(value); end + + sig { returns(T::Array[T.untyped]) } + def available_point_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def available_point_ids=(ids); end + + # This method is created by ActiveRecord on the `Course` class because it declared `has_many :available_points, through: :exercises`. + # 🔗 [Rails guide for `has_many_through` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-through-association) + sig { returns(::AvailablePoint::PrivateCollectionProxy) } + def available_points; end + + sig { params(value: T::Enumerable[::AvailablePoint]).void } + def available_points=(value); end + + sig { returns(T::Array[T.untyped]) } + def awarded_point_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def awarded_point_ids=(ids); end + + # This method is created by ActiveRecord on the `Course` class because it declared `has_many :awarded_points`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::AwardedPoint::PrivateCollectionProxy) } + def awarded_points; end + + sig { params(value: T::Enumerable[::AwardedPoint]).void } + def awarded_points=(value); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::CourseTemplate) } + def build_course_template(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Organization) } + def build_organization(*args, &blk); end + + sig { returns(T::Array[T.untyped]) } + def certificate_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def certificate_ids=(ids); end + + # This method is created by ActiveRecord on the `Course` class because it declared `has_many :certificates`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Certificate::PrivateCollectionProxy) } + def certificates; end + + sig { params(value: T::Enumerable[::Certificate]).void } + def certificates=(value); end + + sig { returns(T::Array[T.untyped]) } + def course_notification_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def course_notification_ids=(ids); end + + # This method is created by ActiveRecord on the `Course` class because it declared `has_many :course_notifications`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::CourseNotification::PrivateCollectionProxy) } + def course_notifications; end + + sig { params(value: T::Enumerable[::CourseNotification]).void } + def course_notifications=(value); end + + sig { returns(T.nilable(::CourseTemplate)) } + def course_template; end + + sig { params(value: T.nilable(::CourseTemplate)).void } + def course_template=(value); end + + sig { returns(T::Boolean) } + def course_template_changed?; end + + sig { returns(T::Boolean) } + def course_template_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(::CourseTemplate) } + def create_course_template(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::CourseTemplate) } + def create_course_template!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Organization) } + def create_organization(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Organization) } + def create_organization!(*args, &blk); end + + sig { returns(T::Array[T.untyped]) } + def exercise_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def exercise_ids=(ids); end + + # This method is created by ActiveRecord on the `Course` class because it declared `has_many :exercises`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Exercise::PrivateCollectionProxy) } + def exercises; end + + sig { params(value: T::Enumerable[::Exercise]).void } + def exercises=(value); end + + sig { returns(T::Array[T.untyped]) } + def feedback_answer_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def feedback_answer_ids=(ids); end + + # This method is created by ActiveRecord on the `Course` class because it declared `has_many :feedback_answers`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::FeedbackAnswer::PrivateCollectionProxy) } + def feedback_answers; end + + sig { params(value: T::Enumerable[::FeedbackAnswer]).void } + def feedback_answers=(value); end + + sig { returns(T::Array[T.untyped]) } + def feedback_question_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def feedback_question_ids=(ids); end + + # This method is created by ActiveRecord on the `Course` class because it declared `has_many :feedback_questions`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::FeedbackQuestion::PrivateCollectionProxy) } + def feedback_questions; end + + sig { params(value: T::Enumerable[::FeedbackQuestion]).void } + def feedback_questions=(value); end + + sig { returns(T.nilable(::Organization)) } + def organization; end + + sig { params(value: T.nilable(::Organization)).void } + def organization=(value); end + + sig { returns(T::Boolean) } + def organization_changed?; end + + sig { returns(T::Boolean) } + def organization_previously_changed?; end + + sig { returns(T.nilable(::CourseTemplate)) } + def reload_course_template; end + + sig { returns(T.nilable(::Organization)) } + def reload_organization; end + + sig { void } + def reset_course_template; end + + sig { void } + def reset_organization; end + + sig { returns(T::Array[T.untyped]) } + def submission_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def submission_ids=(ids); end + + # This method is created by ActiveRecord on the `Course` class because it declared `has_many :submissions`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Submission::PrivateCollectionProxy) } + def submissions; end + + sig { params(value: T::Enumerable[::Submission]).void } + def submissions=(value); end + + sig { returns(T::Array[T.untyped]) } + def uncomputed_unlock_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def uncomputed_unlock_ids=(ids); end + + # This method is created by ActiveRecord on the `Course` class because it declared `has_many :uncomputed_unlocks`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::UncomputedUnlock::PrivateCollectionProxy) } + def uncomputed_unlocks; end + + sig { params(value: T::Enumerable[::UncomputedUnlock]).void } + def uncomputed_unlocks=(value); end + + sig { returns(T::Array[T.untyped]) } + def unlock_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def unlock_ids=(ids); end + + # This method is created by ActiveRecord on the `Course` class because it declared `has_many :unlocks`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Unlock::PrivateCollectionProxy) } + def unlocks; end + + sig { params(value: T::Enumerable[::Unlock]).void } + def unlocks=(value); end + + sig { returns(T::Array[T.untyped]) } + def user_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def user_ids=(ids); end + + # This method is created by ActiveRecord on the `Course` class because it declared `has_many :users, through: :submissions`. + # 🔗 [Rails guide for `has_many_through` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-through-association) + sig { returns(::User::PrivateCollectionProxy) } + def users; end + + sig { params(value: T::Enumerable[::User]).void } + def users=(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 assisted_courses(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def completed_only(*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 disabled(*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 enabled(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def everyone(*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 no_tests_public(*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_completed_only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_disabled(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_enabled(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_everyone(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_no_tests_public(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_open(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_secured(*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 ongoing(*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 open(*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 participated_courses(*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 secured(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig { params(blk: T.proc.params(record: ::Course).returns(BasicObject)).returns(T::Array[::Course]) } + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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_certificates_for(*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 cached_version; end + + sig { params(value: ::Integer).returns(::Integer) } + def cached_version=(value); end + + sig { returns(T::Boolean) } + def cached_version?; end + + sig { returns(T.nilable(::Integer)) } + def cached_version_before_last_save; end + + sig { returns(T.untyped) } + def cached_version_before_type_cast; end + + sig { returns(T::Boolean) } + def cached_version_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def cached_version_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def cached_version_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def cached_version_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def cached_version_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def cached_version_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def cached_version_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def cached_version_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def cached_version_was; end + + sig { void } + def cached_version_will_change!; end + + sig { returns(T::Boolean) } + def certificate_downloadable; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def certificate_downloadable=(value); end + + sig { returns(T::Boolean) } + def certificate_downloadable?; end + + sig { returns(T.nilable(T::Boolean)) } + def certificate_downloadable_before_last_save; end + + sig { returns(T.untyped) } + def certificate_downloadable_before_type_cast; end + + sig { returns(T::Boolean) } + def certificate_downloadable_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def certificate_downloadable_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def certificate_downloadable_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def certificate_downloadable_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def certificate_downloadable_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def certificate_downloadable_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def certificate_downloadable_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def certificate_downloadable_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def certificate_downloadable_was; end + + sig { void } + def certificate_downloadable_will_change!; end + + sig { returns(T.nilable(::String)) } + def certificate_unlock_spec; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def certificate_unlock_spec=(value); end + + sig { returns(T::Boolean) } + def certificate_unlock_spec?; end + + sig { returns(T.nilable(::String)) } + def certificate_unlock_spec_before_last_save; end + + sig { returns(T.untyped) } + def certificate_unlock_spec_before_type_cast; end + + sig { returns(T::Boolean) } + def certificate_unlock_spec_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def certificate_unlock_spec_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def certificate_unlock_spec_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def certificate_unlock_spec_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def certificate_unlock_spec_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def certificate_unlock_spec_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def certificate_unlock_spec_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def certificate_unlock_spec_previously_was; end + + sig { returns(T.nilable(::String)) } + def certificate_unlock_spec_was; end + + sig { void } + def certificate_unlock_spec_will_change!; end + + sig { returns(T::Boolean) } + def code_review_requests_enabled; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def code_review_requests_enabled=(value); end + + sig { returns(T::Boolean) } + def code_review_requests_enabled?; end + + sig { returns(T.nilable(T::Boolean)) } + def code_review_requests_enabled_before_last_save; end + + sig { returns(T.untyped) } + def code_review_requests_enabled_before_type_cast; end + + sig { returns(T::Boolean) } + def code_review_requests_enabled_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def code_review_requests_enabled_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def code_review_requests_enabled_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def code_review_requests_enabled_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def code_review_requests_enabled_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def code_review_requests_enabled_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def code_review_requests_enabled_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def code_review_requests_enabled_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def code_review_requests_enabled_was; end + + sig { void } + def code_review_requests_enabled_will_change!; end + + sig { returns(::Integer) } + def course_template_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def course_template_id=(value); end + + sig { returns(T::Boolean) } + def course_template_id?; end + + sig { returns(T.nilable(::Integer)) } + def course_template_id_before_last_save; end + + sig { returns(T.untyped) } + def course_template_id_before_type_cast; end + + sig { returns(T::Boolean) } + def course_template_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_template_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_template_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_template_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_template_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_template_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_template_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_template_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def course_template_id_was; end + + sig { void } + def course_template_id_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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(T.nilable(::String)) } + def disabled_status; end + + sig do + params( + value: T.nilable(T.any(::String, ::Symbol, ::Integer)) + ).returns(T.nilable(T.any(::String, ::Symbol, ::Integer))) + end + def disabled_status=(value); end + + sig { returns(T::Boolean) } + def disabled_status?; end + + sig { returns(T.nilable(::String)) } + def disabled_status_before_last_save; end + + sig { returns(T.untyped) } + def disabled_status_before_type_cast; end + + sig { returns(T::Boolean) } + def disabled_status_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def disabled_status_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def disabled_status_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def disabled_status_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def disabled_status_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def disabled_status_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def disabled_status_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def disabled_status_previously_was; end + + sig { returns(T.nilable(::String)) } + def disabled_status_was; end + + sig { void } + def disabled_status_will_change!; end + + sig { returns(T.nilable(::String)) } + def external_scoreboard_url; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def external_scoreboard_url=(value); end + + sig { returns(T::Boolean) } + def external_scoreboard_url?; end + + sig { returns(T.nilable(::String)) } + def external_scoreboard_url_before_last_save; end + + sig { returns(T.untyped) } + def external_scoreboard_url_before_type_cast; end + + sig { returns(T::Boolean) } + def external_scoreboard_url_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def external_scoreboard_url_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def external_scoreboard_url_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def external_scoreboard_url_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def external_scoreboard_url_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def external_scoreboard_url_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def external_scoreboard_url_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def external_scoreboard_url_previously_was; end + + sig { returns(T.nilable(::String)) } + def external_scoreboard_url_was; end + + sig { void } + def external_scoreboard_url_will_change!; end + + sig { returns(T.nilable(::String)) } + def formal_name; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def formal_name=(value); end + + sig { returns(T::Boolean) } + def formal_name?; end + + sig { returns(T.nilable(::String)) } + def formal_name_before_last_save; end + + sig { returns(T.untyped) } + def formal_name_before_type_cast; end + + sig { returns(T::Boolean) } + def formal_name_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def formal_name_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def formal_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def formal_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def formal_name_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def formal_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def formal_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def formal_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def formal_name_was; end + + sig { void } + def formal_name_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def grant_model_solution_token_every_nth_completed_exercise; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def grant_model_solution_token_every_nth_completed_exercise=(value); end + + sig { returns(T::Boolean) } + def grant_model_solution_token_every_nth_completed_exercise?; end + + sig { returns(T.nilable(::Integer)) } + def grant_model_solution_token_every_nth_completed_exercise_before_last_save; end + + sig { returns(T.untyped) } + def grant_model_solution_token_every_nth_completed_exercise_before_type_cast; end + + sig { returns(T::Boolean) } + def grant_model_solution_token_every_nth_completed_exercise_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def grant_model_solution_token_every_nth_completed_exercise_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def grant_model_solution_token_every_nth_completed_exercise_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def grant_model_solution_token_every_nth_completed_exercise_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def grant_model_solution_token_every_nth_completed_exercise_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def grant_model_solution_token_every_nth_completed_exercise_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def grant_model_solution_token_every_nth_completed_exercise_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def grant_model_solution_token_every_nth_completed_exercise_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def grant_model_solution_token_every_nth_completed_exercise_was; end + + sig { void } + def grant_model_solution_token_every_nth_completed_exercise_will_change!; end + + sig { returns(T::Boolean) } + def hidden; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def hidden=(value); end + + sig { returns(T::Boolean) } + def hidden?; end + + sig { returns(T.nilable(T::Boolean)) } + def hidden_before_last_save; end + + sig { returns(T.untyped) } + def hidden_before_type_cast; end + + sig { returns(T::Boolean) } + def hidden_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def hidden_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def hidden_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hidden_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def hidden_if_registered_after; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def hidden_if_registered_after=(value); end + + sig { returns(T::Boolean) } + def hidden_if_registered_after?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def hidden_if_registered_after_before_last_save; end + + sig { returns(T.untyped) } + def hidden_if_registered_after_before_type_cast; end + + sig { returns(T::Boolean) } + def hidden_if_registered_after_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def hidden_if_registered_after_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def hidden_if_registered_after_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hidden_if_registered_after_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def hidden_if_registered_after_in_database; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def hidden_if_registered_after_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hidden_if_registered_after_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def hidden_if_registered_after_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def hidden_if_registered_after_was; end + + sig { void } + def hidden_if_registered_after_will_change!; end + + sig { returns(T.nilable(T::Boolean)) } + def hidden_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def hidden_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hidden_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def hidden_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def hidden_was; end + + sig { void } + def hidden_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def hide_after; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def hide_after=(value); end + + sig { returns(T::Boolean) } + def hide_after?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def hide_after_before_last_save; end + + sig { returns(T.untyped) } + def hide_after_before_type_cast; end + + sig { returns(T::Boolean) } + def hide_after_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def hide_after_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def hide_after_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hide_after_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def hide_after_in_database; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def hide_after_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hide_after_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def hide_after_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def hide_after_was; end + + sig { void } + def hide_after_will_change!; end + + sig { returns(T.nilable(T::Boolean)) } + def hide_submission_results; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def hide_submission_results=(value); end + + sig { returns(T::Boolean) } + def hide_submission_results?; end + + sig { returns(T.nilable(T::Boolean)) } + def hide_submission_results_before_last_save; end + + sig { returns(T.untyped) } + def hide_submission_results_before_type_cast; end + + sig { returns(T::Boolean) } + def hide_submission_results_came_from_user?; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def hide_submission_results_change; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def hide_submission_results_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hide_submission_results_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def hide_submission_results_in_database; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def hide_submission_results_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hide_submission_results_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def hide_submission_results_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def hide_submission_results_was; end + + sig { void } + def hide_submission_results_will_change!; end + + sig { returns(T::Boolean) } + def hide_submissions; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def hide_submissions=(value); end + + sig { returns(T::Boolean) } + def hide_submissions?; end + + sig { returns(T.nilable(T::Boolean)) } + def hide_submissions_before_last_save; end + + sig { returns(T.untyped) } + def hide_submissions_before_type_cast; end + + sig { returns(T::Boolean) } + def hide_submissions_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def hide_submissions_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def hide_submissions_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hide_submissions_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def hide_submissions_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def hide_submissions_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hide_submissions_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def hide_submissions_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def hide_submissions_was; end + + sig { void } + def hide_submissions_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 initial_coin_stash; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def initial_coin_stash=(value); end + + sig { returns(T::Boolean) } + def initial_coin_stash?; end + + sig { returns(T.nilable(::Integer)) } + def initial_coin_stash_before_last_save; end + + sig { returns(T.untyped) } + def initial_coin_stash_before_type_cast; end + + sig { returns(T::Boolean) } + def initial_coin_stash_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def initial_coin_stash_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def initial_coin_stash_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def initial_coin_stash_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def initial_coin_stash_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def initial_coin_stash_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def initial_coin_stash_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def initial_coin_stash_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def initial_coin_stash_was; end + + sig { void } + def initial_coin_stash_will_change!; end + + sig { returns(T.nilable(T::Boolean)) } + def initial_refresh_ready; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def initial_refresh_ready=(value); end + + sig { returns(T::Boolean) } + def initial_refresh_ready?; end + + sig { returns(T.nilable(T::Boolean)) } + def initial_refresh_ready_before_last_save; end + + sig { returns(T.untyped) } + def initial_refresh_ready_before_type_cast; end + + sig { returns(T::Boolean) } + def initial_refresh_ready_came_from_user?; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def initial_refresh_ready_change; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def initial_refresh_ready_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def initial_refresh_ready_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def initial_refresh_ready_in_database; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def initial_refresh_ready_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def initial_refresh_ready_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def initial_refresh_ready_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def initial_refresh_ready_was; end + + sig { void } + def initial_refresh_ready_will_change!; end + + sig { returns(T.nilable(T::Boolean)) } + def large_exercises_consume_more_coins; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def large_exercises_consume_more_coins=(value); end + + sig { returns(T::Boolean) } + def large_exercises_consume_more_coins?; end + + sig { returns(T.nilable(T::Boolean)) } + def large_exercises_consume_more_coins_before_last_save; end + + sig { returns(T.untyped) } + def large_exercises_consume_more_coins_before_type_cast; end + + sig { returns(T::Boolean) } + def large_exercises_consume_more_coins_came_from_user?; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def large_exercises_consume_more_coins_change; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def large_exercises_consume_more_coins_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def large_exercises_consume_more_coins_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def large_exercises_consume_more_coins_in_database; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def large_exercises_consume_more_coins_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def large_exercises_consume_more_coins_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def large_exercises_consume_more_coins_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def large_exercises_consume_more_coins_was; end + + sig { void } + def large_exercises_consume_more_coins_will_change!; end + + sig { returns(T::Boolean) } + def locked_exercise_points_visible; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def locked_exercise_points_visible=(value); end + + sig { returns(T::Boolean) } + def locked_exercise_points_visible?; end + + sig { returns(T.nilable(T::Boolean)) } + def locked_exercise_points_visible_before_last_save; end + + sig { returns(T.untyped) } + def locked_exercise_points_visible_before_type_cast; end + + sig { returns(T::Boolean) } + def locked_exercise_points_visible_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def locked_exercise_points_visible_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def locked_exercise_points_visible_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def locked_exercise_points_visible_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def locked_exercise_points_visible_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def locked_exercise_points_visible_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def locked_exercise_points_visible_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def locked_exercise_points_visible_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def locked_exercise_points_visible_was; end + + sig { void } + def locked_exercise_points_visible_will_change!; end + + sig { returns(T.nilable(::String)) } + def material_url; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def material_url=(value); end + + sig { returns(T::Boolean) } + def material_url?; end + + sig { returns(T.nilable(::String)) } + def material_url_before_last_save; end + + sig { returns(T.untyped) } + def material_url_before_type_cast; end + + sig { returns(T::Boolean) } + def material_url_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def material_url_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def material_url_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def material_url_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def material_url_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def material_url_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def material_url_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def material_url_previously_was; end + + sig { returns(T.nilable(::String)) } + def material_url_was; end + + sig { void } + def material_url_will_change!; end + + sig { returns(T::Boolean) } + def model_solution_visible_before_completion; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def model_solution_visible_before_completion=(value); end + + sig { returns(T::Boolean) } + def model_solution_visible_before_completion?; end + + sig { returns(T.nilable(T::Boolean)) } + def model_solution_visible_before_completion_before_last_save; end + + sig { returns(T.untyped) } + def model_solution_visible_before_completion_before_type_cast; end + + sig { returns(T::Boolean) } + def model_solution_visible_before_completion_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def model_solution_visible_before_completion_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def model_solution_visible_before_completion_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def model_solution_visible_before_completion_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def model_solution_visible_before_completion_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def model_solution_visible_before_completion_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def model_solution_visible_before_completion_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def model_solution_visible_before_completion_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def model_solution_visible_before_completion_was; end + + sig { void } + def model_solution_visible_before_completion_will_change!; end + + sig { returns(T.nilable(::String)) } + def moocfi_id; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def moocfi_id=(value); end + + sig { returns(T::Boolean) } + def moocfi_id?; end + + sig { returns(T.nilable(::String)) } + def moocfi_id_before_last_save; end + + sig { returns(T.untyped) } + def moocfi_id_before_type_cast; end + + sig { returns(T::Boolean) } + def moocfi_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def moocfi_id_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def moocfi_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def moocfi_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def moocfi_id_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def moocfi_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def moocfi_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def moocfi_id_previously_was; end + + sig { returns(T.nilable(::String)) } + def moocfi_id_was; end + + sig { void } + def moocfi_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 organization_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def organization_id=(value); end + + sig { returns(T::Boolean) } + def organization_id?; end + + sig { returns(T.nilable(::Integer)) } + def organization_id_before_last_save; end + + sig { returns(T.untyped) } + def organization_id_before_type_cast; end + + sig { returns(T::Boolean) } + def organization_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def organization_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def organization_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def organization_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def organization_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def organization_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def organization_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def organization_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def organization_id_was; end + + sig { void } + def organization_id_will_change!; end + + sig { returns(T.nilable(::String)) } + def paste_visibility; end + + sig do + params( + value: T.nilable(T.any(::String, ::Symbol, ::Integer)) + ).returns(T.nilable(T.any(::String, ::Symbol, ::Integer))) + end + def paste_visibility=(value); end + + sig { returns(T::Boolean) } + def paste_visibility?; end + + sig { returns(T.nilable(::String)) } + def paste_visibility_before_last_save; end + + sig { returns(T.untyped) } + def paste_visibility_before_type_cast; end + + sig { returns(T::Boolean) } + def paste_visibility_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def paste_visibility_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def paste_visibility_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def paste_visibility_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def paste_visibility_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def paste_visibility_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def paste_visibility_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def paste_visibility_previously_was; end + + sig { returns(T.nilable(::String)) } + def paste_visibility_was; end + + sig { void } + def paste_visibility_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def refreshed_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def refreshed_at=(value); end + + sig { returns(T::Boolean) } + def refreshed_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def refreshed_at_before_last_save; end + + sig { returns(T.untyped) } + def refreshed_at_before_type_cast; end + + sig { returns(T::Boolean) } + def refreshed_at_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def refreshed_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def refreshed_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def refreshed_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def refreshed_at_in_database; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def refreshed_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def refreshed_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def refreshed_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def refreshed_at_was; end + + sig { void } + def refreshed_at_will_change!; end + + sig { void } + def restore_cached_version!; end + + sig { void } + def restore_certificate_downloadable!; end + + sig { void } + def restore_certificate_unlock_spec!; end + + sig { void } + def restore_code_review_requests_enabled!; end + + sig { void } + def restore_course_template_id!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_description!; end + + sig { void } + def restore_disabled_status!; end + + sig { void } + def restore_external_scoreboard_url!; end + + sig { void } + def restore_formal_name!; end + + sig { void } + def restore_grant_model_solution_token_every_nth_completed_exercise!; end + + sig { void } + def restore_hidden!; end + + sig { void } + def restore_hidden_if_registered_after!; end + + sig { void } + def restore_hide_after!; end + + sig { void } + def restore_hide_submission_results!; end + + sig { void } + def restore_hide_submissions!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_initial_coin_stash!; end + + sig { void } + def restore_initial_refresh_ready!; end + + sig { void } + def restore_large_exercises_consume_more_coins!; end + + sig { void } + def restore_locked_exercise_points_visible!; end + + sig { void } + def restore_material_url!; end + + sig { void } + def restore_model_solution_visible_before_completion!; end + + sig { void } + def restore_moocfi_id!; end + + sig { void } + def restore_name!; end + + sig { void } + def restore_organization_id!; end + + sig { void } + def restore_paste_visibility!; end + + sig { void } + def restore_refreshed_at!; end + + sig { void } + def restore_soft_deadline_point_multiplier!; end + + sig { void } + def restore_spreadsheet_key!; end + + sig { void } + def restore_submissions_count!; end + + sig { void } + def restore_title!; end + + sig { void } + def restore_updated_at!; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_cached_version; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_cached_version?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_certificate_downloadable; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_certificate_downloadable?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_certificate_unlock_spec; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_certificate_unlock_spec?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_code_review_requests_enabled; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_code_review_requests_enabled?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_course_template_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_course_template_id?(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_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([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_disabled_status; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_disabled_status?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_external_scoreboard_url; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_external_scoreboard_url?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_formal_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_formal_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_grant_model_solution_token_every_nth_completed_exercise; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_grant_model_solution_token_every_nth_completed_exercise?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_hidden; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_hidden?(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_hidden_if_registered_after; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_hidden_if_registered_after?(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_hide_after; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_hide_after?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def saved_change_to_hide_submission_results; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_hide_submission_results?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_hide_submissions; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_hide_submissions?(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_initial_coin_stash; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_initial_coin_stash?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def saved_change_to_initial_refresh_ready; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_initial_refresh_ready?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def saved_change_to_large_exercises_consume_more_coins; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_large_exercises_consume_more_coins?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_locked_exercise_points_visible; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_locked_exercise_points_visible?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_material_url; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_material_url?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_model_solution_visible_before_completion; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_model_solution_visible_before_completion?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_moocfi_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_moocfi_id?(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_organization_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_organization_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_paste_visibility; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_paste_visibility?(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_refreshed_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_refreshed_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Float, ::Float])) } + def saved_change_to_soft_deadline_point_multiplier; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_soft_deadline_point_multiplier?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_spreadsheet_key; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_spreadsheet_key?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_submissions_count; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_submissions_count?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_title; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_title?(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_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(::Float) } + def soft_deadline_point_multiplier; end + + sig { params(value: ::Float).returns(::Float) } + def soft_deadline_point_multiplier=(value); end + + sig { returns(T::Boolean) } + def soft_deadline_point_multiplier?; end + + sig { returns(T.nilable(::Float)) } + def soft_deadline_point_multiplier_before_last_save; end + + sig { returns(T.untyped) } + def soft_deadline_point_multiplier_before_type_cast; end + + sig { returns(T::Boolean) } + def soft_deadline_point_multiplier_came_from_user?; end + + sig { returns(T.nilable([::Float, ::Float])) } + def soft_deadline_point_multiplier_change; end + + sig { returns(T.nilable([::Float, ::Float])) } + def soft_deadline_point_multiplier_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def soft_deadline_point_multiplier_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Float)) } + def soft_deadline_point_multiplier_in_database; end + + sig { returns(T.nilable([::Float, ::Float])) } + def soft_deadline_point_multiplier_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def soft_deadline_point_multiplier_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Float)) } + def soft_deadline_point_multiplier_previously_was; end + + sig { returns(T.nilable(::Float)) } + def soft_deadline_point_multiplier_was; end + + sig { void } + def soft_deadline_point_multiplier_will_change!; end + + sig { returns(T.nilable(::String)) } + def spreadsheet_key; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def spreadsheet_key=(value); end + + sig { returns(T::Boolean) } + def spreadsheet_key?; end + + sig { returns(T.nilable(::String)) } + def spreadsheet_key_before_last_save; end + + sig { returns(T.untyped) } + def spreadsheet_key_before_type_cast; end + + sig { returns(T::Boolean) } + def spreadsheet_key_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def spreadsheet_key_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def spreadsheet_key_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def spreadsheet_key_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def spreadsheet_key_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def spreadsheet_key_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def spreadsheet_key_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def spreadsheet_key_previously_was; end + + sig { returns(T.nilable(::String)) } + def spreadsheet_key_was; end + + sig { void } + def spreadsheet_key_will_change!; end + + sig { returns(::Integer) } + def submissions_count; end + + sig { params(value: ::Integer).returns(::Integer) } + def submissions_count=(value); end + + sig { returns(T::Boolean) } + def submissions_count?; end + + sig { returns(T.nilable(::Integer)) } + def submissions_count_before_last_save; end + + sig { returns(T.untyped) } + def submissions_count_before_type_cast; end + + sig { returns(T::Boolean) } + def submissions_count_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def submissions_count_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def submissions_count_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def submissions_count_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def submissions_count_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def submissions_count_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def submissions_count_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def submissions_count_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def submissions_count_was; end + + sig { void } + def submissions_count_will_change!; end + + sig { returns(T.nilable(::String)) } + def title; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def title=(value); end + + sig { returns(T::Boolean) } + def title?; end + + sig { returns(T.nilable(::String)) } + def title_before_last_save; end + + sig { returns(T.untyped) } + def title_before_type_cast; end + + sig { returns(T::Boolean) } + def title_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def title_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def title_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def title_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def title_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def title_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def title_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def title_previously_was; end + + sig { returns(T.nilable(::String)) } + def title_was; end + + sig { void } + def title_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_cached_version?(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_certificate_downloadable?(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_certificate_unlock_spec?(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_code_review_requests_enabled?(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_course_template_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_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_disabled_status?(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_external_scoreboard_url?(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_formal_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_grant_model_solution_token_every_nth_completed_exercise?(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_hidden?(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_hidden_if_registered_after?(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_hide_after?(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_hide_submission_results?(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_hide_submissions?(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_initial_coin_stash?(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_initial_refresh_ready?(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_large_exercises_consume_more_coins?(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_locked_exercise_points_visible?(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_material_url?(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_model_solution_visible_before_completion?(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_moocfi_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_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_organization_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_paste_visibility?(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_refreshed_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_soft_deadline_point_multiplier?(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_spreadsheet_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_submissions_count?(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_title?(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 assisted_courses(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def completed_only(*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 disabled(*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 enabled(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def everyone(*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 no_tests_public(*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_completed_only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_disabled(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_enabled(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_everyone(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_no_tests_public(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_open(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_secured(*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 ongoing(*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 open(*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 participated_courses(*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 secured(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig { params(blk: T.proc.params(record: ::Course).returns(BasicObject)).returns(T::Array[::Course]) } + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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_certificates_for(*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: ::Course } } + + sig { returns(T::Array[::Course]) } + def to_a; end + + sig { returns(T::Array[::Course]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Course } } + + 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: ::Course } } + + 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: ::Course } } + + sig do + params( + records: T.any(::Course, T::Enumerable[T.any(::Course, T::Enumerable[::Course])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Course, T::Enumerable[T.any(::Course, T::Enumerable[::Course])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Course, T::Enumerable[T.any(::Course, T::Enumerable[::Course])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::Course, Integer, String, T::Enumerable[T.any(::Course, Integer, String, T::Enumerable[::Course])]) + ).returns(T::Array[::Course]) + end + def delete(*records); end + + sig do + params( + records: T.any(::Course, Integer, String, T::Enumerable[T.any(::Course, Integer, String, T::Enumerable[::Course])]) + ).returns(T::Array[::Course]) + end + def destroy(*records); end + + sig { returns(T::Array[::Course]) } + def load_target; end + + sig do + params( + records: T.any(::Course, T::Enumerable[T.any(::Course, T::Enumerable[::Course])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Course, T::Enumerable[T.any(::Course, T::Enumerable[::Course])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Course, T::Enumerable[T.any(::Course, T::Enumerable[::Course])]) + ).returns(T::Array[::Course]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Course]) } + def target; end + + sig { returns(T::Array[::Course]) } + def to_a; end + + sig { returns(T::Array[::Course]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Course } } + + sig { returns(T::Array[::Course]) } + def to_a; end + + sig { returns(T::Array[::Course]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Course } } + + 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: ::Course } } + + 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/course_notification.rbi b/sorbet/rbi/dsl/course_notification.rbi new file mode 100644 index 000000000..c163a79dc --- /dev/null +++ b/sorbet/rbi/dsl/course_notification.rbi @@ -0,0 +1,1430 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `CourseNotification`. +# Please instead update this file by running `bin/tapioca dsl CourseNotification`. + + +class CourseNotification + 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: ::CourseNotification).void) + ).returns(::CourseNotification) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::CourseNotification).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: ::CourseNotification).void)).returns(::CourseNotification) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseNotification).void) + ).returns(T::Array[::CourseNotification]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseNotification).void) + ).returns(::CourseNotification) + 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: ::CourseNotification).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::CourseNotification).void)).returns(::CourseNotification) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseNotification).void) + ).returns(T::Array[::CourseNotification]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseNotification).void) + ).returns(::CourseNotification) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::CourseNotification).void)).returns(::CourseNotification) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseNotification).void) + ).returns(T::Array[::CourseNotification]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseNotification).void) + ).returns(::CourseNotification) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseNotification).void) + ).returns(T::Array[::CourseNotification]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseNotification).void) + ).returns(::CourseNotification) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseNotification).void) + ).returns(T::Array[::CourseNotification]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseNotification).void) + ).returns(::CourseNotification) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::CourseNotification]) } + def destroy_all; end + + sig { returns(T::Array[::CourseNotification]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::CourseNotification]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::CourseNotification)) } + def fifth; end + + sig { returns(::CourseNotification) } + 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(::CourseNotification) + 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[::CourseNotification]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::CourseNotification).void + ).returns(T.nilable(::CourseNotification)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::CourseNotification)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::CourseNotification) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::CourseNotification).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::CourseNotification]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::CourseNotification]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::CourseNotification]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseNotification).void) + ).returns(T::Array[::CourseNotification]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseNotification).void) + ).returns(::CourseNotification) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseNotification).void) + ).returns(T::Array[::CourseNotification]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseNotification).void) + ).returns(::CourseNotification) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseNotification).void) + ).returns(T::Array[::CourseNotification]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseNotification).void) + ).returns(::CourseNotification) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::CourseNotification)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::CourseNotification) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::CourseNotification) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::CourseNotification)) } + sig { params(limit: Integer).returns(T::Array[::CourseNotification]) } + def first(limit = nil); end + + sig { returns(::CourseNotification) } + def first!; end + + sig { returns(T.nilable(::CourseNotification)) } + def forty_two; end + + sig { returns(::CourseNotification) } + def forty_two!; end + + sig { returns(T.nilable(::CourseNotification)) } + def fourth; end + + sig { returns(::CourseNotification) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::CourseNotification)) } + sig { params(limit: Integer).returns(T::Array[::CourseNotification]) } + def last(limit = nil); end + + sig { returns(::CourseNotification) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::CourseNotification).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: ::CourseNotification).void)).returns(::CourseNotification) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseNotification).void) + ).returns(T::Array[::CourseNotification]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseNotification).void) + ).returns(::CourseNotification) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::CourseNotification).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::CourseNotification).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(::CourseNotification)) } + def second; end + + sig { returns(::CourseNotification) } + def second!; end + + sig { returns(T.nilable(::CourseNotification)) } + def second_to_last; end + + sig { returns(::CourseNotification) } + def second_to_last!; end + + sig { returns(::CourseNotification) } + 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: ::CourseNotification).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::CourseNotification)) } + sig { params(limit: Integer).returns(T::Array[::CourseNotification]) } + def take(limit = nil); end + + sig { returns(::CourseNotification) } + def take!; end + + sig { returns(T.nilable(::CourseNotification)) } + def third; end + + sig { returns(::CourseNotification) } + def third!; end + + sig { returns(T.nilable(::CourseNotification)) } + def third_to_last; end + + sig { returns(::CourseNotification) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def build_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def build_user(*args, &blk); end + + sig { returns(T.nilable(::Course)) } + def course; end + + sig { params(value: T.nilable(::Course)).void } + def course=(value); end + + sig { returns(T::Boolean) } + def course_changed?; end + + sig { returns(T::Boolean) } + def course_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course!(*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(::Course)) } + def reload_course; end + + sig { returns(T.nilable(::User)) } + def reload_user; end + + sig { void } + def reset_course; 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 { 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 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: ::CourseNotification).returns(BasicObject) + ).returns(T::Array[::CourseNotification]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.nilable(::Integer)) } + def course_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def course_id=(value); end + + sig { returns(T::Boolean) } + def course_id?; end + + sig { returns(T.nilable(::Integer)) } + def course_id_before_last_save; end + + sig { returns(T.untyped) } + def course_id_before_type_cast; end + + sig { returns(T::Boolean) } + def course_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def course_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def course_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def course_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def course_id_was; end + + sig { void } + def course_id_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 message; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def message=(value); end + + sig { returns(T::Boolean) } + def message?; end + + sig { returns(T.nilable(::String)) } + def message_before_last_save; end + + sig { returns(T.untyped) } + def message_before_type_cast; end + + sig { returns(T::Boolean) } + def message_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def message_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def message_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def message_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def message_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def message_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def message_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def message_previously_was; end + + sig { returns(T.nilable(::String)) } + def message_was; end + + sig { void } + def message_will_change!; end + + sig { void } + def restore_course_id!; 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_message!; end + + sig { void } + def restore_sender_id!; end + + sig { void } + def restore_topic!; end + + sig { void } + def restore_updated_at!; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_course_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_course_id?(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_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_message; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_message?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_sender_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_sender_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_topic; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_topic?(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_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)) } + def sender_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def sender_id=(value); end + + sig { returns(T::Boolean) } + def sender_id?; end + + sig { returns(T.nilable(::Integer)) } + def sender_id_before_last_save; end + + sig { returns(T.untyped) } + def sender_id_before_type_cast; end + + sig { returns(T::Boolean) } + def sender_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def sender_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def sender_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def sender_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def sender_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def sender_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def sender_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def sender_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def sender_id_was; end + + sig { void } + def sender_id_will_change!; end + + sig { returns(T.nilable(::String)) } + def topic; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def topic=(value); end + + sig { returns(T::Boolean) } + def topic?; end + + sig { returns(T.nilable(::String)) } + def topic_before_last_save; end + + sig { returns(T.untyped) } + def topic_before_type_cast; end + + sig { returns(T::Boolean) } + def topic_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def topic_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def topic_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def topic_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def topic_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def topic_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def topic_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def topic_previously_was; end + + sig { returns(T.nilable(::String)) } + def topic_was; end + + sig { void } + def topic_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_course_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_message?(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_sender_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_topic?(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 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: ::CourseNotification).returns(BasicObject) + ).returns(T::Array[::CourseNotification]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::CourseNotification } } + + sig { returns(T::Array[::CourseNotification]) } + def to_a; end + + sig { returns(T::Array[::CourseNotification]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::CourseNotification } } + + 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: ::CourseNotification } } + + 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: ::CourseNotification } } + + sig do + params( + records: T.any(::CourseNotification, T::Enumerable[T.any(::CourseNotification, T::Enumerable[::CourseNotification])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::CourseNotification, T::Enumerable[T.any(::CourseNotification, T::Enumerable[::CourseNotification])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::CourseNotification, T::Enumerable[T.any(::CourseNotification, T::Enumerable[::CourseNotification])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::CourseNotification, Integer, String, T::Enumerable[T.any(::CourseNotification, Integer, String, T::Enumerable[::CourseNotification])]) + ).returns(T::Array[::CourseNotification]) + end + def delete(*records); end + + sig do + params( + records: T.any(::CourseNotification, Integer, String, T::Enumerable[T.any(::CourseNotification, Integer, String, T::Enumerable[::CourseNotification])]) + ).returns(T::Array[::CourseNotification]) + end + def destroy(*records); end + + sig { returns(T::Array[::CourseNotification]) } + def load_target; end + + sig do + params( + records: T.any(::CourseNotification, T::Enumerable[T.any(::CourseNotification, T::Enumerable[::CourseNotification])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::CourseNotification, T::Enumerable[T.any(::CourseNotification, T::Enumerable[::CourseNotification])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::CourseNotification, T::Enumerable[T.any(::CourseNotification, T::Enumerable[::CourseNotification])]) + ).returns(T::Array[::CourseNotification]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::CourseNotification]) } + def target; end + + sig { returns(T::Array[::CourseNotification]) } + def to_a; end + + sig { returns(T::Array[::CourseNotification]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::CourseNotification } } + + sig { returns(T::Array[::CourseNotification]) } + def to_a; end + + sig { returns(T::Array[::CourseNotification]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::CourseNotification } } + + 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: ::CourseNotification } } + + 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/course_notification_mailer.rbi b/sorbet/rbi/dsl/course_notification_mailer.rbi new file mode 100644 index 000000000..e7de2848c --- /dev/null +++ b/sorbet/rbi/dsl/course_notification_mailer.rbi @@ -0,0 +1,34 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `CourseNotificationMailer`. +# Please instead update this file by running `bin/tapioca dsl CourseNotificationMailer`. + + +class CourseNotificationMailer + include GeneratedUrlHelpersModule + include GeneratedMountedHelpers + + class << self + sig { params(params: T::Hash[::Symbol, T.nilable(::String)]).returns(::ActionMailer::MessageDelivery) } + def notification_email(params = T.unsafe(nil)); end + + sig { params(html: T.untyped, options: T.untyped).returns(::ActionMailer::MessageDelivery) } + def sanitize(html, options = T.unsafe(nil)); end + + sig { params(style: T.untyped).returns(::ActionMailer::MessageDelivery) } + def sanitize_css(style); end + + sig { returns(::ActionMailer::MessageDelivery) } + def sanitizer_vendor; end + + sig { params(val: T.untyped).returns(::ActionMailer::MessageDelivery) } + def sanitizer_vendor=(val); end + + sig { params(html: T.untyped).returns(::ActionMailer::MessageDelivery) } + def strip_links(html); end + + sig { params(html: T.untyped).returns(::ActionMailer::MessageDelivery) } + def strip_tags(html); end + end +end diff --git a/sorbet/rbi/dsl/course_template.rbi b/sorbet/rbi/dsl/course_template.rbi new file mode 100644 index 000000000..aad1e2b9f --- /dev/null +++ b/sorbet/rbi/dsl/course_template.rbi @@ -0,0 +1,1817 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `CourseTemplate`. +# Please instead update this file by running `bin/tapioca dsl CourseTemplate`. + + +class CourseTemplate + 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: ::CourseTemplate).void) + ).returns(::CourseTemplate) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::CourseTemplate).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: ::CourseTemplate).void)).returns(::CourseTemplate) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplate).void) + ).returns(T::Array[::CourseTemplate]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplate).void) + ).returns(::CourseTemplate) + 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: ::CourseTemplate).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::CourseTemplate).void)).returns(::CourseTemplate) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplate).void) + ).returns(T::Array[::CourseTemplate]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplate).void) + ).returns(::CourseTemplate) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::CourseTemplate).void)).returns(::CourseTemplate) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplate).void) + ).returns(T::Array[::CourseTemplate]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplate).void) + ).returns(::CourseTemplate) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplate).void) + ).returns(T::Array[::CourseTemplate]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplate).void) + ).returns(::CourseTemplate) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplate).void) + ).returns(T::Array[::CourseTemplate]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplate).void) + ).returns(::CourseTemplate) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::CourseTemplate]) } + def destroy_all; end + + sig { returns(T::Array[::CourseTemplate]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::CourseTemplate]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::CourseTemplate)) } + def fifth; end + + sig { returns(::CourseTemplate) } + 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(::CourseTemplate) + 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[::CourseTemplate]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::CourseTemplate).void + ).returns(T.nilable(::CourseTemplate)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::CourseTemplate)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::CourseTemplate) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::CourseTemplate).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::CourseTemplate]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::CourseTemplate]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::CourseTemplate]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplate).void) + ).returns(T::Array[::CourseTemplate]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplate).void) + ).returns(::CourseTemplate) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplate).void) + ).returns(T::Array[::CourseTemplate]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplate).void) + ).returns(::CourseTemplate) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplate).void) + ).returns(T::Array[::CourseTemplate]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplate).void) + ).returns(::CourseTemplate) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::CourseTemplate)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::CourseTemplate) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::CourseTemplate) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::CourseTemplate)) } + sig { params(limit: Integer).returns(T::Array[::CourseTemplate]) } + def first(limit = nil); end + + sig { returns(::CourseTemplate) } + def first!; end + + sig { returns(T.nilable(::CourseTemplate)) } + def forty_two; end + + sig { returns(::CourseTemplate) } + def forty_two!; end + + sig { returns(T.nilable(::CourseTemplate)) } + def fourth; end + + sig { returns(::CourseTemplate) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::CourseTemplate)) } + sig { params(limit: Integer).returns(T::Array[::CourseTemplate]) } + def last(limit = nil); end + + sig { returns(::CourseTemplate) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::CourseTemplate).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: ::CourseTemplate).void)).returns(::CourseTemplate) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplate).void) + ).returns(T::Array[::CourseTemplate]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplate).void) + ).returns(::CourseTemplate) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::CourseTemplate).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::CourseTemplate).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(::CourseTemplate)) } + def second; end + + sig { returns(::CourseTemplate) } + def second!; end + + sig { returns(T.nilable(::CourseTemplate)) } + def second_to_last; end + + sig { returns(::CourseTemplate) } + def second_to_last!; end + + sig { returns(::CourseTemplate) } + 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: ::CourseTemplate).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::CourseTemplate)) } + sig { params(limit: Integer).returns(T::Array[::CourseTemplate]) } + def take(limit = nil); end + + sig { returns(::CourseTemplate) } + def take!; end + + sig { returns(T.nilable(::CourseTemplate)) } + def third; end + + sig { returns(::CourseTemplate) } + def third!; end + + sig { returns(T.nilable(::CourseTemplate)) } + def third_to_last; end + + sig { returns(::CourseTemplate) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { returns(T::Array[T.untyped]) } + def course_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def course_ids=(ids); end + + sig { returns(T::Array[T.untyped]) } + def course_template_refresh_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def course_template_refresh_ids=(ids); end + + # This method is created by ActiveRecord on the `CourseTemplate` class because it declared `has_many :course_template_refreshes`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::CourseTemplateRefresh::PrivateCollectionProxy) } + def course_template_refreshes; end + + sig { params(value: T::Enumerable[::CourseTemplateRefresh]).void } + def course_template_refreshes=(value); end + + # This method is created by ActiveRecord on the `CourseTemplate` class because it declared `has_many :courses`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Course::PrivateCollectionProxy) } + def courses; end + + sig { params(value: T::Enumerable[::Course]).void } + def courses=(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 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 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 hidden(*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_dummy(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_expired(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_hidden(*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: ::CourseTemplate).returns(BasicObject) + ).returns(T::Array[::CourseTemplate]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::Integer) } + def cached_version; end + + sig { params(value: ::Integer).returns(::Integer) } + def cached_version=(value); end + + sig { returns(T::Boolean) } + def cached_version?; end + + sig { returns(T.nilable(::Integer)) } + def cached_version_before_last_save; end + + sig { returns(T.untyped) } + def cached_version_before_type_cast; end + + sig { returns(T::Boolean) } + def cached_version_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def cached_version_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def cached_version_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def cached_version_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def cached_version_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def cached_version_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def cached_version_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def cached_version_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def cached_version_was; end + + sig { void } + def cached_version_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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(T::Boolean) } + def dummy; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def dummy=(value); end + + sig { returns(T::Boolean) } + def dummy?; end + + sig { returns(T.nilable(T::Boolean)) } + def dummy_before_last_save; end + + sig { returns(T.untyped) } + def dummy_before_type_cast; end + + sig { returns(T::Boolean) } + def dummy_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def dummy_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def dummy_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def dummy_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def dummy_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def dummy_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def dummy_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def dummy_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def dummy_was; end + + sig { void } + def dummy_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def expires_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def expires_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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(::String) } + def git_branch; end + + sig { params(value: ::String).returns(::String) } + def git_branch=(value); end + + sig { returns(T::Boolean) } + def git_branch?; end + + sig { returns(T.nilable(::String)) } + def git_branch_before_last_save; end + + sig { returns(T.untyped) } + def git_branch_before_type_cast; end + + sig { returns(T::Boolean) } + def git_branch_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def git_branch_change; end + + sig { returns(T.nilable([::String, ::String])) } + def git_branch_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def git_branch_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def git_branch_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def git_branch_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def git_branch_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def git_branch_previously_was; end + + sig { returns(T.nilable(::String)) } + def git_branch_was; end + + sig { void } + def git_branch_will_change!; end + + sig { returns(T.nilable(T::Boolean)) } + def hidden; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def hidden=(value); end + + sig { returns(T::Boolean) } + def hidden?; end + + sig { returns(T.nilable(T::Boolean)) } + def hidden_before_last_save; end + + sig { returns(T.untyped) } + def hidden_before_type_cast; end + + sig { returns(T::Boolean) } + def hidden_came_from_user?; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def hidden_change; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def hidden_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hidden_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def hidden_in_database; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def hidden_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hidden_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def hidden_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def hidden_was; end + + sig { void } + def hidden_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 material_url; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def material_url=(value); end + + sig { returns(T::Boolean) } + def material_url?; end + + sig { returns(T.nilable(::String)) } + def material_url_before_last_save; end + + sig { returns(T.untyped) } + def material_url_before_type_cast; end + + sig { returns(T::Boolean) } + def material_url_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def material_url_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def material_url_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def material_url_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def material_url_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def material_url_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def material_url_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def material_url_previously_was; end + + sig { returns(T.nilable(::String)) } + def material_url_was; end + + sig { void } + def material_url_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_cached_version!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_description!; end + + sig { void } + def restore_dummy!; end + + sig { void } + def restore_expires_at!; end + + sig { void } + def restore_git_branch!; end + + sig { void } + def restore_hidden!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_material_url!; end + + sig { void } + def restore_name!; end + + sig { void } + def restore_source_backend!; end + + sig { void } + def restore_source_url!; end + + sig { void } + def restore_title!; end + + sig { void } + def restore_updated_at!; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_cached_version; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_cached_version?(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_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([T::Boolean, T::Boolean])) } + def saved_change_to_dummy; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_dummy?(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_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([::String, ::String])) } + def saved_change_to_git_branch; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_git_branch?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def saved_change_to_hidden; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_hidden?(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_material_url; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_material_url?(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([::String, ::String])) } + def saved_change_to_source_backend; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_source_backend?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_source_url; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_source_url?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_title; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_title?(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_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 source_backend; end + + sig { params(value: ::String).returns(::String) } + def source_backend=(value); end + + sig { returns(T::Boolean) } + def source_backend?; end + + sig { returns(T.nilable(::String)) } + def source_backend_before_last_save; end + + sig { returns(T.untyped) } + def source_backend_before_type_cast; end + + sig { returns(T::Boolean) } + def source_backend_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def source_backend_change; end + + sig { returns(T.nilable([::String, ::String])) } + def source_backend_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def source_backend_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def source_backend_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def source_backend_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def source_backend_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def source_backend_previously_was; end + + sig { returns(T.nilable(::String)) } + def source_backend_was; end + + sig { void } + def source_backend_will_change!; end + + sig { returns(T.nilable(::String)) } + def source_url; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def source_url=(value); end + + sig { returns(T::Boolean) } + def source_url?; end + + sig { returns(T.nilable(::String)) } + def source_url_before_last_save; end + + sig { returns(T.untyped) } + def source_url_before_type_cast; end + + sig { returns(T::Boolean) } + def source_url_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def source_url_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def source_url_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def source_url_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def source_url_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def source_url_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def source_url_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def source_url_previously_was; end + + sig { returns(T.nilable(::String)) } + def source_url_was; end + + sig { void } + def source_url_will_change!; end + + sig { returns(T.nilable(::String)) } + def title; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def title=(value); end + + sig { returns(T::Boolean) } + def title?; end + + sig { returns(T.nilable(::String)) } + def title_before_last_save; end + + sig { returns(T.untyped) } + def title_before_type_cast; end + + sig { returns(T::Boolean) } + def title_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def title_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def title_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def title_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def title_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def title_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def title_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def title_previously_was; end + + sig { returns(T.nilable(::String)) } + def title_was; end + + sig { void } + def title_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_cached_version?(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_dummy?(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_git_branch?(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_hidden?(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_material_url?(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_source_backend?(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_source_url?(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_title?(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 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 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 hidden(*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_dummy(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_expired(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_hidden(*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: ::CourseTemplate).returns(BasicObject) + ).returns(T::Array[::CourseTemplate]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::CourseTemplate } } + + sig { returns(T::Array[::CourseTemplate]) } + def to_a; end + + sig { returns(T::Array[::CourseTemplate]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::CourseTemplate } } + + 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: ::CourseTemplate } } + + 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: ::CourseTemplate } } + + sig do + params( + records: T.any(::CourseTemplate, T::Enumerable[T.any(::CourseTemplate, T::Enumerable[::CourseTemplate])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::CourseTemplate, T::Enumerable[T.any(::CourseTemplate, T::Enumerable[::CourseTemplate])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::CourseTemplate, T::Enumerable[T.any(::CourseTemplate, T::Enumerable[::CourseTemplate])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::CourseTemplate, Integer, String, T::Enumerable[T.any(::CourseTemplate, Integer, String, T::Enumerable[::CourseTemplate])]) + ).returns(T::Array[::CourseTemplate]) + end + def delete(*records); end + + sig do + params( + records: T.any(::CourseTemplate, Integer, String, T::Enumerable[T.any(::CourseTemplate, Integer, String, T::Enumerable[::CourseTemplate])]) + ).returns(T::Array[::CourseTemplate]) + end + def destroy(*records); end + + sig { returns(T::Array[::CourseTemplate]) } + def load_target; end + + sig do + params( + records: T.any(::CourseTemplate, T::Enumerable[T.any(::CourseTemplate, T::Enumerable[::CourseTemplate])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::CourseTemplate, T::Enumerable[T.any(::CourseTemplate, T::Enumerable[::CourseTemplate])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::CourseTemplate, T::Enumerable[T.any(::CourseTemplate, T::Enumerable[::CourseTemplate])]) + ).returns(T::Array[::CourseTemplate]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::CourseTemplate]) } + def target; end + + sig { returns(T::Array[::CourseTemplate]) } + def to_a; end + + sig { returns(T::Array[::CourseTemplate]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::CourseTemplate } } + + sig { returns(T::Array[::CourseTemplate]) } + def to_a; end + + sig { returns(T::Array[::CourseTemplate]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::CourseTemplate } } + + 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: ::CourseTemplate } } + + 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/course_template_refresh.rbi b/sorbet/rbi/dsl/course_template_refresh.rbi new file mode 100644 index 000000000..b453de1e6 --- /dev/null +++ b/sorbet/rbi/dsl/course_template_refresh.rbi @@ -0,0 +1,1616 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `CourseTemplateRefresh`. +# Please instead update this file by running `bin/tapioca dsl CourseTemplateRefresh`. + + +class CourseTemplateRefresh + include GeneratedAssociationMethods + include GeneratedAttributeMethods + include EnumMethodsModule + 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: ::CourseTemplateRefresh).void) + ).returns(::CourseTemplateRefresh) + 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: ::CourseTemplateRefresh).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: ::CourseTemplateRefresh).void) + ).returns(::CourseTemplateRefresh) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(T::Array[::CourseTemplateRefresh]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(::CourseTemplateRefresh) + 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: ::CourseTemplateRefresh).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(::CourseTemplateRefresh) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(T::Array[::CourseTemplateRefresh]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(::CourseTemplateRefresh) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(::CourseTemplateRefresh) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(T::Array[::CourseTemplateRefresh]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(::CourseTemplateRefresh) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(T::Array[::CourseTemplateRefresh]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(::CourseTemplateRefresh) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(T::Array[::CourseTemplateRefresh]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(::CourseTemplateRefresh) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::CourseTemplateRefresh]) } + def destroy_all; end + + sig { returns(T::Array[::CourseTemplateRefresh]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::CourseTemplateRefresh]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::CourseTemplateRefresh)) } + def fifth; end + + sig { returns(::CourseTemplateRefresh) } + 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(::CourseTemplateRefresh) + 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[::CourseTemplateRefresh]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::CourseTemplateRefresh).void + ).returns(T.nilable(::CourseTemplateRefresh)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::CourseTemplateRefresh)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::CourseTemplateRefresh) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::CourseTemplateRefresh).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::CourseTemplateRefresh]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::CourseTemplateRefresh]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::CourseTemplateRefresh]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(T::Array[::CourseTemplateRefresh]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(::CourseTemplateRefresh) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(T::Array[::CourseTemplateRefresh]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(::CourseTemplateRefresh) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(T::Array[::CourseTemplateRefresh]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(::CourseTemplateRefresh) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::CourseTemplateRefresh)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::CourseTemplateRefresh) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::CourseTemplateRefresh) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::CourseTemplateRefresh)) } + sig { params(limit: Integer).returns(T::Array[::CourseTemplateRefresh]) } + def first(limit = nil); end + + sig { returns(::CourseTemplateRefresh) } + def first!; end + + sig { returns(T.nilable(::CourseTemplateRefresh)) } + def forty_two; end + + sig { returns(::CourseTemplateRefresh) } + def forty_two!; end + + sig { returns(T.nilable(::CourseTemplateRefresh)) } + def fourth; end + + sig { returns(::CourseTemplateRefresh) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::CourseTemplateRefresh)) } + sig { params(limit: Integer).returns(T::Array[::CourseTemplateRefresh]) } + def last(limit = nil); end + + sig { returns(::CourseTemplateRefresh) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::CourseTemplateRefresh).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: ::CourseTemplateRefresh).void) + ).returns(::CourseTemplateRefresh) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(T::Array[::CourseTemplateRefresh]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefresh).void) + ).returns(::CourseTemplateRefresh) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::CourseTemplateRefresh).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::CourseTemplateRefresh).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(::CourseTemplateRefresh)) } + def second; end + + sig { returns(::CourseTemplateRefresh) } + def second!; end + + sig { returns(T.nilable(::CourseTemplateRefresh)) } + def second_to_last; end + + sig { returns(::CourseTemplateRefresh) } + def second_to_last!; end + + sig { returns(::CourseTemplateRefresh) } + 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: ::CourseTemplateRefresh).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::CourseTemplateRefresh)) } + sig { params(limit: Integer).returns(T::Array[::CourseTemplateRefresh]) } + def take(limit = nil); end + + sig { returns(::CourseTemplateRefresh) } + def take!; end + + sig { returns(T.nilable(::CourseTemplateRefresh)) } + def third; end + + sig { returns(::CourseTemplateRefresh) } + def third!; end + + sig { returns(T.nilable(::CourseTemplateRefresh)) } + def third_to_last; end + + sig { returns(::CourseTemplateRefresh) } + def third_to_last!; end + end + + module EnumMethodsModule + sig { void } + def complete!; end + + sig { returns(T::Boolean) } + def complete?; end + + sig { void } + def crashed!; end + + sig { returns(T::Boolean) } + def crashed?; end + + sig { void } + def in_progress!; end + + sig { returns(T::Boolean) } + def in_progress?; end + + sig { void } + def not_started!; end + + sig { returns(T::Boolean) } + def not_started?; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::CourseTemplate) } + def build_course_template(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::CourseTemplateRefreshReport) } + def build_course_template_refresh_report(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def build_user(*args, &blk); end + + sig { returns(T.nilable(::CourseTemplate)) } + def course_template; end + + sig { params(value: T.nilable(::CourseTemplate)).void } + def course_template=(value); end + + sig { returns(T::Boolean) } + def course_template_changed?; end + + sig { returns(T::Boolean) } + def course_template_previously_changed?; end + + sig { returns(T::Array[T.untyped]) } + def course_template_refresh_phase_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def course_template_refresh_phase_ids=(ids); end + + # This method is created by ActiveRecord on the `CourseTemplateRefresh` class because it declared `has_many :course_template_refresh_phases`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::CourseTemplateRefreshPhase::PrivateCollectionProxy) } + def course_template_refresh_phases; end + + sig { params(value: T::Enumerable[::CourseTemplateRefreshPhase]).void } + def course_template_refresh_phases=(value); end + + sig { returns(T.nilable(::CourseTemplateRefreshReport)) } + def course_template_refresh_report; end + + sig { params(value: T.nilable(::CourseTemplateRefreshReport)).void } + def course_template_refresh_report=(value); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::CourseTemplate) } + def create_course_template(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::CourseTemplate) } + def create_course_template!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::CourseTemplateRefreshReport) } + def create_course_template_refresh_report(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::CourseTemplateRefreshReport) } + def create_course_template_refresh_report!(*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(::CourseTemplate)) } + def reload_course_template; end + + sig { returns(T.nilable(::CourseTemplateRefreshReport)) } + def reload_course_template_refresh_report; end + + sig { returns(T.nilable(::User)) } + def reload_user; end + + sig { void } + def reset_course_template; end + + sig { void } + def reset_course_template_refresh_report; 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 { 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 complete(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def crashed(*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 in_progress(*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_complete(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_crashed(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_in_progress(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_not_started(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_started(*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: ::CourseTemplateRefresh).returns(BasicObject) + ).returns(T::Array[::CourseTemplateRefresh]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::Integer) } + def course_template_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def course_template_id=(value); end + + sig { returns(T::Boolean) } + def course_template_id?; end + + sig { returns(T.nilable(::Integer)) } + def course_template_id_before_last_save; end + + sig { returns(T.untyped) } + def course_template_id_before_type_cast; end + + sig { returns(T::Boolean) } + def course_template_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_template_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_template_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_template_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_template_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_template_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_template_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_template_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def course_template_id_was; end + + sig { void } + def course_template_id_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 langs_refresh_output; end + + sig { params(value: T.untyped).returns(T.untyped) } + def langs_refresh_output=(value); end + + sig { returns(T::Boolean) } + def langs_refresh_output?; end + + sig { returns(T.untyped) } + def langs_refresh_output_before_last_save; end + + sig { returns(T.untyped) } + def langs_refresh_output_before_type_cast; end + + sig { returns(T::Boolean) } + def langs_refresh_output_came_from_user?; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def langs_refresh_output_change; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def langs_refresh_output_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def langs_refresh_output_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def langs_refresh_output_in_database; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def langs_refresh_output_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def langs_refresh_output_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def langs_refresh_output_previously_was; end + + sig { returns(T.untyped) } + def langs_refresh_output_was; end + + sig { void } + def langs_refresh_output_will_change!; end + + sig { returns(::BigDecimal) } + def percent_done; end + + sig { params(value: ::BigDecimal).returns(::BigDecimal) } + def percent_done=(value); end + + sig { returns(T::Boolean) } + def percent_done?; end + + sig { returns(T.nilable(::BigDecimal)) } + def percent_done_before_last_save; end + + sig { returns(T.untyped) } + def percent_done_before_type_cast; end + + sig { returns(T::Boolean) } + def percent_done_came_from_user?; end + + sig { returns(T.nilable([::BigDecimal, ::BigDecimal])) } + def percent_done_change; end + + sig { returns(T.nilable([::BigDecimal, ::BigDecimal])) } + def percent_done_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def percent_done_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::BigDecimal)) } + def percent_done_in_database; end + + sig { returns(T.nilable([::BigDecimal, ::BigDecimal])) } + def percent_done_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def percent_done_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::BigDecimal)) } + def percent_done_previously_was; end + + sig { returns(T.nilable(::BigDecimal)) } + def percent_done_was; end + + sig { void } + def percent_done_will_change!; end + + sig { void } + def restore_course_template_id!; 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_langs_refresh_output!; end + + sig { void } + def restore_percent_done!; end + + sig { void } + def restore_status!; end + + sig { void } + def restore_updated_at!; end + + sig { void } + def restore_user_id!; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_course_template_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_course_template_id?(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_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_langs_refresh_output; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_langs_refresh_output?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::BigDecimal, ::BigDecimal])) } + def saved_change_to_percent_done; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_percent_done?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_status; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_status?(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_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(::String) } + def status; end + + sig { params(value: T.any(::String, ::Symbol, ::Integer)).returns(T.any(::String, ::Symbol, ::Integer)) } + def status=(value); end + + sig { returns(T::Boolean) } + def status?; end + + sig { returns(T.nilable(::String)) } + def status_before_last_save; end + + sig { returns(T.untyped) } + def status_before_type_cast; end + + sig { returns(T::Boolean) } + def status_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def status_change; end + + sig { returns(T.nilable([::String, ::String])) } + def status_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def status_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def status_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def status_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def status_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def status_previously_was; end + + sig { returns(T.nilable(::String)) } + def status_was; end + + sig { void } + def status_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_course_template_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_langs_refresh_output?(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_percent_done?(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_status?(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 complete(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def crashed(*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 in_progress(*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_complete(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_crashed(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_in_progress(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_not_started(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_started(*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: ::CourseTemplateRefresh).returns(BasicObject) + ).returns(T::Array[::CourseTemplateRefresh]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::CourseTemplateRefresh } } + + sig { returns(T::Array[::CourseTemplateRefresh]) } + def to_a; end + + sig { returns(T::Array[::CourseTemplateRefresh]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::CourseTemplateRefresh } } + + 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: ::CourseTemplateRefresh } } + + 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: ::CourseTemplateRefresh } } + + sig do + params( + records: T.any(::CourseTemplateRefresh, T::Enumerable[T.any(::CourseTemplateRefresh, T::Enumerable[::CourseTemplateRefresh])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::CourseTemplateRefresh, T::Enumerable[T.any(::CourseTemplateRefresh, T::Enumerable[::CourseTemplateRefresh])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::CourseTemplateRefresh, T::Enumerable[T.any(::CourseTemplateRefresh, T::Enumerable[::CourseTemplateRefresh])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::CourseTemplateRefresh, Integer, String, T::Enumerable[T.any(::CourseTemplateRefresh, Integer, String, T::Enumerable[::CourseTemplateRefresh])]) + ).returns(T::Array[::CourseTemplateRefresh]) + end + def delete(*records); end + + sig do + params( + records: T.any(::CourseTemplateRefresh, Integer, String, T::Enumerable[T.any(::CourseTemplateRefresh, Integer, String, T::Enumerable[::CourseTemplateRefresh])]) + ).returns(T::Array[::CourseTemplateRefresh]) + end + def destroy(*records); end + + sig { returns(T::Array[::CourseTemplateRefresh]) } + def load_target; end + + sig do + params( + records: T.any(::CourseTemplateRefresh, T::Enumerable[T.any(::CourseTemplateRefresh, T::Enumerable[::CourseTemplateRefresh])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::CourseTemplateRefresh, T::Enumerable[T.any(::CourseTemplateRefresh, T::Enumerable[::CourseTemplateRefresh])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::CourseTemplateRefresh, T::Enumerable[T.any(::CourseTemplateRefresh, T::Enumerable[::CourseTemplateRefresh])]) + ).returns(T::Array[::CourseTemplateRefresh]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::CourseTemplateRefresh]) } + def target; end + + sig { returns(T::Array[::CourseTemplateRefresh]) } + def to_a; end + + sig { returns(T::Array[::CourseTemplateRefresh]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::CourseTemplateRefresh } } + + sig { returns(T::Array[::CourseTemplateRefresh]) } + def to_a; end + + sig { returns(T::Array[::CourseTemplateRefresh]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::CourseTemplateRefresh } } + + 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: ::CourseTemplateRefresh } } + + 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/course_template_refresh_phase.rbi b/sorbet/rbi/dsl/course_template_refresh_phase.rbi new file mode 100644 index 000000000..b42152b5c --- /dev/null +++ b/sorbet/rbi/dsl/course_template_refresh_phase.rbi @@ -0,0 +1,1253 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `CourseTemplateRefreshPhase`. +# Please instead update this file by running `bin/tapioca dsl CourseTemplateRefreshPhase`. + + +class CourseTemplateRefreshPhase + 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: ::CourseTemplateRefreshPhase).void) + ).returns(::CourseTemplateRefreshPhase) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::CourseTemplateRefreshPhase).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: ::CourseTemplateRefreshPhase).void) + ).returns(::CourseTemplateRefreshPhase) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(T::Array[::CourseTemplateRefreshPhase]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(::CourseTemplateRefreshPhase) + 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: ::CourseTemplateRefreshPhase).void + ).returns(Integer) + end + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(::CourseTemplateRefreshPhase) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(T::Array[::CourseTemplateRefreshPhase]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(::CourseTemplateRefreshPhase) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(::CourseTemplateRefreshPhase) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(T::Array[::CourseTemplateRefreshPhase]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(::CourseTemplateRefreshPhase) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(T::Array[::CourseTemplateRefreshPhase]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(::CourseTemplateRefreshPhase) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(T::Array[::CourseTemplateRefreshPhase]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(::CourseTemplateRefreshPhase) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::CourseTemplateRefreshPhase]) } + def destroy_all; end + + sig { returns(T::Array[::CourseTemplateRefreshPhase]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::CourseTemplateRefreshPhase]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::CourseTemplateRefreshPhase)) } + def fifth; end + + sig { returns(::CourseTemplateRefreshPhase) } + 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(::CourseTemplateRefreshPhase) + 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[::CourseTemplateRefreshPhase]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::CourseTemplateRefreshPhase).void + ).returns(T.nilable(::CourseTemplateRefreshPhase)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::CourseTemplateRefreshPhase)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::CourseTemplateRefreshPhase) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::CourseTemplateRefreshPhase).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::CourseTemplateRefreshPhase]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::CourseTemplateRefreshPhase]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::CourseTemplateRefreshPhase]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(T::Array[::CourseTemplateRefreshPhase]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(::CourseTemplateRefreshPhase) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(T::Array[::CourseTemplateRefreshPhase]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(::CourseTemplateRefreshPhase) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(T::Array[::CourseTemplateRefreshPhase]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(::CourseTemplateRefreshPhase) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::CourseTemplateRefreshPhase)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::CourseTemplateRefreshPhase) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::CourseTemplateRefreshPhase) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::CourseTemplateRefreshPhase)) } + sig { params(limit: Integer).returns(T::Array[::CourseTemplateRefreshPhase]) } + def first(limit = nil); end + + sig { returns(::CourseTemplateRefreshPhase) } + def first!; end + + sig { returns(T.nilable(::CourseTemplateRefreshPhase)) } + def forty_two; end + + sig { returns(::CourseTemplateRefreshPhase) } + def forty_two!; end + + sig { returns(T.nilable(::CourseTemplateRefreshPhase)) } + def fourth; end + + sig { returns(::CourseTemplateRefreshPhase) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::CourseTemplateRefreshPhase)) } + sig { params(limit: Integer).returns(T::Array[::CourseTemplateRefreshPhase]) } + def last(limit = nil); end + + sig { returns(::CourseTemplateRefreshPhase) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::CourseTemplateRefreshPhase).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: ::CourseTemplateRefreshPhase).void) + ).returns(::CourseTemplateRefreshPhase) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(T::Array[::CourseTemplateRefreshPhase]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshPhase).void) + ).returns(::CourseTemplateRefreshPhase) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::CourseTemplateRefreshPhase).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::CourseTemplateRefreshPhase).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(::CourseTemplateRefreshPhase)) } + def second; end + + sig { returns(::CourseTemplateRefreshPhase) } + def second!; end + + sig { returns(T.nilable(::CourseTemplateRefreshPhase)) } + def second_to_last; end + + sig { returns(::CourseTemplateRefreshPhase) } + def second_to_last!; end + + sig { returns(::CourseTemplateRefreshPhase) } + 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: ::CourseTemplateRefreshPhase).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::CourseTemplateRefreshPhase)) } + sig { params(limit: Integer).returns(T::Array[::CourseTemplateRefreshPhase]) } + def take(limit = nil); end + + sig { returns(::CourseTemplateRefreshPhase) } + def take!; end + + sig { returns(T.nilable(::CourseTemplateRefreshPhase)) } + def third; end + + sig { returns(::CourseTemplateRefreshPhase) } + def third!; end + + sig { returns(T.nilable(::CourseTemplateRefreshPhase)) } + def third_to_last; end + + sig { returns(::CourseTemplateRefreshPhase) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::CourseTemplateRefresh) } + def build_course_template_refresh(*args, &blk); end + + sig { returns(T.nilable(::CourseTemplateRefresh)) } + def course_template_refresh; end + + sig { params(value: T.nilable(::CourseTemplateRefresh)).void } + def course_template_refresh=(value); end + + sig { returns(T::Boolean) } + def course_template_refresh_changed?; end + + sig { returns(T::Boolean) } + def course_template_refresh_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(::CourseTemplateRefresh) } + def create_course_template_refresh(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::CourseTemplateRefresh) } + def create_course_template_refresh!(*args, &blk); end + + sig { returns(T.nilable(::CourseTemplateRefresh)) } + def reload_course_template_refresh; end + + sig { void } + def reset_course_template_refresh; 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 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: ::CourseTemplateRefreshPhase).returns(BasicObject) + ).returns(T::Array[::CourseTemplateRefreshPhase]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::Integer) } + def course_template_refresh_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def course_template_refresh_id=(value); end + + sig { returns(T::Boolean) } + def course_template_refresh_id?; end + + sig { returns(T.nilable(::Integer)) } + def course_template_refresh_id_before_last_save; end + + sig { returns(T.untyped) } + def course_template_refresh_id_before_type_cast; end + + sig { returns(T::Boolean) } + def course_template_refresh_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_template_refresh_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_template_refresh_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_template_refresh_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_template_refresh_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_template_refresh_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_template_refresh_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_template_refresh_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def course_template_refresh_id_was; end + + sig { void } + def course_template_refresh_id_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 phase_name; end + + sig { params(value: ::String).returns(::String) } + def phase_name=(value); end + + sig { returns(T::Boolean) } + def phase_name?; end + + sig { returns(T.nilable(::String)) } + def phase_name_before_last_save; end + + sig { returns(T.untyped) } + def phase_name_before_type_cast; end + + sig { returns(T::Boolean) } + def phase_name_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def phase_name_change; end + + sig { returns(T.nilable([::String, ::String])) } + def phase_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def phase_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def phase_name_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def phase_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def phase_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def phase_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def phase_name_was; end + + sig { void } + def phase_name_will_change!; end + + sig { void } + def restore_course_template_refresh_id!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_phase_name!; end + + sig { void } + def restore_time_ms!; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_course_template_refresh_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_course_template_refresh_id?(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_phase_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_phase_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_time_ms; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_time_ms?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(::Integer) } + def time_ms; end + + sig { params(value: ::Integer).returns(::Integer) } + def time_ms=(value); end + + sig { returns(T::Boolean) } + def time_ms?; end + + sig { returns(T.nilable(::Integer)) } + def time_ms_before_last_save; end + + sig { returns(T.untyped) } + def time_ms_before_type_cast; end + + sig { returns(T::Boolean) } + def time_ms_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def time_ms_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def time_ms_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def time_ms_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def time_ms_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def time_ms_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def time_ms_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def time_ms_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def time_ms_was; end + + sig { void } + def time_ms_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_course_template_refresh_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?(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_phase_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_time_ms?(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 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: ::CourseTemplateRefreshPhase).returns(BasicObject) + ).returns(T::Array[::CourseTemplateRefreshPhase]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::CourseTemplateRefreshPhase } } + + sig { returns(T::Array[::CourseTemplateRefreshPhase]) } + def to_a; end + + sig { returns(T::Array[::CourseTemplateRefreshPhase]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::CourseTemplateRefreshPhase } } + + 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: ::CourseTemplateRefreshPhase } } + + 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: ::CourseTemplateRefreshPhase } } + + sig do + params( + records: T.any(::CourseTemplateRefreshPhase, T::Enumerable[T.any(::CourseTemplateRefreshPhase, T::Enumerable[::CourseTemplateRefreshPhase])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::CourseTemplateRefreshPhase, T::Enumerable[T.any(::CourseTemplateRefreshPhase, T::Enumerable[::CourseTemplateRefreshPhase])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::CourseTemplateRefreshPhase, T::Enumerable[T.any(::CourseTemplateRefreshPhase, T::Enumerable[::CourseTemplateRefreshPhase])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::CourseTemplateRefreshPhase, Integer, String, T::Enumerable[T.any(::CourseTemplateRefreshPhase, Integer, String, T::Enumerable[::CourseTemplateRefreshPhase])]) + ).returns(T::Array[::CourseTemplateRefreshPhase]) + end + def delete(*records); end + + sig do + params( + records: T.any(::CourseTemplateRefreshPhase, Integer, String, T::Enumerable[T.any(::CourseTemplateRefreshPhase, Integer, String, T::Enumerable[::CourseTemplateRefreshPhase])]) + ).returns(T::Array[::CourseTemplateRefreshPhase]) + end + def destroy(*records); end + + sig { returns(T::Array[::CourseTemplateRefreshPhase]) } + def load_target; end + + sig do + params( + records: T.any(::CourseTemplateRefreshPhase, T::Enumerable[T.any(::CourseTemplateRefreshPhase, T::Enumerable[::CourseTemplateRefreshPhase])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::CourseTemplateRefreshPhase, T::Enumerable[T.any(::CourseTemplateRefreshPhase, T::Enumerable[::CourseTemplateRefreshPhase])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::CourseTemplateRefreshPhase, T::Enumerable[T.any(::CourseTemplateRefreshPhase, T::Enumerable[::CourseTemplateRefreshPhase])]) + ).returns(T::Array[::CourseTemplateRefreshPhase]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::CourseTemplateRefreshPhase]) } + def target; end + + sig { returns(T::Array[::CourseTemplateRefreshPhase]) } + def to_a; end + + sig { returns(T::Array[::CourseTemplateRefreshPhase]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::CourseTemplateRefreshPhase } } + + sig { returns(T::Array[::CourseTemplateRefreshPhase]) } + def to_a; end + + sig { returns(T::Array[::CourseTemplateRefreshPhase]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::CourseTemplateRefreshPhase } } + + 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: ::CourseTemplateRefreshPhase } } + + 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/course_template_refresh_report.rbi b/sorbet/rbi/dsl/course_template_refresh_report.rbi new file mode 100644 index 000000000..85578eda7 --- /dev/null +++ b/sorbet/rbi/dsl/course_template_refresh_report.rbi @@ -0,0 +1,1367 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `CourseTemplateRefreshReport`. +# Please instead update this file by running `bin/tapioca dsl CourseTemplateRefreshReport`. + + +class CourseTemplateRefreshReport + 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: ::CourseTemplateRefreshReport).void) + ).returns(::CourseTemplateRefreshReport) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::CourseTemplateRefreshReport).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: ::CourseTemplateRefreshReport).void) + ).returns(::CourseTemplateRefreshReport) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(T::Array[::CourseTemplateRefreshReport]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(::CourseTemplateRefreshReport) + 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: ::CourseTemplateRefreshReport).void + ).returns(Integer) + end + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(::CourseTemplateRefreshReport) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(T::Array[::CourseTemplateRefreshReport]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(::CourseTemplateRefreshReport) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(::CourseTemplateRefreshReport) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(T::Array[::CourseTemplateRefreshReport]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(::CourseTemplateRefreshReport) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(T::Array[::CourseTemplateRefreshReport]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(::CourseTemplateRefreshReport) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(T::Array[::CourseTemplateRefreshReport]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(::CourseTemplateRefreshReport) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::CourseTemplateRefreshReport]) } + def destroy_all; end + + sig { returns(T::Array[::CourseTemplateRefreshReport]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::CourseTemplateRefreshReport]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::CourseTemplateRefreshReport)) } + def fifth; end + + sig { returns(::CourseTemplateRefreshReport) } + 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(::CourseTemplateRefreshReport) + 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[::CourseTemplateRefreshReport]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::CourseTemplateRefreshReport).void + ).returns(T.nilable(::CourseTemplateRefreshReport)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::CourseTemplateRefreshReport)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::CourseTemplateRefreshReport) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::CourseTemplateRefreshReport).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::CourseTemplateRefreshReport]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::CourseTemplateRefreshReport]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::CourseTemplateRefreshReport]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(T::Array[::CourseTemplateRefreshReport]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(::CourseTemplateRefreshReport) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(T::Array[::CourseTemplateRefreshReport]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(::CourseTemplateRefreshReport) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(T::Array[::CourseTemplateRefreshReport]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(::CourseTemplateRefreshReport) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::CourseTemplateRefreshReport)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::CourseTemplateRefreshReport) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::CourseTemplateRefreshReport) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::CourseTemplateRefreshReport)) } + sig { params(limit: Integer).returns(T::Array[::CourseTemplateRefreshReport]) } + def first(limit = nil); end + + sig { returns(::CourseTemplateRefreshReport) } + def first!; end + + sig { returns(T.nilable(::CourseTemplateRefreshReport)) } + def forty_two; end + + sig { returns(::CourseTemplateRefreshReport) } + def forty_two!; end + + sig { returns(T.nilable(::CourseTemplateRefreshReport)) } + def fourth; end + + sig { returns(::CourseTemplateRefreshReport) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::CourseTemplateRefreshReport)) } + sig { params(limit: Integer).returns(T::Array[::CourseTemplateRefreshReport]) } + def last(limit = nil); end + + sig { returns(::CourseTemplateRefreshReport) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::CourseTemplateRefreshReport).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: ::CourseTemplateRefreshReport).void) + ).returns(::CourseTemplateRefreshReport) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(T::Array[::CourseTemplateRefreshReport]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::CourseTemplateRefreshReport).void) + ).returns(::CourseTemplateRefreshReport) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::CourseTemplateRefreshReport).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::CourseTemplateRefreshReport).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(::CourseTemplateRefreshReport)) } + def second; end + + sig { returns(::CourseTemplateRefreshReport) } + def second!; end + + sig { returns(T.nilable(::CourseTemplateRefreshReport)) } + def second_to_last; end + + sig { returns(::CourseTemplateRefreshReport) } + def second_to_last!; end + + sig { returns(::CourseTemplateRefreshReport) } + 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: ::CourseTemplateRefreshReport).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::CourseTemplateRefreshReport)) } + sig { params(limit: Integer).returns(T::Array[::CourseTemplateRefreshReport]) } + def take(limit = nil); end + + sig { returns(::CourseTemplateRefreshReport) } + def take!; end + + sig { returns(T.nilable(::CourseTemplateRefreshReport)) } + def third; end + + sig { returns(::CourseTemplateRefreshReport) } + def third!; end + + sig { returns(T.nilable(::CourseTemplateRefreshReport)) } + def third_to_last; end + + sig { returns(::CourseTemplateRefreshReport) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::CourseTemplateRefresh) } + def build_course_template_refresh(*args, &blk); end + + sig { returns(T.nilable(::CourseTemplateRefresh)) } + def course_template_refresh; end + + sig { params(value: T.nilable(::CourseTemplateRefresh)).void } + def course_template_refresh=(value); end + + sig { returns(T::Boolean) } + def course_template_refresh_changed?; end + + sig { returns(T::Boolean) } + def course_template_refresh_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(::CourseTemplateRefresh) } + def create_course_template_refresh(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::CourseTemplateRefresh) } + def create_course_template_refresh!(*args, &blk); end + + sig { returns(T.nilable(::CourseTemplateRefresh)) } + def reload_course_template_refresh; end + + sig { void } + def reset_course_template_refresh; 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 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: ::CourseTemplateRefreshReport).returns(BasicObject) + ).returns(T::Array[::CourseTemplateRefreshReport]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::Integer) } + def course_template_refresh_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def course_template_refresh_id=(value); end + + sig { returns(T::Boolean) } + def course_template_refresh_id?; end + + sig { returns(T.nilable(::Integer)) } + def course_template_refresh_id_before_last_save; end + + sig { returns(T.untyped) } + def course_template_refresh_id_before_type_cast; end + + sig { returns(T::Boolean) } + def course_template_refresh_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_template_refresh_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_template_refresh_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_template_refresh_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_template_refresh_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_template_refresh_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_template_refresh_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_template_refresh_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def course_template_refresh_id_was; end + + sig { void } + def course_template_refresh_id_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 refresh_errors; end + + sig { params(value: T.untyped).returns(T.untyped) } + def refresh_errors=(value); end + + sig { returns(T::Boolean) } + def refresh_errors?; end + + sig { returns(T.untyped) } + def refresh_errors_before_last_save; end + + sig { returns(T.untyped) } + def refresh_errors_before_type_cast; end + + sig { returns(T::Boolean) } + def refresh_errors_came_from_user?; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def refresh_errors_change; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def refresh_errors_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def refresh_errors_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def refresh_errors_in_database; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def refresh_errors_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def refresh_errors_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def refresh_errors_previously_was; end + + sig { returns(T.untyped) } + def refresh_errors_was; end + + sig { void } + def refresh_errors_will_change!; end + + sig { returns(T.untyped) } + def refresh_notices; end + + sig { params(value: T.untyped).returns(T.untyped) } + def refresh_notices=(value); end + + sig { returns(T::Boolean) } + def refresh_notices?; end + + sig { returns(T.untyped) } + def refresh_notices_before_last_save; end + + sig { returns(T.untyped) } + def refresh_notices_before_type_cast; end + + sig { returns(T::Boolean) } + def refresh_notices_came_from_user?; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def refresh_notices_change; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def refresh_notices_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def refresh_notices_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def refresh_notices_in_database; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def refresh_notices_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def refresh_notices_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def refresh_notices_previously_was; end + + sig { returns(T.untyped) } + def refresh_notices_was; end + + sig { void } + def refresh_notices_will_change!; end + + sig { returns(T.untyped) } + def refresh_timings; end + + sig { params(value: T.untyped).returns(T.untyped) } + def refresh_timings=(value); end + + sig { returns(T::Boolean) } + def refresh_timings?; end + + sig { returns(T.untyped) } + def refresh_timings_before_last_save; end + + sig { returns(T.untyped) } + def refresh_timings_before_type_cast; end + + sig { returns(T::Boolean) } + def refresh_timings_came_from_user?; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def refresh_timings_change; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def refresh_timings_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def refresh_timings_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def refresh_timings_in_database; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def refresh_timings_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def refresh_timings_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def refresh_timings_previously_was; end + + sig { returns(T.untyped) } + def refresh_timings_was; end + + sig { void } + def refresh_timings_will_change!; end + + sig { returns(T.untyped) } + def refresh_warnings; end + + sig { params(value: T.untyped).returns(T.untyped) } + def refresh_warnings=(value); end + + sig { returns(T::Boolean) } + def refresh_warnings?; end + + sig { returns(T.untyped) } + def refresh_warnings_before_last_save; end + + sig { returns(T.untyped) } + def refresh_warnings_before_type_cast; end + + sig { returns(T::Boolean) } + def refresh_warnings_came_from_user?; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def refresh_warnings_change; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def refresh_warnings_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def refresh_warnings_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def refresh_warnings_in_database; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def refresh_warnings_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def refresh_warnings_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.untyped) } + def refresh_warnings_previously_was; end + + sig { returns(T.untyped) } + def refresh_warnings_was; end + + sig { void } + def refresh_warnings_will_change!; end + + sig { void } + def restore_course_template_refresh_id!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_refresh_errors!; end + + sig { void } + def restore_refresh_notices!; end + + sig { void } + def restore_refresh_timings!; end + + sig { void } + def restore_refresh_warnings!; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_course_template_refresh_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_course_template_refresh_id?(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_refresh_errors; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_refresh_errors?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def saved_change_to_refresh_notices; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_refresh_notices?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def saved_change_to_refresh_timings; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_refresh_timings?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + def saved_change_to_refresh_warnings; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_refresh_warnings?(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_course_template_refresh_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?(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_refresh_errors?(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_refresh_notices?(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_refresh_timings?(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_refresh_warnings?(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 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: ::CourseTemplateRefreshReport).returns(BasicObject) + ).returns(T::Array[::CourseTemplateRefreshReport]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::CourseTemplateRefreshReport } } + + sig { returns(T::Array[::CourseTemplateRefreshReport]) } + def to_a; end + + sig { returns(T::Array[::CourseTemplateRefreshReport]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::CourseTemplateRefreshReport } } + + 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: ::CourseTemplateRefreshReport } } + + 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: ::CourseTemplateRefreshReport } } + + sig do + params( + records: T.any(::CourseTemplateRefreshReport, T::Enumerable[T.any(::CourseTemplateRefreshReport, T::Enumerable[::CourseTemplateRefreshReport])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::CourseTemplateRefreshReport, T::Enumerable[T.any(::CourseTemplateRefreshReport, T::Enumerable[::CourseTemplateRefreshReport])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::CourseTemplateRefreshReport, T::Enumerable[T.any(::CourseTemplateRefreshReport, T::Enumerable[::CourseTemplateRefreshReport])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::CourseTemplateRefreshReport, Integer, String, T::Enumerable[T.any(::CourseTemplateRefreshReport, Integer, String, T::Enumerable[::CourseTemplateRefreshReport])]) + ).returns(T::Array[::CourseTemplateRefreshReport]) + end + def delete(*records); end + + sig do + params( + records: T.any(::CourseTemplateRefreshReport, Integer, String, T::Enumerable[T.any(::CourseTemplateRefreshReport, Integer, String, T::Enumerable[::CourseTemplateRefreshReport])]) + ).returns(T::Array[::CourseTemplateRefreshReport]) + end + def destroy(*records); end + + sig { returns(T::Array[::CourseTemplateRefreshReport]) } + def load_target; end + + sig do + params( + records: T.any(::CourseTemplateRefreshReport, T::Enumerable[T.any(::CourseTemplateRefreshReport, T::Enumerable[::CourseTemplateRefreshReport])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::CourseTemplateRefreshReport, T::Enumerable[T.any(::CourseTemplateRefreshReport, T::Enumerable[::CourseTemplateRefreshReport])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::CourseTemplateRefreshReport, T::Enumerable[T.any(::CourseTemplateRefreshReport, T::Enumerable[::CourseTemplateRefreshReport])]) + ).returns(T::Array[::CourseTemplateRefreshReport]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::CourseTemplateRefreshReport]) } + def target; end + + sig { returns(T::Array[::CourseTemplateRefreshReport]) } + def to_a; end + + sig { returns(T::Array[::CourseTemplateRefreshReport]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::CourseTemplateRefreshReport } } + + sig { returns(T::Array[::CourseTemplateRefreshReport]) } + def to_a; end + + sig { returns(T::Array[::CourseTemplateRefreshReport]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::CourseTemplateRefreshReport } } + + 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: ::CourseTemplateRefreshReport } } + + 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/doorkeeper/access_grant.rbi b/sorbet/rbi/dsl/doorkeeper/access_grant.rbi new file mode 100644 index 000000000..343b4617c --- /dev/null +++ b/sorbet/rbi/dsl/doorkeeper/access_grant.rbi @@ -0,0 +1,1559 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Doorkeeper::AccessGrant`. +# Please instead update this file by running `bin/tapioca dsl Doorkeeper::AccessGrant`. + + +class Doorkeeper::AccessGrant + 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: ::Doorkeeper::AccessGrant).void) + ).returns(::Doorkeeper::AccessGrant) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::Doorkeeper::AccessGrant).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: ::Doorkeeper::AccessGrant).void) + ).returns(::Doorkeeper::AccessGrant) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(T::Array[::Doorkeeper::AccessGrant]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(::Doorkeeper::AccessGrant) + 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: ::Doorkeeper::AccessGrant).void + ).returns(Integer) + end + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(::Doorkeeper::AccessGrant) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(T::Array[::Doorkeeper::AccessGrant]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(::Doorkeeper::AccessGrant) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(::Doorkeeper::AccessGrant) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(T::Array[::Doorkeeper::AccessGrant]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(::Doorkeeper::AccessGrant) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(T::Array[::Doorkeeper::AccessGrant]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(::Doorkeeper::AccessGrant) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(T::Array[::Doorkeeper::AccessGrant]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(::Doorkeeper::AccessGrant) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::Doorkeeper::AccessGrant]) } + def destroy_all; end + + sig { returns(T::Array[::Doorkeeper::AccessGrant]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Doorkeeper::AccessGrant]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Doorkeeper::AccessGrant)) } + def fifth; end + + sig { returns(::Doorkeeper::AccessGrant) } + 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(::Doorkeeper::AccessGrant) + 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[::Doorkeeper::AccessGrant]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::Doorkeeper::AccessGrant).void + ).returns(T.nilable(::Doorkeeper::AccessGrant)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Doorkeeper::AccessGrant)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Doorkeeper::AccessGrant) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::Doorkeeper::AccessGrant).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::Doorkeeper::AccessGrant]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::Doorkeeper::AccessGrant]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::Doorkeeper::AccessGrant]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(T::Array[::Doorkeeper::AccessGrant]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(::Doorkeeper::AccessGrant) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(T::Array[::Doorkeeper::AccessGrant]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(::Doorkeeper::AccessGrant) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(T::Array[::Doorkeeper::AccessGrant]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(::Doorkeeper::AccessGrant) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Doorkeeper::AccessGrant)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Doorkeeper::AccessGrant) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Doorkeeper::AccessGrant) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Doorkeeper::AccessGrant)) } + sig { params(limit: Integer).returns(T::Array[::Doorkeeper::AccessGrant]) } + def first(limit = nil); end + + sig { returns(::Doorkeeper::AccessGrant) } + def first!; end + + sig { returns(T.nilable(::Doorkeeper::AccessGrant)) } + def forty_two; end + + sig { returns(::Doorkeeper::AccessGrant) } + def forty_two!; end + + sig { returns(T.nilable(::Doorkeeper::AccessGrant)) } + def fourth; end + + sig { returns(::Doorkeeper::AccessGrant) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::Doorkeeper::AccessGrant)) } + sig { params(limit: Integer).returns(T::Array[::Doorkeeper::AccessGrant]) } + def last(limit = nil); end + + sig { returns(::Doorkeeper::AccessGrant) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::Doorkeeper::AccessGrant).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: ::Doorkeeper::AccessGrant).void) + ).returns(::Doorkeeper::AccessGrant) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(T::Array[::Doorkeeper::AccessGrant]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessGrant).void) + ).returns(::Doorkeeper::AccessGrant) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::Doorkeeper::AccessGrant).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::Doorkeeper::AccessGrant).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(::Doorkeeper::AccessGrant)) } + def second; end + + sig { returns(::Doorkeeper::AccessGrant) } + def second!; end + + sig { returns(T.nilable(::Doorkeeper::AccessGrant)) } + def second_to_last; end + + sig { returns(::Doorkeeper::AccessGrant) } + def second_to_last!; end + + sig { returns(::Doorkeeper::AccessGrant) } + 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: ::Doorkeeper::AccessGrant).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Doorkeeper::AccessGrant)) } + sig { params(limit: Integer).returns(T::Array[::Doorkeeper::AccessGrant]) } + def take(limit = nil); end + + sig { returns(::Doorkeeper::AccessGrant) } + def take!; end + + sig { returns(T.nilable(::Doorkeeper::AccessGrant)) } + def third; end + + sig { returns(::Doorkeeper::AccessGrant) } + def third!; end + + sig { returns(T.nilable(::Doorkeeper::AccessGrant)) } + def third_to_last; end + + sig { returns(::Doorkeeper::AccessGrant) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { returns(T.nilable(::Doorkeeper::Application)) } + def application; end + + sig { params(value: T.nilable(::Doorkeeper::Application)).void } + def application=(value); end + + sig { returns(T::Boolean) } + def application_changed?; end + + sig { returns(T::Boolean) } + def application_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Doorkeeper::Application) } + def build_application(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Doorkeeper::OpenidConnect::Request) } + def build_openid_request(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Doorkeeper::Application) } + def create_application(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Doorkeeper::Application) } + def create_application!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Doorkeeper::OpenidConnect::Request) } + def create_openid_request(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Doorkeeper::OpenidConnect::Request) } + def create_openid_request!(*args, &blk); end + + sig { returns(T.nilable(::Doorkeeper::OpenidConnect::Request)) } + def openid_request; end + + sig { params(value: T.nilable(::Doorkeeper::OpenidConnect::Request)).void } + def openid_request=(value); end + + sig { returns(T.nilable(::Doorkeeper::Application)) } + def reload_application; end + + sig { returns(T.nilable(::Doorkeeper::OpenidConnect::Request)) } + def reload_openid_request; end + + sig { void } + def reset_application; end + + sig { void } + def reset_openid_request; 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 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: ::Doorkeeper::AccessGrant).returns(BasicObject) + ).returns(T::Array[::Doorkeeper::AccessGrant]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::Integer) } + def application_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def application_id=(value); end + + sig { returns(T::Boolean) } + def application_id?; end + + sig { returns(T.nilable(::Integer)) } + def application_id_before_last_save; end + + sig { returns(T.untyped) } + def application_id_before_type_cast; end + + sig { returns(T::Boolean) } + def application_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def application_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def application_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def application_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def application_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def application_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def application_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def application_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def application_id_was; end + + sig { void } + def application_id_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 expires_in; end + + sig { params(value: ::Integer).returns(::Integer) } + def expires_in=(value); end + + sig { returns(T::Boolean) } + def expires_in?; end + + sig { returns(T.nilable(::Integer)) } + def expires_in_before_last_save; end + + sig { returns(T.untyped) } + def expires_in_before_type_cast; end + + sig { returns(T::Boolean) } + def expires_in_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def expires_in_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def expires_in_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def expires_in_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def expires_in_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def expires_in_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def expires_in_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def expires_in_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def expires_in_was; end + + sig { void } + def expires_in_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 redirect_uri; end + + sig { params(value: ::String).returns(::String) } + def redirect_uri=(value); end + + sig { returns(T::Boolean) } + def redirect_uri?; end + + sig { returns(T.nilable(::String)) } + def redirect_uri_before_last_save; end + + sig { returns(T.untyped) } + def redirect_uri_before_type_cast; end + + sig { returns(T::Boolean) } + def redirect_uri_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def redirect_uri_change; end + + sig { returns(T.nilable([::String, ::String])) } + def redirect_uri_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def redirect_uri_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def redirect_uri_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def redirect_uri_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def redirect_uri_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def redirect_uri_previously_was; end + + sig { returns(T.nilable(::String)) } + def redirect_uri_was; end + + sig { void } + def redirect_uri_will_change!; end + + sig { returns(::Integer) } + def resource_owner_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def resource_owner_id=(value); end + + sig { returns(T::Boolean) } + def resource_owner_id?; end + + sig { returns(T.nilable(::Integer)) } + def resource_owner_id_before_last_save; end + + sig { returns(T.untyped) } + def resource_owner_id_before_type_cast; end + + sig { returns(T::Boolean) } + def resource_owner_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def resource_owner_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def resource_owner_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def resource_owner_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def resource_owner_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def resource_owner_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def resource_owner_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def resource_owner_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def resource_owner_id_was; end + + sig { void } + def resource_owner_id_will_change!; end + + sig { void } + def restore_application_id!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_expires_in!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_redirect_uri!; end + + sig { void } + def restore_resource_owner_id!; end + + sig { void } + def restore_revoked_at!; end + + sig { void } + def restore_scopes!; end + + sig { void } + def restore_token!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def revoked_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def revoked_at=(value); end + + sig { returns(T::Boolean) } + def revoked_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def revoked_at_before_last_save; end + + sig { returns(T.untyped) } + def revoked_at_before_type_cast; end + + sig { returns(T::Boolean) } + def revoked_at_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def revoked_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def revoked_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def revoked_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def revoked_at_in_database; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def revoked_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def revoked_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def revoked_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def revoked_at_was; end + + sig { void } + def revoked_at_will_change!; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_application_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_application_id?(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_expires_in; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_expires_in?(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_redirect_uri; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_redirect_uri?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_resource_owner_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_resource_owner_id?(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_revoked_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_revoked_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_scopes; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_scopes?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_token; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_token?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def scopes; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def scopes=(value); end + + sig { returns(T::Boolean) } + def scopes?; end + + sig { returns(T.nilable(::String)) } + def scopes_before_last_save; end + + sig { returns(T.untyped) } + def scopes_before_type_cast; end + + sig { returns(T::Boolean) } + def scopes_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def scopes_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def scopes_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def scopes_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def scopes_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def scopes_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def scopes_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def scopes_previously_was; end + + sig { returns(T.nilable(::String)) } + def scopes_was; end + + sig { void } + def scopes_will_change!; end + + sig { returns(::String) } + def token; end + + sig { params(value: ::String).returns(::String) } + def token=(value); end + + sig { returns(T::Boolean) } + def token?; end + + sig { returns(T.nilable(::String)) } + def token_before_last_save; end + + sig { returns(T.untyped) } + def token_before_type_cast; end + + sig { returns(T::Boolean) } + def token_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def token_change; end + + sig { returns(T.nilable([::String, ::String])) } + def token_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def token_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def token_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def token_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def token_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def token_previously_was; end + + sig { returns(T.nilable(::String)) } + def token_was; end + + sig { void } + def token_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_application_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_expires_in?(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_redirect_uri?(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_resource_owner_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_revoked_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_scopes?(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_token?(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 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: ::Doorkeeper::AccessGrant).returns(BasicObject) + ).returns(T::Array[::Doorkeeper::AccessGrant]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Doorkeeper::AccessGrant } } + + sig { returns(T::Array[::Doorkeeper::AccessGrant]) } + def to_a; end + + sig { returns(T::Array[::Doorkeeper::AccessGrant]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Doorkeeper::AccessGrant } } + + 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: ::Doorkeeper::AccessGrant } } + + 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: ::Doorkeeper::AccessGrant } } + + sig do + params( + records: T.any(::Doorkeeper::AccessGrant, T::Enumerable[T.any(::Doorkeeper::AccessGrant, T::Enumerable[::Doorkeeper::AccessGrant])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Doorkeeper::AccessGrant, T::Enumerable[T.any(::Doorkeeper::AccessGrant, T::Enumerable[::Doorkeeper::AccessGrant])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Doorkeeper::AccessGrant, T::Enumerable[T.any(::Doorkeeper::AccessGrant, T::Enumerable[::Doorkeeper::AccessGrant])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::Doorkeeper::AccessGrant, Integer, String, T::Enumerable[T.any(::Doorkeeper::AccessGrant, Integer, String, T::Enumerable[::Doorkeeper::AccessGrant])]) + ).returns(T::Array[::Doorkeeper::AccessGrant]) + end + def delete(*records); end + + sig do + params( + records: T.any(::Doorkeeper::AccessGrant, Integer, String, T::Enumerable[T.any(::Doorkeeper::AccessGrant, Integer, String, T::Enumerable[::Doorkeeper::AccessGrant])]) + ).returns(T::Array[::Doorkeeper::AccessGrant]) + end + def destroy(*records); end + + sig { returns(T::Array[::Doorkeeper::AccessGrant]) } + def load_target; end + + sig do + params( + records: T.any(::Doorkeeper::AccessGrant, T::Enumerable[T.any(::Doorkeeper::AccessGrant, T::Enumerable[::Doorkeeper::AccessGrant])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Doorkeeper::AccessGrant, T::Enumerable[T.any(::Doorkeeper::AccessGrant, T::Enumerable[::Doorkeeper::AccessGrant])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Doorkeeper::AccessGrant, T::Enumerable[T.any(::Doorkeeper::AccessGrant, T::Enumerable[::Doorkeeper::AccessGrant])]) + ).returns(T::Array[::Doorkeeper::AccessGrant]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Doorkeeper::AccessGrant]) } + def target; end + + sig { returns(T::Array[::Doorkeeper::AccessGrant]) } + def to_a; end + + sig { returns(T::Array[::Doorkeeper::AccessGrant]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Doorkeeper::AccessGrant } } + + sig { returns(T::Array[::Doorkeeper::AccessGrant]) } + def to_a; end + + sig { returns(T::Array[::Doorkeeper::AccessGrant]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Doorkeeper::AccessGrant } } + + 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: ::Doorkeeper::AccessGrant } } + + 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/doorkeeper/access_grant_mixin.rbi b/sorbet/rbi/dsl/doorkeeper/access_grant_mixin.rbi new file mode 100644 index 000000000..ec8918b3f --- /dev/null +++ b/sorbet/rbi/dsl/doorkeeper/access_grant_mixin.rbi @@ -0,0 +1,12 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Doorkeeper::AccessGrantMixin`. +# Please instead update this file by running `bin/tapioca dsl Doorkeeper::AccessGrantMixin`. + + +module Doorkeeper::AccessGrantMixin + mixes_in_class_methods ::Doorkeeper::Models::Orderable::ClassMethods + mixes_in_class_methods ::Doorkeeper::Models::SecretStorable::ClassMethods + mixes_in_class_methods ::Doorkeeper::Models::ResourceOwnerable::ClassMethods +end diff --git a/sorbet/rbi/dsl/doorkeeper/access_token.rbi b/sorbet/rbi/dsl/doorkeeper/access_token.rbi new file mode 100644 index 000000000..3a4681b3f --- /dev/null +++ b/sorbet/rbi/dsl/doorkeeper/access_token.rbi @@ -0,0 +1,1538 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Doorkeeper::AccessToken`. +# Please instead update this file by running `bin/tapioca dsl Doorkeeper::AccessToken`. + + +class Doorkeeper::AccessToken + 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: ::Doorkeeper::AccessToken).void) + ).returns(::Doorkeeper::AccessToken) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::Doorkeeper::AccessToken).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: ::Doorkeeper::AccessToken).void) + ).returns(::Doorkeeper::AccessToken) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(T::Array[::Doorkeeper::AccessToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(::Doorkeeper::AccessToken) + 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: ::Doorkeeper::AccessToken).void + ).returns(Integer) + end + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(::Doorkeeper::AccessToken) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(T::Array[::Doorkeeper::AccessToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(::Doorkeeper::AccessToken) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(::Doorkeeper::AccessToken) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(T::Array[::Doorkeeper::AccessToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(::Doorkeeper::AccessToken) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(T::Array[::Doorkeeper::AccessToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(::Doorkeeper::AccessToken) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(T::Array[::Doorkeeper::AccessToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(::Doorkeeper::AccessToken) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::Doorkeeper::AccessToken]) } + def destroy_all; end + + sig { returns(T::Array[::Doorkeeper::AccessToken]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Doorkeeper::AccessToken]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Doorkeeper::AccessToken)) } + def fifth; end + + sig { returns(::Doorkeeper::AccessToken) } + 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(::Doorkeeper::AccessToken) + 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[::Doorkeeper::AccessToken]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::Doorkeeper::AccessToken).void + ).returns(T.nilable(::Doorkeeper::AccessToken)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Doorkeeper::AccessToken)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Doorkeeper::AccessToken) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::Doorkeeper::AccessToken).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::Doorkeeper::AccessToken]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::Doorkeeper::AccessToken]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::Doorkeeper::AccessToken]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(T::Array[::Doorkeeper::AccessToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(::Doorkeeper::AccessToken) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(T::Array[::Doorkeeper::AccessToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(::Doorkeeper::AccessToken) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(T::Array[::Doorkeeper::AccessToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(::Doorkeeper::AccessToken) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Doorkeeper::AccessToken)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Doorkeeper::AccessToken) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Doorkeeper::AccessToken) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Doorkeeper::AccessToken)) } + sig { params(limit: Integer).returns(T::Array[::Doorkeeper::AccessToken]) } + def first(limit = nil); end + + sig { returns(::Doorkeeper::AccessToken) } + def first!; end + + sig { returns(T.nilable(::Doorkeeper::AccessToken)) } + def forty_two; end + + sig { returns(::Doorkeeper::AccessToken) } + def forty_two!; end + + sig { returns(T.nilable(::Doorkeeper::AccessToken)) } + def fourth; end + + sig { returns(::Doorkeeper::AccessToken) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::Doorkeeper::AccessToken)) } + sig { params(limit: Integer).returns(T::Array[::Doorkeeper::AccessToken]) } + def last(limit = nil); end + + sig { returns(::Doorkeeper::AccessToken) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::Doorkeeper::AccessToken).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: ::Doorkeeper::AccessToken).void) + ).returns(::Doorkeeper::AccessToken) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(T::Array[::Doorkeeper::AccessToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Doorkeeper::AccessToken).void) + ).returns(::Doorkeeper::AccessToken) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::Doorkeeper::AccessToken).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::Doorkeeper::AccessToken).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(::Doorkeeper::AccessToken)) } + def second; end + + sig { returns(::Doorkeeper::AccessToken) } + def second!; end + + sig { returns(T.nilable(::Doorkeeper::AccessToken)) } + def second_to_last; end + + sig { returns(::Doorkeeper::AccessToken) } + def second_to_last!; end + + sig { returns(::Doorkeeper::AccessToken) } + 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: ::Doorkeeper::AccessToken).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Doorkeeper::AccessToken)) } + sig { params(limit: Integer).returns(T::Array[::Doorkeeper::AccessToken]) } + def take(limit = nil); end + + sig { returns(::Doorkeeper::AccessToken) } + def take!; end + + sig { returns(T.nilable(::Doorkeeper::AccessToken)) } + def third; end + + sig { returns(::Doorkeeper::AccessToken) } + def third!; end + + sig { returns(T.nilable(::Doorkeeper::AccessToken)) } + def third_to_last; end + + sig { returns(::Doorkeeper::AccessToken) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { returns(T.nilable(::Doorkeeper::Application)) } + def application; end + + sig { params(value: T.nilable(::Doorkeeper::Application)).void } + def application=(value); end + + sig { returns(T::Boolean) } + def application_changed?; end + + sig { returns(T::Boolean) } + def application_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Doorkeeper::Application) } + def build_application(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Doorkeeper::Application) } + def create_application(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Doorkeeper::Application) } + def create_application!(*args, &blk); end + + sig { returns(T.nilable(::Doorkeeper::Application)) } + def reload_application; end + + sig { void } + def reset_application; 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 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: ::Doorkeeper::AccessToken).returns(BasicObject) + ).returns(T::Array[::Doorkeeper::AccessToken]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.nilable(::Integer)) } + def application_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def application_id=(value); end + + sig { returns(T::Boolean) } + def application_id?; end + + sig { returns(T.nilable(::Integer)) } + def application_id_before_last_save; end + + sig { returns(T.untyped) } + def application_id_before_type_cast; end + + sig { returns(T::Boolean) } + def application_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def application_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def application_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def application_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def application_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def application_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def application_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def application_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def application_id_was; end + + sig { void } + def application_id_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(::Integer)) } + def expires_in; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def expires_in=(value); end + + sig { returns(T::Boolean) } + def expires_in?; end + + sig { returns(T.nilable(::Integer)) } + def expires_in_before_last_save; end + + sig { returns(T.untyped) } + def expires_in_before_type_cast; end + + sig { returns(T::Boolean) } + def expires_in_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def expires_in_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def expires_in_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def expires_in_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def expires_in_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def expires_in_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def expires_in_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def expires_in_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def expires_in_was; end + + sig { void } + def expires_in_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 refresh_token; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def refresh_token=(value); end + + sig { returns(T::Boolean) } + def refresh_token?; end + + sig { returns(T.nilable(::String)) } + def refresh_token_before_last_save; end + + sig { returns(T.untyped) } + def refresh_token_before_type_cast; end + + sig { returns(T::Boolean) } + def refresh_token_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def refresh_token_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def refresh_token_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def refresh_token_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def refresh_token_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def refresh_token_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def refresh_token_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def refresh_token_previously_was; end + + sig { returns(T.nilable(::String)) } + def refresh_token_was; end + + sig { void } + def refresh_token_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def resource_owner_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def resource_owner_id=(value); end + + sig { returns(T::Boolean) } + def resource_owner_id?; end + + sig { returns(T.nilable(::Integer)) } + def resource_owner_id_before_last_save; end + + sig { returns(T.untyped) } + def resource_owner_id_before_type_cast; end + + sig { returns(T::Boolean) } + def resource_owner_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def resource_owner_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def resource_owner_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def resource_owner_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def resource_owner_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def resource_owner_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def resource_owner_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def resource_owner_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def resource_owner_id_was; end + + sig { void } + def resource_owner_id_will_change!; end + + sig { void } + def restore_application_id!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_expires_in!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_refresh_token!; end + + sig { void } + def restore_resource_owner_id!; end + + sig { void } + def restore_revoked_at!; end + + sig { void } + def restore_scopes!; end + + sig { void } + def restore_token!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def revoked_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def revoked_at=(value); end + + sig { returns(T::Boolean) } + def revoked_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def revoked_at_before_last_save; end + + sig { returns(T.untyped) } + def revoked_at_before_type_cast; end + + sig { returns(T::Boolean) } + def revoked_at_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def revoked_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def revoked_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def revoked_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def revoked_at_in_database; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def revoked_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def revoked_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def revoked_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def revoked_at_was; end + + sig { void } + def revoked_at_will_change!; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_application_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_application_id?(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(::Integer), T.nilable(::Integer)])) } + def saved_change_to_expires_in; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_expires_in?(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_refresh_token; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_refresh_token?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_resource_owner_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_resource_owner_id?(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_revoked_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_revoked_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_scopes; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_scopes?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_token; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_token?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def scopes; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def scopes=(value); end + + sig { returns(T::Boolean) } + def scopes?; end + + sig { returns(T.nilable(::String)) } + def scopes_before_last_save; end + + sig { returns(T.untyped) } + def scopes_before_type_cast; end + + sig { returns(T::Boolean) } + def scopes_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def scopes_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def scopes_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def scopes_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def scopes_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def scopes_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def scopes_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def scopes_previously_was; end + + sig { returns(T.nilable(::String)) } + def scopes_was; end + + sig { void } + def scopes_will_change!; end + + sig { returns(::String) } + def token; end + + sig { params(value: ::String).returns(::String) } + def token=(value); end + + sig { returns(T::Boolean) } + def token?; end + + sig { returns(T.nilable(::String)) } + def token_before_last_save; end + + sig { returns(T.untyped) } + def token_before_type_cast; end + + sig { returns(T::Boolean) } + def token_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def token_change; end + + sig { returns(T.nilable([::String, ::String])) } + def token_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def token_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def token_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def token_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def token_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def token_previously_was; end + + sig { returns(T.nilable(::String)) } + def token_was; end + + sig { void } + def token_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_application_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_expires_in?(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_refresh_token?(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_resource_owner_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_revoked_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_scopes?(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_token?(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 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: ::Doorkeeper::AccessToken).returns(BasicObject) + ).returns(T::Array[::Doorkeeper::AccessToken]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Doorkeeper::AccessToken } } + + sig { returns(T::Array[::Doorkeeper::AccessToken]) } + def to_a; end + + sig { returns(T::Array[::Doorkeeper::AccessToken]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Doorkeeper::AccessToken } } + + 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: ::Doorkeeper::AccessToken } } + + 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: ::Doorkeeper::AccessToken } } + + sig do + params( + records: T.any(::Doorkeeper::AccessToken, T::Enumerable[T.any(::Doorkeeper::AccessToken, T::Enumerable[::Doorkeeper::AccessToken])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Doorkeeper::AccessToken, T::Enumerable[T.any(::Doorkeeper::AccessToken, T::Enumerable[::Doorkeeper::AccessToken])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Doorkeeper::AccessToken, T::Enumerable[T.any(::Doorkeeper::AccessToken, T::Enumerable[::Doorkeeper::AccessToken])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::Doorkeeper::AccessToken, Integer, String, T::Enumerable[T.any(::Doorkeeper::AccessToken, Integer, String, T::Enumerable[::Doorkeeper::AccessToken])]) + ).returns(T::Array[::Doorkeeper::AccessToken]) + end + def delete(*records); end + + sig do + params( + records: T.any(::Doorkeeper::AccessToken, Integer, String, T::Enumerable[T.any(::Doorkeeper::AccessToken, Integer, String, T::Enumerable[::Doorkeeper::AccessToken])]) + ).returns(T::Array[::Doorkeeper::AccessToken]) + end + def destroy(*records); end + + sig { returns(T::Array[::Doorkeeper::AccessToken]) } + def load_target; end + + sig do + params( + records: T.any(::Doorkeeper::AccessToken, T::Enumerable[T.any(::Doorkeeper::AccessToken, T::Enumerable[::Doorkeeper::AccessToken])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Doorkeeper::AccessToken, T::Enumerable[T.any(::Doorkeeper::AccessToken, T::Enumerable[::Doorkeeper::AccessToken])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Doorkeeper::AccessToken, T::Enumerable[T.any(::Doorkeeper::AccessToken, T::Enumerable[::Doorkeeper::AccessToken])]) + ).returns(T::Array[::Doorkeeper::AccessToken]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Doorkeeper::AccessToken]) } + def target; end + + sig { returns(T::Array[::Doorkeeper::AccessToken]) } + def to_a; end + + sig { returns(T::Array[::Doorkeeper::AccessToken]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Doorkeeper::AccessToken } } + + sig { returns(T::Array[::Doorkeeper::AccessToken]) } + def to_a; end + + sig { returns(T::Array[::Doorkeeper::AccessToken]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Doorkeeper::AccessToken } } + + 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: ::Doorkeeper::AccessToken } } + + 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/doorkeeper/access_token_mixin.rbi b/sorbet/rbi/dsl/doorkeeper/access_token_mixin.rbi new file mode 100644 index 000000000..9166e693d --- /dev/null +++ b/sorbet/rbi/dsl/doorkeeper/access_token_mixin.rbi @@ -0,0 +1,13 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Doorkeeper::AccessTokenMixin`. +# Please instead update this file by running `bin/tapioca dsl Doorkeeper::AccessTokenMixin`. + + +module Doorkeeper::AccessTokenMixin + mixes_in_class_methods ::Doorkeeper::Models::Orderable::ClassMethods + mixes_in_class_methods ::Doorkeeper::Models::SecretStorable::ClassMethods + mixes_in_class_methods ::Doorkeeper::Models::ResourceOwnerable::ClassMethods + mixes_in_class_methods ::Doorkeeper::Models::ExpirationTimeSqlMath::ClassMethods +end diff --git a/sorbet/rbi/dsl/doorkeeper/application_controller.rbi b/sorbet/rbi/dsl/doorkeeper/application_controller.rbi new file mode 100644 index 000000000..f84917455 --- /dev/null +++ b/sorbet/rbi/dsl/doorkeeper/application_controller.rbi @@ -0,0 +1,42 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Doorkeeper::ApplicationController`. +# Please instead update this file by running `bin/tapioca dsl Doorkeeper::ApplicationController`. + + +class Doorkeeper::ApplicationController + include GeneratedUrlHelpersModule + include GeneratedPathHelpersModule + include GeneratedMountedHelpers + + sig { returns(HelperProxy) } + def helpers; end + + module HelperMethods + include ::ActionText::ContentHelper + include ::ActionText::TagHelper + include ::ActionController::Base::HelperMethods + include ::ApplicationHelper + include ::AuthorizeCollectionHelper + include ::BadUtf8Helper + include ::BootstrapFlashHelper + include ::CourseTimingsHelper + include ::CoursesHelper + include ::ExercisesHelper + include ::ExtraFieldHelper + include ::FeedbackAnswersHelper + include ::FlashBlockHelper + include ::PasteHelper + include ::PointsHelper + include ::SessionsHelper + include ::SubmissionsHelper + include ::TwitterBreadcrumbsHelper + include ::FontAwesome::Rails::IconHelper + include ::Doorkeeper::DashboardHelper + end + + class HelperProxy < ::ActionView::Base + include HelperMethods + end +end diff --git a/sorbet/rbi/dsl/doorkeeper/application_metal_controller.rbi b/sorbet/rbi/dsl/doorkeeper/application_metal_controller.rbi new file mode 100644 index 000000000..b6a52d37e --- /dev/null +++ b/sorbet/rbi/dsl/doorkeeper/application_metal_controller.rbi @@ -0,0 +1,12 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Doorkeeper::ApplicationMetalController`. +# Please instead update this file by running `bin/tapioca dsl Doorkeeper::ApplicationMetalController`. + + +class Doorkeeper::ApplicationMetalController + include GeneratedUrlHelpersModule + include GeneratedPathHelpersModule + include GeneratedMountedHelpers +end diff --git a/sorbet/rbi/dsl/exercise.rbi b/sorbet/rbi/dsl/exercise.rbi new file mode 100644 index 000000000..05ef30cc0 --- /dev/null +++ b/sorbet/rbi/dsl/exercise.rbi @@ -0,0 +1,2555 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Exercise`. +# Please instead update this file by running `bin/tapioca dsl Exercise`. + + +class Exercise + include GeneratedAssociationMethods + include GeneratedAttributeMethods + include EnumMethodsModule + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig { returns(T::Hash[T.any(String, Symbol), Integer]) } + def disabled_statuses; end + + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Exercise).void)).returns(::Exercise) } + def new(attributes = nil, &block); end + + sig { returns(T::Hash[T.any(String, Symbol), Integer]) } + def paste_visibilities; end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::Exercise).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: ::Exercise).void)).returns(::Exercise) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Exercise).void) + ).returns(T::Array[::Exercise]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Exercise).void)).returns(::Exercise) } + 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: ::Exercise).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Exercise).void)).returns(::Exercise) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Exercise).void) + ).returns(T::Array[::Exercise]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Exercise).void)).returns(::Exercise) } + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Exercise).void)).returns(::Exercise) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Exercise).void) + ).returns(T::Array[::Exercise]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Exercise).void)).returns(::Exercise) } + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Exercise).void) + ).returns(T::Array[::Exercise]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Exercise).void)).returns(::Exercise) } + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Exercise).void) + ).returns(T::Array[::Exercise]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Exercise).void)).returns(::Exercise) } + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::Exercise]) } + def destroy_all; end + + sig { returns(T::Array[::Exercise]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Exercise]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Exercise)) } + def fifth; end + + sig { returns(::Exercise) } + 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(::Exercise) + 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[::Exercise]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::Exercise).void).returns(T.nilable(::Exercise)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Exercise)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Exercise) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::Exercise).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::Exercise]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::Exercise]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::Exercise]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Exercise).void) + ).returns(T::Array[::Exercise]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Exercise).void)).returns(::Exercise) } + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Exercise).void) + ).returns(T::Array[::Exercise]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Exercise).void)).returns(::Exercise) } + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Exercise).void) + ).returns(T::Array[::Exercise]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Exercise).void)).returns(::Exercise) } + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Exercise)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Exercise) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Exercise) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Exercise)) } + sig { params(limit: Integer).returns(T::Array[::Exercise]) } + def first(limit = nil); end + + sig { returns(::Exercise) } + def first!; end + + sig { returns(T.nilable(::Exercise)) } + def forty_two; end + + sig { returns(::Exercise) } + def forty_two!; end + + sig { returns(T.nilable(::Exercise)) } + def fourth; end + + sig { returns(::Exercise) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::Exercise)) } + sig { params(limit: Integer).returns(T::Array[::Exercise]) } + def last(limit = nil); end + + sig { returns(::Exercise) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::Exercise).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: ::Exercise).void)).returns(::Exercise) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Exercise).void) + ).returns(T::Array[::Exercise]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Exercise).void)).returns(::Exercise) } + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Exercise).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Exercise).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(::Exercise)) } + def second; end + + sig { returns(::Exercise) } + def second!; end + + sig { returns(T.nilable(::Exercise)) } + def second_to_last; end + + sig { returns(::Exercise) } + def second_to_last!; end + + sig { returns(::Exercise) } + 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: ::Exercise).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Exercise)) } + sig { params(limit: Integer).returns(T::Array[::Exercise]) } + def take(limit = nil); end + + sig { returns(::Exercise) } + def take!; end + + sig { returns(T.nilable(::Exercise)) } + def third; end + + sig { returns(::Exercise) } + def third!; end + + sig { returns(T.nilable(::Exercise)) } + def third_to_last; end + + sig { returns(::Exercise) } + def third_to_last!; end + end + + module EnumMethodsModule + sig { void } + def completed_only!; end + + sig { returns(T::Boolean) } + def completed_only?; end + + sig { void } + def disabled!; end + + sig { returns(T::Boolean) } + def disabled?; end + + sig { void } + def enabled!; end + + sig { returns(T::Boolean) } + def enabled?; end + + sig { void } + def everyone!; end + + sig { returns(T::Boolean) } + def everyone?; end + + sig { void } + def no_tests_public!; end + + sig { returns(T::Boolean) } + def no_tests_public?; end + + sig { void } + def open!; end + + sig { returns(T::Boolean) } + def open?; end + + sig { void } + def secured!; end + + sig { returns(T::Boolean) } + def secured?; end + end + + module GeneratedAssociationMethods + sig { returns(T::Array[T.untyped]) } + def available_point_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def available_point_ids=(ids); end + + # This method is created by ActiveRecord on the `Exercise` class because it declared `has_many :available_points`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::AvailablePoint::PrivateCollectionProxy) } + def available_points; end + + sig { params(value: T::Enumerable[::AvailablePoint]).void } + def available_points=(value); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def build_course(*args, &blk); end + + sig { returns(T.nilable(::Course)) } + def course; end + + sig { params(value: T.nilable(::Course)).void } + def course=(value); end + + sig { returns(T::Boolean) } + def course_changed?; end + + sig { returns(T::Boolean) } + def course_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course!(*args, &blk); end + + sig { returns(T::Array[T.untyped]) } + def feedback_answer_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def feedback_answer_ids=(ids); end + + # This method is created by ActiveRecord on the `Exercise` class because it declared `has_many :feedback_answers`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::FeedbackAnswer::PrivateCollectionProxy) } + def feedback_answers; end + + sig { params(value: T::Enumerable[::FeedbackAnswer]).void } + def feedback_answers=(value); end + + sig { returns(T.nilable(::Course)) } + def reload_course; end + + sig { void } + def reset_course; end + + sig { returns(T::Array[T.untyped]) } + def submission_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def submission_ids=(ids); end + + # This method is created by ActiveRecord on the `Exercise` class because it declared `has_many :submissions`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Submission::PrivateCollectionProxy) } + def submissions; end + + sig { params(value: T::Enumerable[::Submission]).void } + def submissions=(value); end + + sig { returns(T::Array[T.untyped]) } + def unlock_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def unlock_ids=(ids); end + + # This method is created by ActiveRecord on the `Exercise` class because it declared `has_many :unlocks`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Unlock::PrivateCollectionProxy) } + def unlocks; end + + sig { params(value: T::Enumerable[::Unlock]).void } + def unlocks=(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 completed_only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def course_gdocs_sheet_exercises(*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 disabled(*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 enabled(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def everyone(*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 no_tests_public(*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_completed_only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_disabled(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_enabled(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_everyone(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_no_tests_public(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_open(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_secured(*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 open(*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 secured(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateAssociationRelation) } + sig { params(blk: T.proc.params(record: ::Exercise).returns(BasicObject)).returns(T::Array[::Exercise]) } + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::String) } + def checksum; end + + sig { params(value: ::String).returns(::String) } + def checksum=(value); end + + sig { returns(T::Boolean) } + def checksum?; end + + sig { returns(T.nilable(::String)) } + def checksum_before_last_save; end + + sig { returns(T.untyped) } + def checksum_before_type_cast; end + + sig { returns(T::Boolean) } + def checksum_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def checksum_change; end + + sig { returns(T.nilable([::String, ::String])) } + def checksum_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def checksum_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def checksum_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def checksum_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def checksum_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def checksum_previously_was; end + + sig { returns(T.nilable(::String)) } + def checksum_was; end + + sig { void } + def checksum_will_change!; end + + sig { returns(T::Boolean) } + def code_review_requests_enabled; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def code_review_requests_enabled=(value); end + + sig { returns(T::Boolean) } + def code_review_requests_enabled?; end + + sig { returns(T.nilable(T::Boolean)) } + def code_review_requests_enabled_before_last_save; end + + sig { returns(T.untyped) } + def code_review_requests_enabled_before_type_cast; end + + sig { returns(T::Boolean) } + def code_review_requests_enabled_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def code_review_requests_enabled_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def code_review_requests_enabled_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def code_review_requests_enabled_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def code_review_requests_enabled_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def code_review_requests_enabled_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def code_review_requests_enabled_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def code_review_requests_enabled_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def code_review_requests_enabled_was; end + + sig { void } + def code_review_requests_enabled_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def course_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def course_id=(value); end + + sig { returns(T::Boolean) } + def course_id?; end + + sig { returns(T.nilable(::Integer)) } + def course_id_before_last_save; end + + sig { returns(T.untyped) } + def course_id_before_type_cast; end + + sig { returns(T::Boolean) } + def course_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def course_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def course_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def course_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def course_id_was; end + + sig { void } + def course_id_will_change!; end + + sig { returns(::Integer) } + def cpu_limit; end + + sig { params(value: ::Integer).returns(::Integer) } + def cpu_limit=(value); end + + sig { returns(T::Boolean) } + def cpu_limit?; end + + sig { returns(T.nilable(::Integer)) } + def cpu_limit_before_last_save; end + + sig { returns(T.untyped) } + def cpu_limit_before_type_cast; end + + sig { returns(T::Boolean) } + def cpu_limit_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def cpu_limit_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def cpu_limit_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def cpu_limit_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def cpu_limit_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def cpu_limit_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def cpu_limit_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def cpu_limit_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def cpu_limit_was; end + + sig { void } + def cpu_limit_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 deadline_spec; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def deadline_spec=(value); end + + sig { returns(T::Boolean) } + def deadline_spec?; end + + sig { returns(T.nilable(::String)) } + def deadline_spec_before_last_save; end + + sig { returns(T.untyped) } + def deadline_spec_before_type_cast; end + + sig { returns(T::Boolean) } + def deadline_spec_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def deadline_spec_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def deadline_spec_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def deadline_spec_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def deadline_spec_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def deadline_spec_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def deadline_spec_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def deadline_spec_previously_was; end + + sig { returns(T.nilable(::String)) } + def deadline_spec_was; end + + sig { void } + def deadline_spec_will_change!; end + + sig { returns(T.nilable(::String)) } + def disabled_status; end + + sig do + params( + value: T.nilable(T.any(::String, ::Symbol, ::Integer)) + ).returns(T.nilable(T.any(::String, ::Symbol, ::Integer))) + end + def disabled_status=(value); end + + sig { returns(T::Boolean) } + def disabled_status?; end + + sig { returns(T.nilable(::String)) } + def disabled_status_before_last_save; end + + sig { returns(T.untyped) } + def disabled_status_before_type_cast; end + + sig { returns(T::Boolean) } + def disabled_status_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def disabled_status_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def disabled_status_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def disabled_status_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def disabled_status_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def disabled_status_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def disabled_status_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def disabled_status_previously_was; end + + sig { returns(T.nilable(::String)) } + def disabled_status_was; end + + sig { void } + def disabled_status_will_change!; end + + sig { returns(T.nilable(::String)) } + def docker_image; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def docker_image=(value); end + + sig { returns(T::Boolean) } + def docker_image?; end + + sig { returns(T.nilable(::String)) } + def docker_image_before_last_save; end + + sig { returns(T.untyped) } + def docker_image_before_type_cast; end + + sig { returns(T::Boolean) } + def docker_image_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def docker_image_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def docker_image_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def docker_image_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def docker_image_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def docker_image_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def docker_image_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def docker_image_previously_was; end + + sig { returns(T.nilable(::String)) } + def docker_image_was; end + + sig { void } + def docker_image_will_change!; end + + sig { returns(T.nilable(::String)) } + def gdocs_sheet; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def gdocs_sheet=(value); end + + sig { returns(T::Boolean) } + def gdocs_sheet?; end + + sig { returns(T.nilable(::String)) } + def gdocs_sheet_before_last_save; end + + sig { returns(T.untyped) } + def gdocs_sheet_before_type_cast; end + + sig { returns(T::Boolean) } + def gdocs_sheet_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def gdocs_sheet_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def gdocs_sheet_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def gdocs_sheet_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def gdocs_sheet_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def gdocs_sheet_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def gdocs_sheet_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def gdocs_sheet_previously_was; end + + sig { returns(T.nilable(::String)) } + def gdocs_sheet_was; end + + sig { void } + def gdocs_sheet_will_change!; end + + sig { returns(T::Boolean) } + def has_tests; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def has_tests=(value); end + + sig { returns(T::Boolean) } + def has_tests?; end + + sig { returns(T.nilable(T::Boolean)) } + def has_tests_before_last_save; end + + sig { returns(T.untyped) } + def has_tests_before_type_cast; end + + sig { returns(T::Boolean) } + def has_tests_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def has_tests_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def has_tests_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def has_tests_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def has_tests_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def has_tests_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def has_tests_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def has_tests_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def has_tests_was; end + + sig { void } + def has_tests_will_change!; end + + sig { returns(T::Boolean) } + def hidden; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def hidden=(value); end + + sig { returns(T::Boolean) } + def hidden?; end + + sig { returns(T.nilable(T::Boolean)) } + def hidden_before_last_save; end + + sig { returns(T.untyped) } + def hidden_before_type_cast; end + + sig { returns(T::Boolean) } + def hidden_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def hidden_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def hidden_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hidden_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def hidden_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def hidden_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hidden_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def hidden_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def hidden_was; end + + sig { void } + def hidden_will_change!; end + + sig { returns(T.nilable(T::Boolean)) } + def hide_submission_results; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def hide_submission_results=(value); end + + sig { returns(T::Boolean) } + def hide_submission_results?; end + + sig { returns(T.nilable(T::Boolean)) } + def hide_submission_results_before_last_save; end + + sig { returns(T.untyped) } + def hide_submission_results_before_type_cast; end + + sig { returns(T::Boolean) } + def hide_submission_results_came_from_user?; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def hide_submission_results_change; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def hide_submission_results_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hide_submission_results_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def hide_submission_results_in_database; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def hide_submission_results_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hide_submission_results_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def hide_submission_results_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def hide_submission_results_was; end + + sig { void } + def hide_submission_results_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 memory_limit_gb; end + + sig { params(value: ::Integer).returns(::Integer) } + def memory_limit_gb=(value); end + + sig { returns(T::Boolean) } + def memory_limit_gb?; end + + sig { returns(T.nilable(::Integer)) } + def memory_limit_gb_before_last_save; end + + sig { returns(T.untyped) } + def memory_limit_gb_before_type_cast; end + + sig { returns(T::Boolean) } + def memory_limit_gb_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def memory_limit_gb_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def memory_limit_gb_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def memory_limit_gb_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def memory_limit_gb_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def memory_limit_gb_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def memory_limit_gb_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def memory_limit_gb_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def memory_limit_gb_was; end + + sig { void } + def memory_limit_gb_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(::String)) } + def paste_visibility; end + + sig do + params( + value: T.nilable(T.any(::String, ::Symbol, ::Integer)) + ).returns(T.nilable(T.any(::String, ::Symbol, ::Integer))) + end + def paste_visibility=(value); end + + sig { returns(T::Boolean) } + def paste_visibility?; end + + sig { returns(T.nilable(::String)) } + def paste_visibility_before_last_save; end + + sig { returns(T.untyped) } + def paste_visibility_before_type_cast; end + + sig { returns(T::Boolean) } + def paste_visibility_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def paste_visibility_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def paste_visibility_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def paste_visibility_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def paste_visibility_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def paste_visibility_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def paste_visibility_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def paste_visibility_previously_was; end + + sig { returns(T.nilable(::String)) } + def paste_visibility_was; end + + sig { void } + def paste_visibility_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def publish_time; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def publish_time=(value); end + + sig { returns(T::Boolean) } + def publish_time?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def publish_time_before_last_save; end + + sig { returns(T.untyped) } + def publish_time_before_type_cast; end + + sig { returns(T::Boolean) } + def publish_time_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def publish_time_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def publish_time_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def publish_time_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def publish_time_in_database; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def publish_time_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def publish_time_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def publish_time_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def publish_time_was; end + + sig { void } + def publish_time_will_change!; end + + sig { void } + def restore_checksum!; end + + sig { void } + def restore_code_review_requests_enabled!; end + + sig { void } + def restore_course_id!; end + + sig { void } + def restore_cpu_limit!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_deadline_spec!; end + + sig { void } + def restore_disabled_status!; end + + sig { void } + def restore_docker_image!; end + + sig { void } + def restore_gdocs_sheet!; end + + sig { void } + def restore_has_tests!; end + + sig { void } + def restore_hidden!; end + + sig { void } + def restore_hide_submission_results!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_memory_limit_gb!; end + + sig { void } + def restore_name!; end + + sig { void } + def restore_paste_visibility!; end + + sig { void } + def restore_publish_time!; end + + sig { void } + def restore_returnable_forced!; end + + sig { void } + def restore_run_tests_locally_action_enabled!; end + + sig { void } + def restore_runtime_params!; end + + sig { void } + def restore_soft_deadline_spec!; end + + sig { void } + def restore_solution_visible_after!; end + + sig { void } + def restore_unlock_spec!; end + + sig { void } + def restore_updated_at!; end + + sig { void } + def restore_valgrind_strategy!; end + + sig { returns(T.nilable(T::Boolean)) } + def returnable_forced; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def returnable_forced=(value); end + + sig { returns(T::Boolean) } + def returnable_forced?; end + + sig { returns(T.nilable(T::Boolean)) } + def returnable_forced_before_last_save; end + + sig { returns(T.untyped) } + def returnable_forced_before_type_cast; end + + sig { returns(T::Boolean) } + def returnable_forced_came_from_user?; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def returnable_forced_change; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def returnable_forced_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def returnable_forced_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def returnable_forced_in_database; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def returnable_forced_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def returnable_forced_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def returnable_forced_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def returnable_forced_was; end + + sig { void } + def returnable_forced_will_change!; end + + sig { returns(T::Boolean) } + def run_tests_locally_action_enabled; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def run_tests_locally_action_enabled=(value); end + + sig { returns(T::Boolean) } + def run_tests_locally_action_enabled?; end + + sig { returns(T.nilable(T::Boolean)) } + def run_tests_locally_action_enabled_before_last_save; end + + sig { returns(T.untyped) } + def run_tests_locally_action_enabled_before_type_cast; end + + sig { returns(T::Boolean) } + def run_tests_locally_action_enabled_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def run_tests_locally_action_enabled_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def run_tests_locally_action_enabled_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def run_tests_locally_action_enabled_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def run_tests_locally_action_enabled_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def run_tests_locally_action_enabled_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def run_tests_locally_action_enabled_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def run_tests_locally_action_enabled_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def run_tests_locally_action_enabled_was; end + + sig { void } + def run_tests_locally_action_enabled_will_change!; end + + sig { returns(::String) } + def runtime_params; end + + sig { params(value: ::String).returns(::String) } + def runtime_params=(value); end + + sig { returns(T::Boolean) } + def runtime_params?; end + + sig { returns(T.nilable(::String)) } + def runtime_params_before_last_save; end + + sig { returns(T.untyped) } + def runtime_params_before_type_cast; end + + sig { returns(T::Boolean) } + def runtime_params_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def runtime_params_change; end + + sig { returns(T.nilable([::String, ::String])) } + def runtime_params_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def runtime_params_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def runtime_params_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def runtime_params_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def runtime_params_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def runtime_params_previously_was; end + + sig { returns(T.nilable(::String)) } + def runtime_params_was; end + + sig { void } + def runtime_params_will_change!; end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_checksum; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_checksum?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_code_review_requests_enabled; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_code_review_requests_enabled?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_course_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_course_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_cpu_limit; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_cpu_limit?(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_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_deadline_spec; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_deadline_spec?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_disabled_status; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_disabled_status?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_docker_image; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_docker_image?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_gdocs_sheet; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_gdocs_sheet?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_has_tests; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_has_tests?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_hidden; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_hidden?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def saved_change_to_hide_submission_results; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_hide_submission_results?(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_memory_limit_gb; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_memory_limit_gb?(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(::String), T.nilable(::String)])) } + def saved_change_to_paste_visibility; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_paste_visibility?(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_publish_time; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_publish_time?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def saved_change_to_returnable_forced; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_returnable_forced?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_run_tests_locally_action_enabled; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_run_tests_locally_action_enabled?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_runtime_params; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_runtime_params?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_soft_deadline_spec; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_soft_deadline_spec?(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_solution_visible_after; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_solution_visible_after?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_unlock_spec; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_unlock_spec?(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_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(::String), T.nilable(::String)])) } + def saved_change_to_valgrind_strategy; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_valgrind_strategy?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def soft_deadline_spec; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def soft_deadline_spec=(value); end + + sig { returns(T::Boolean) } + def soft_deadline_spec?; end + + sig { returns(T.nilable(::String)) } + def soft_deadline_spec_before_last_save; end + + sig { returns(T.untyped) } + def soft_deadline_spec_before_type_cast; end + + sig { returns(T::Boolean) } + def soft_deadline_spec_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def soft_deadline_spec_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def soft_deadline_spec_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def soft_deadline_spec_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def soft_deadline_spec_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def soft_deadline_spec_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def soft_deadline_spec_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def soft_deadline_spec_previously_was; end + + sig { returns(T.nilable(::String)) } + def soft_deadline_spec_was; end + + sig { void } + def soft_deadline_spec_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def solution_visible_after; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def solution_visible_after=(value); end + + sig { returns(T::Boolean) } + def solution_visible_after?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def solution_visible_after_before_last_save; end + + sig { returns(T.untyped) } + def solution_visible_after_before_type_cast; end + + sig { returns(T::Boolean) } + def solution_visible_after_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def solution_visible_after_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def solution_visible_after_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def solution_visible_after_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def solution_visible_after_in_database; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def solution_visible_after_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def solution_visible_after_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def solution_visible_after_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def solution_visible_after_was; end + + sig { void } + def solution_visible_after_will_change!; end + + sig { returns(T.nilable(::String)) } + def unlock_spec; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def unlock_spec=(value); end + + sig { returns(T::Boolean) } + def unlock_spec?; end + + sig { returns(T.nilable(::String)) } + def unlock_spec_before_last_save; end + + sig { returns(T.untyped) } + def unlock_spec_before_type_cast; end + + sig { returns(T::Boolean) } + def unlock_spec_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def unlock_spec_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def unlock_spec_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def unlock_spec_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def unlock_spec_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def unlock_spec_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def unlock_spec_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def unlock_spec_previously_was; end + + sig { returns(T.nilable(::String)) } + def unlock_spec_was; end + + sig { void } + def unlock_spec_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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(::String)) } + def valgrind_strategy; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def valgrind_strategy=(value); end + + sig { returns(T::Boolean) } + def valgrind_strategy?; end + + sig { returns(T.nilable(::String)) } + def valgrind_strategy_before_last_save; end + + sig { returns(T.untyped) } + def valgrind_strategy_before_type_cast; end + + sig { returns(T::Boolean) } + def valgrind_strategy_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def valgrind_strategy_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def valgrind_strategy_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def valgrind_strategy_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def valgrind_strategy_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def valgrind_strategy_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def valgrind_strategy_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def valgrind_strategy_previously_was; end + + sig { returns(T.nilable(::String)) } + def valgrind_strategy_was; end + + sig { void } + def valgrind_strategy_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_checksum?(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_code_review_requests_enabled?(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_course_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_cpu_limit?(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_deadline_spec?(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_disabled_status?(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_docker_image?(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_gdocs_sheet?(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_has_tests?(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_hidden?(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_hide_submission_results?(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_memory_limit_gb?(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_paste_visibility?(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_publish_time?(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_returnable_forced?(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_tests_locally_action_enabled?(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_runtime_params?(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_soft_deadline_spec?(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_solution_visible_after?(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_unlock_spec?(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_valgrind_strategy?(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 completed_only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def course_gdocs_sheet_exercises(*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 disabled(*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 enabled(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def everyone(*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 no_tests_public(*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_completed_only(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_disabled(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_enabled(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_everyone(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_no_tests_public(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_open(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_secured(*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 open(*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 secured(*args, &blk); end + + sig { params(args: T.untyped).returns(PrivateRelation) } + sig { params(blk: T.proc.params(record: ::Exercise).returns(BasicObject)).returns(T::Array[::Exercise]) } + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Exercise } } + + sig { returns(T::Array[::Exercise]) } + def to_a; end + + sig { returns(T::Array[::Exercise]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Exercise } } + + 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: ::Exercise } } + + 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: ::Exercise } } + + sig do + params( + records: T.any(::Exercise, T::Enumerable[T.any(::Exercise, T::Enumerable[::Exercise])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Exercise, T::Enumerable[T.any(::Exercise, T::Enumerable[::Exercise])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Exercise, T::Enumerable[T.any(::Exercise, T::Enumerable[::Exercise])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::Exercise, Integer, String, T::Enumerable[T.any(::Exercise, Integer, String, T::Enumerable[::Exercise])]) + ).returns(T::Array[::Exercise]) + end + def delete(*records); end + + sig do + params( + records: T.any(::Exercise, Integer, String, T::Enumerable[T.any(::Exercise, Integer, String, T::Enumerable[::Exercise])]) + ).returns(T::Array[::Exercise]) + end + def destroy(*records); end + + sig { returns(T::Array[::Exercise]) } + def load_target; end + + sig do + params( + records: T.any(::Exercise, T::Enumerable[T.any(::Exercise, T::Enumerable[::Exercise])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Exercise, T::Enumerable[T.any(::Exercise, T::Enumerable[::Exercise])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Exercise, T::Enumerable[T.any(::Exercise, T::Enumerable[::Exercise])]) + ).returns(T::Array[::Exercise]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Exercise]) } + def target; end + + sig { returns(T::Array[::Exercise]) } + def to_a; end + + sig { returns(T::Array[::Exercise]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Exercise } } + + sig { returns(T::Array[::Exercise]) } + def to_a; end + + sig { returns(T::Array[::Exercise]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Exercise } } + + 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: ::Exercise } } + + 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/feedback_answer.rbi b/sorbet/rbi/dsl/feedback_answer.rbi new file mode 100644 index 000000000..fd5667ae1 --- /dev/null +++ b/sorbet/rbi/dsl/feedback_answer.rbi @@ -0,0 +1,1539 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `FeedbackAnswer`. +# Please instead update this file by running `bin/tapioca dsl FeedbackAnswer`. + + +class FeedbackAnswer + 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: ::FeedbackAnswer).void) + ).returns(::FeedbackAnswer) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::FeedbackAnswer).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: ::FeedbackAnswer).void)).returns(::FeedbackAnswer) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void) + ).returns(T::Array[::FeedbackAnswer]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void) + ).returns(::FeedbackAnswer) + 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: ::FeedbackAnswer).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void)).returns(::FeedbackAnswer) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void) + ).returns(T::Array[::FeedbackAnswer]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void) + ).returns(::FeedbackAnswer) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void)).returns(::FeedbackAnswer) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void) + ).returns(T::Array[::FeedbackAnswer]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void) + ).returns(::FeedbackAnswer) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void) + ).returns(T::Array[::FeedbackAnswer]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void) + ).returns(::FeedbackAnswer) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void) + ).returns(T::Array[::FeedbackAnswer]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void) + ).returns(::FeedbackAnswer) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::FeedbackAnswer]) } + def destroy_all; end + + sig { returns(T::Array[::FeedbackAnswer]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::FeedbackAnswer]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::FeedbackAnswer)) } + def fifth; end + + sig { returns(::FeedbackAnswer) } + 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(::FeedbackAnswer) + 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[::FeedbackAnswer]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::FeedbackAnswer).void + ).returns(T.nilable(::FeedbackAnswer)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::FeedbackAnswer)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::FeedbackAnswer) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::FeedbackAnswer).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::FeedbackAnswer]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::FeedbackAnswer]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::FeedbackAnswer]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void) + ).returns(T::Array[::FeedbackAnswer]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void) + ).returns(::FeedbackAnswer) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void) + ).returns(T::Array[::FeedbackAnswer]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void) + ).returns(::FeedbackAnswer) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void) + ).returns(T::Array[::FeedbackAnswer]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void) + ).returns(::FeedbackAnswer) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::FeedbackAnswer)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::FeedbackAnswer) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::FeedbackAnswer) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::FeedbackAnswer)) } + sig { params(limit: Integer).returns(T::Array[::FeedbackAnswer]) } + def first(limit = nil); end + + sig { returns(::FeedbackAnswer) } + def first!; end + + sig { returns(T.nilable(::FeedbackAnswer)) } + def forty_two; end + + sig { returns(::FeedbackAnswer) } + def forty_two!; end + + sig { returns(T.nilable(::FeedbackAnswer)) } + def fourth; end + + sig { returns(::FeedbackAnswer) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::FeedbackAnswer)) } + sig { params(limit: Integer).returns(T::Array[::FeedbackAnswer]) } + def last(limit = nil); end + + sig { returns(::FeedbackAnswer) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::FeedbackAnswer).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: ::FeedbackAnswer).void)).returns(::FeedbackAnswer) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void) + ).returns(T::Array[::FeedbackAnswer]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::FeedbackAnswer).void) + ).returns(::FeedbackAnswer) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::FeedbackAnswer).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::FeedbackAnswer).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(::FeedbackAnswer)) } + def second; end + + sig { returns(::FeedbackAnswer) } + def second!; end + + sig { returns(T.nilable(::FeedbackAnswer)) } + def second_to_last; end + + sig { returns(::FeedbackAnswer) } + def second_to_last!; end + + sig { returns(::FeedbackAnswer) } + 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: ::FeedbackAnswer).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::FeedbackAnswer)) } + sig { params(limit: Integer).returns(T::Array[::FeedbackAnswer]) } + def take(limit = nil); end + + sig { returns(::FeedbackAnswer) } + def take!; end + + sig { returns(T.nilable(::FeedbackAnswer)) } + def third; end + + sig { returns(::FeedbackAnswer) } + def third!; end + + sig { returns(T.nilable(::FeedbackAnswer)) } + def third_to_last; end + + sig { returns(::FeedbackAnswer) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def build_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Exercise) } + def build_exercise(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::FeedbackQuestion) } + def build_feedback_question(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Submission) } + def build_submission(*args, &blk); end + + sig { returns(T.nilable(::Course)) } + def course; end + + sig { params(value: T.nilable(::Course)).void } + def course=(value); end + + sig { returns(T::Boolean) } + def course_changed?; end + + sig { returns(T::Boolean) } + def course_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Exercise) } + def create_exercise(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Exercise) } + def create_exercise!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::FeedbackQuestion) } + def create_feedback_question(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::FeedbackQuestion) } + def create_feedback_question!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Submission) } + def create_submission(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Submission) } + def create_submission!(*args, &blk); end + + sig { returns(T.nilable(::Exercise)) } + def exercise; end + + sig { params(value: T.nilable(::Exercise)).void } + def exercise=(value); end + + sig { returns(T::Boolean) } + def exercise_changed?; end + + sig { returns(T::Boolean) } + def exercise_previously_changed?; end + + sig { returns(T.nilable(::FeedbackQuestion)) } + def feedback_question; end + + sig { params(value: T.nilable(::FeedbackQuestion)).void } + def feedback_question=(value); end + + sig { returns(T::Boolean) } + def feedback_question_changed?; end + + sig { returns(T::Boolean) } + def feedback_question_previously_changed?; end + + sig { returns(T.nilable(::Course)) } + def reload_course; end + + sig { returns(T.nilable(::Exercise)) } + def reload_exercise; end + + sig { returns(T.nilable(::FeedbackQuestion)) } + def reload_feedback_question; end + + sig { returns(T.nilable(::Submission)) } + def reload_submission; end + + sig { returns(T::Array[T.untyped]) } + def reply_to_feedback_answer_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def reply_to_feedback_answer_ids=(ids); end + + # This method is created by ActiveRecord on the `FeedbackAnswer` class because it declared `has_many :reply_to_feedback_answers`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::ReplyToFeedbackAnswer::PrivateCollectionProxy) } + def reply_to_feedback_answers; end + + sig { params(value: T::Enumerable[::ReplyToFeedbackAnswer]).void } + def reply_to_feedback_answers=(value); end + + sig { void } + def reset_course; end + + sig { void } + def reset_exercise; end + + sig { void } + def reset_feedback_question; end + + sig { void } + def reset_submission; end + + sig { returns(T.nilable(::Submission)) } + def submission; end + + sig { params(value: T.nilable(::Submission)).void } + def submission=(value); end + + sig { returns(T::Boolean) } + def submission_changed?; end + + sig { returns(T::Boolean) } + def submission_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 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: ::FeedbackAnswer).returns(BasicObject) + ).returns(T::Array[::FeedbackAnswer]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::String) } + def answer; end + + sig { params(value: ::String).returns(::String) } + def answer=(value); end + + sig { returns(T::Boolean) } + def answer?; end + + sig { returns(T.nilable(::String)) } + def answer_before_last_save; end + + sig { returns(T.untyped) } + def answer_before_type_cast; end + + sig { returns(T::Boolean) } + def answer_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def answer_change; end + + sig { returns(T.nilable([::String, ::String])) } + def answer_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def answer_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def answer_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def answer_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def answer_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def answer_previously_was; end + + sig { returns(T.nilable(::String)) } + def answer_was; end + + sig { void } + def answer_will_change!; end + + sig { returns(::Integer) } + def course_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def course_id=(value); end + + sig { returns(T::Boolean) } + def course_id?; end + + sig { returns(T.nilable(::Integer)) } + def course_id_before_last_save; end + + sig { returns(T.untyped) } + def course_id_before_type_cast; end + + sig { returns(T::Boolean) } + def course_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def course_id_was; end + + sig { void } + def course_id_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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(::String) } + def exercise_name; end + + sig { params(value: ::String).returns(::String) } + def exercise_name=(value); end + + sig { returns(T::Boolean) } + def exercise_name?; end + + sig { returns(T.nilable(::String)) } + def exercise_name_before_last_save; end + + sig { returns(T.untyped) } + def exercise_name_before_type_cast; end + + sig { returns(T::Boolean) } + def exercise_name_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def exercise_name_change; end + + sig { returns(T.nilable([::String, ::String])) } + def exercise_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def exercise_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def exercise_name_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def exercise_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def exercise_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def exercise_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def exercise_name_was; end + + sig { void } + def exercise_name_will_change!; end + + sig { returns(::Integer) } + def feedback_question_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def feedback_question_id=(value); end + + sig { returns(T::Boolean) } + def feedback_question_id?; end + + sig { returns(T.nilable(::Integer)) } + def feedback_question_id_before_last_save; end + + sig { returns(T.untyped) } + def feedback_question_id_before_type_cast; end + + sig { returns(T::Boolean) } + def feedback_question_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def feedback_question_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def feedback_question_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def feedback_question_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def feedback_question_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def feedback_question_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def feedback_question_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def feedback_question_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def feedback_question_id_was; end + + sig { void } + def feedback_question_id_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 { void } + def restore_answer!; end + + sig { void } + def restore_course_id!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_exercise_name!; end + + sig { void } + def restore_feedback_question_id!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_submission_id!; end + + sig { void } + def restore_updated_at!; end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_answer; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_answer?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_course_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_course_id?(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_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([::String, ::String])) } + def saved_change_to_exercise_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_exercise_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_feedback_question_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_feedback_question_id?(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_submission_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_submission_id?(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_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)) } + def submission_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def submission_id=(value); end + + sig { returns(T::Boolean) } + def submission_id?; end + + sig { returns(T.nilable(::Integer)) } + def submission_id_before_last_save; end + + sig { returns(T.untyped) } + def submission_id_before_type_cast; end + + sig { returns(T::Boolean) } + def submission_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def submission_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def submission_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def submission_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def submission_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def submission_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def submission_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def submission_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def submission_id_was; end + + sig { void } + def submission_id_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_answer?(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_course_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_exercise_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_feedback_question_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?(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_submission_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 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: ::FeedbackAnswer).returns(BasicObject) + ).returns(T::Array[::FeedbackAnswer]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::FeedbackAnswer } } + + sig { returns(T::Array[::FeedbackAnswer]) } + def to_a; end + + sig { returns(T::Array[::FeedbackAnswer]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::FeedbackAnswer } } + + 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: ::FeedbackAnswer } } + + 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: ::FeedbackAnswer } } + + sig do + params( + records: T.any(::FeedbackAnswer, T::Enumerable[T.any(::FeedbackAnswer, T::Enumerable[::FeedbackAnswer])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::FeedbackAnswer, T::Enumerable[T.any(::FeedbackAnswer, T::Enumerable[::FeedbackAnswer])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::FeedbackAnswer, T::Enumerable[T.any(::FeedbackAnswer, T::Enumerable[::FeedbackAnswer])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::FeedbackAnswer, Integer, String, T::Enumerable[T.any(::FeedbackAnswer, Integer, String, T::Enumerable[::FeedbackAnswer])]) + ).returns(T::Array[::FeedbackAnswer]) + end + def delete(*records); end + + sig do + params( + records: T.any(::FeedbackAnswer, Integer, String, T::Enumerable[T.any(::FeedbackAnswer, Integer, String, T::Enumerable[::FeedbackAnswer])]) + ).returns(T::Array[::FeedbackAnswer]) + end + def destroy(*records); end + + sig { returns(T::Array[::FeedbackAnswer]) } + def load_target; end + + sig do + params( + records: T.any(::FeedbackAnswer, T::Enumerable[T.any(::FeedbackAnswer, T::Enumerable[::FeedbackAnswer])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::FeedbackAnswer, T::Enumerable[T.any(::FeedbackAnswer, T::Enumerable[::FeedbackAnswer])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::FeedbackAnswer, T::Enumerable[T.any(::FeedbackAnswer, T::Enumerable[::FeedbackAnswer])]) + ).returns(T::Array[::FeedbackAnswer]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::FeedbackAnswer]) } + def target; end + + sig { returns(T::Array[::FeedbackAnswer]) } + def to_a; end + + sig { returns(T::Array[::FeedbackAnswer]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::FeedbackAnswer } } + + sig { returns(T::Array[::FeedbackAnswer]) } + def to_a; end + + sig { returns(T::Array[::FeedbackAnswer]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::FeedbackAnswer } } + + 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: ::FeedbackAnswer } } + + 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/feedback_question.rbi b/sorbet/rbi/dsl/feedback_question.rbi new file mode 100644 index 000000000..4c71d842f --- /dev/null +++ b/sorbet/rbi/dsl/feedback_question.rbi @@ -0,0 +1,1458 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `FeedbackQuestion`. +# Please instead update this file by running `bin/tapioca dsl FeedbackQuestion`. + + +class FeedbackQuestion + 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: ::FeedbackQuestion).void) + ).returns(::FeedbackQuestion) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::FeedbackQuestion).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: ::FeedbackQuestion).void)).returns(::FeedbackQuestion) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void) + ).returns(T::Array[::FeedbackQuestion]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void) + ).returns(::FeedbackQuestion) + 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: ::FeedbackQuestion).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void)).returns(::FeedbackQuestion) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void) + ).returns(T::Array[::FeedbackQuestion]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void) + ).returns(::FeedbackQuestion) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void)).returns(::FeedbackQuestion) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void) + ).returns(T::Array[::FeedbackQuestion]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void) + ).returns(::FeedbackQuestion) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void) + ).returns(T::Array[::FeedbackQuestion]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void) + ).returns(::FeedbackQuestion) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void) + ).returns(T::Array[::FeedbackQuestion]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void) + ).returns(::FeedbackQuestion) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::FeedbackQuestion]) } + def destroy_all; end + + sig { returns(T::Array[::FeedbackQuestion]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::FeedbackQuestion]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::FeedbackQuestion)) } + def fifth; end + + sig { returns(::FeedbackQuestion) } + 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(::FeedbackQuestion) + 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[::FeedbackQuestion]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::FeedbackQuestion).void + ).returns(T.nilable(::FeedbackQuestion)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::FeedbackQuestion)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::FeedbackQuestion) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::FeedbackQuestion).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::FeedbackQuestion]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::FeedbackQuestion]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::FeedbackQuestion]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void) + ).returns(T::Array[::FeedbackQuestion]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void) + ).returns(::FeedbackQuestion) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void) + ).returns(T::Array[::FeedbackQuestion]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void) + ).returns(::FeedbackQuestion) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void) + ).returns(T::Array[::FeedbackQuestion]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void) + ).returns(::FeedbackQuestion) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::FeedbackQuestion)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::FeedbackQuestion) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::FeedbackQuestion) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::FeedbackQuestion)) } + sig { params(limit: Integer).returns(T::Array[::FeedbackQuestion]) } + def first(limit = nil); end + + sig { returns(::FeedbackQuestion) } + def first!; end + + sig { returns(T.nilable(::FeedbackQuestion)) } + def forty_two; end + + sig { returns(::FeedbackQuestion) } + def forty_two!; end + + sig { returns(T.nilable(::FeedbackQuestion)) } + def fourth; end + + sig { returns(::FeedbackQuestion) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::FeedbackQuestion)) } + sig { params(limit: Integer).returns(T::Array[::FeedbackQuestion]) } + def last(limit = nil); end + + sig { returns(::FeedbackQuestion) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::FeedbackQuestion).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: ::FeedbackQuestion).void)).returns(::FeedbackQuestion) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void) + ).returns(T::Array[::FeedbackQuestion]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::FeedbackQuestion).void) + ).returns(::FeedbackQuestion) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::FeedbackQuestion).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::FeedbackQuestion).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(::FeedbackQuestion)) } + def second; end + + sig { returns(::FeedbackQuestion) } + def second!; end + + sig { returns(T.nilable(::FeedbackQuestion)) } + def second_to_last; end + + sig { returns(::FeedbackQuestion) } + def second_to_last!; end + + sig { returns(::FeedbackQuestion) } + 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: ::FeedbackQuestion).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::FeedbackQuestion)) } + sig { params(limit: Integer).returns(T::Array[::FeedbackQuestion]) } + def take(limit = nil); end + + sig { returns(::FeedbackQuestion) } + def take!; end + + sig { returns(T.nilable(::FeedbackQuestion)) } + def third; end + + sig { returns(::FeedbackQuestion) } + def third!; end + + sig { returns(T.nilable(::FeedbackQuestion)) } + def third_to_last; end + + sig { returns(::FeedbackQuestion) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def build_course(*args, &blk); end + + sig { returns(T.nilable(::Course)) } + def course; end + + sig { params(value: T.nilable(::Course)).void } + def course=(value); end + + sig { returns(T::Boolean) } + def course_changed?; end + + sig { returns(T::Boolean) } + def course_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course!(*args, &blk); end + + sig { returns(T::Array[T.untyped]) } + def feedback_answer_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def feedback_answer_ids=(ids); end + + # This method is created by ActiveRecord on the `FeedbackQuestion` class because it declared `has_many :feedback_answers`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::FeedbackAnswer::PrivateCollectionProxy) } + def feedback_answers; end + + sig { params(value: T::Enumerable[::FeedbackAnswer]).void } + def feedback_answers=(value); end + + sig { returns(T.nilable(::Course)) } + def reload_course; end + + sig { void } + def reset_course; 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 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: ::FeedbackQuestion).returns(BasicObject) + ).returns(T::Array[::FeedbackQuestion]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::Integer) } + def course_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def course_id=(value); end + + sig { returns(T::Boolean) } + def course_id?; end + + sig { returns(T.nilable(::Integer)) } + def course_id_before_last_save; end + + sig { returns(T.untyped) } + def course_id_before_type_cast; end + + sig { returns(T::Boolean) } + def course_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def course_id_was; end + + sig { void } + def course_id_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 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(::Integer) } + def position; end + + sig { params(value: ::Integer).returns(::Integer) } + def position=(value); end + + sig { returns(T::Boolean) } + def position?; end + + sig { returns(T.nilable(::Integer)) } + def position_before_last_save; end + + sig { returns(T.untyped) } + def position_before_type_cast; end + + sig { returns(T::Boolean) } + def position_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def position_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def position_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def position_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def position_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def position_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def position_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def position_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def position_was; end + + sig { void } + def position_will_change!; end + + sig { returns(::String) } + def question; end + + sig { params(value: ::String).returns(::String) } + def question=(value); end + + sig { returns(T::Boolean) } + def question?; end + + sig { returns(T.nilable(::String)) } + def question_before_last_save; end + + sig { returns(T.untyped) } + def question_before_type_cast; end + + sig { returns(T::Boolean) } + def question_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def question_change; end + + sig { returns(T.nilable([::String, ::String])) } + def question_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def question_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def question_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def question_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def question_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def question_previously_was; end + + sig { returns(T.nilable(::String)) } + def question_was; end + + sig { void } + def question_will_change!; end + + sig { void } + def restore_course_id!; 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_kind!; end + + sig { void } + def restore_position!; end + + sig { void } + def restore_question!; end + + sig { void } + def restore_title!; end + + sig { void } + def restore_updated_at!; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_course_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_course_id?(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_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_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([::Integer, ::Integer])) } + def saved_change_to_position; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_position?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_question; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_question?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_title; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_title?(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_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(::String)) } + def title; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def title=(value); end + + sig { returns(T::Boolean) } + def title?; end + + sig { returns(T.nilable(::String)) } + def title_before_last_save; end + + sig { returns(T.untyped) } + def title_before_type_cast; end + + sig { returns(T::Boolean) } + def title_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def title_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def title_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def title_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def title_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def title_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def title_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def title_previously_was; end + + sig { returns(T.nilable(::String)) } + def title_was; end + + sig { void } + def title_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_course_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_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_position?(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_question?(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_title?(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 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: ::FeedbackQuestion).returns(BasicObject) + ).returns(T::Array[::FeedbackQuestion]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::FeedbackQuestion } } + + sig { returns(T::Array[::FeedbackQuestion]) } + def to_a; end + + sig { returns(T::Array[::FeedbackQuestion]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::FeedbackQuestion } } + + 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: ::FeedbackQuestion } } + + 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: ::FeedbackQuestion } } + + sig do + params( + records: T.any(::FeedbackQuestion, T::Enumerable[T.any(::FeedbackQuestion, T::Enumerable[::FeedbackQuestion])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::FeedbackQuestion, T::Enumerable[T.any(::FeedbackQuestion, T::Enumerable[::FeedbackQuestion])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::FeedbackQuestion, T::Enumerable[T.any(::FeedbackQuestion, T::Enumerable[::FeedbackQuestion])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::FeedbackQuestion, Integer, String, T::Enumerable[T.any(::FeedbackQuestion, Integer, String, T::Enumerable[::FeedbackQuestion])]) + ).returns(T::Array[::FeedbackQuestion]) + end + def delete(*records); end + + sig do + params( + records: T.any(::FeedbackQuestion, Integer, String, T::Enumerable[T.any(::FeedbackQuestion, Integer, String, T::Enumerable[::FeedbackQuestion])]) + ).returns(T::Array[::FeedbackQuestion]) + end + def destroy(*records); end + + sig { returns(T::Array[::FeedbackQuestion]) } + def load_target; end + + sig do + params( + records: T.any(::FeedbackQuestion, T::Enumerable[T.any(::FeedbackQuestion, T::Enumerable[::FeedbackQuestion])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::FeedbackQuestion, T::Enumerable[T.any(::FeedbackQuestion, T::Enumerable[::FeedbackQuestion])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::FeedbackQuestion, T::Enumerable[T.any(::FeedbackQuestion, T::Enumerable[::FeedbackQuestion])]) + ).returns(T::Array[::FeedbackQuestion]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::FeedbackQuestion]) } + def target; end + + sig { returns(T::Array[::FeedbackQuestion]) } + def to_a; end + + sig { returns(T::Array[::FeedbackQuestion]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::FeedbackQuestion } } + + sig { returns(T::Array[::FeedbackQuestion]) } + def to_a; end + + sig { returns(T::Array[::FeedbackQuestion]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::FeedbackQuestion } } + + 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: ::FeedbackQuestion } } + + 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/feedback_reply_mailer.rbi b/sorbet/rbi/dsl/feedback_reply_mailer.rbi new file mode 100644 index 000000000..e5dcec702 --- /dev/null +++ b/sorbet/rbi/dsl/feedback_reply_mailer.rbi @@ -0,0 +1,23 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `FeedbackReplyMailer`. +# Please instead update this file by running `bin/tapioca dsl FeedbackReplyMailer`. + + +class FeedbackReplyMailer + include GeneratedUrlHelpersModule + include GeneratedMountedHelpers + + class << self + sig do + params( + reply_to: ::String, + to: T.nilable(::String), + body: T.nilable(::String), + exercise_name: ::String + ).returns(::ActionMailer::MessageDelivery) + end + def feedback_email(reply_to, to, body, exercise_name); end + end +end diff --git a/sorbet/rbi/dsl/generated_mounted_helpers.rbi b/sorbet/rbi/dsl/generated_mounted_helpers.rbi new file mode 100644 index 000000000..cd893aa78 --- /dev/null +++ b/sorbet/rbi/dsl/generated_mounted_helpers.rbi @@ -0,0 +1,24 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `GeneratedMountedHelpers`. +# Please instead update this file by running `bin/tapioca dsl GeneratedMountedHelpers`. + + +module GeneratedMountedHelpers + sig { returns(GeneratedRoutesProxy) } + def main_app; end + + sig { returns(PgHero::Engine::GeneratedRoutesProxy) } + def pg_hero; end +end + +class GeneratedRoutesProxy < ::ActionDispatch::Routing::RoutesProxy + include GeneratedPathHelpersModule + include GeneratedUrlHelpersModule +end + +class PgHero::Engine::GeneratedRoutesProxy < ::ActionDispatch::Routing::RoutesProxy + include PgHero::Engine::GeneratedPathHelpersModule + include PgHero::Engine::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 000000000..41b5f0123 --- /dev/null +++ b/sorbet/rbi/dsl/generated_path_helpers_module.rbi @@ -0,0 +1,779 @@ +# 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 all_courses_organization_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_beta_course_id_information_index_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_beta_demo_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_beta_participant_index_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_apidocs_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_application_credentials_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_course_review_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_course_reviews_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_course_unlock_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_exercise_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_exercise_submissions_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_exercises_details_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_organization_courses_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_submission_feedback_index_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_submission_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_submission_reviews_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_all_courses_with_this_template_index_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_exercise_points_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_exercise_user_points_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_exercises_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_points_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_submissions_last_hour_index_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_submissions_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_user_points_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_user_submissions_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_exercise_model_solutions_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_exercise_user_submissions_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_eligible_students_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_exercise_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_exercise_points_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_exercise_user_points_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_exercises_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_points_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_submissions_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_user_points_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_user_progress_index_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_user_submissions_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_memberships_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organizations_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_user_app_datum_index_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_user_assistantships_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_user_field_value_index_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_user_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_user_request_deletion_index_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_user_teacherships_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_users_basic_info_by_emails_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_users_basic_info_by_ids_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_users_basic_info_by_usernames_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_users_password_reset_index_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_users_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_users_recently_changed_user_details_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def auth_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def certificate_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def certificates_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def confirm_email_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def course_migrate_to_other_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def course_template_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def course_templates_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def courses_api_beta_participant_index_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def courses_api_beta_participant_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def courses_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def dangerously_destroy_user_participant_settings_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def destroy_user_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def disable_organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def disable_organization_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def disable_reason_input_organization_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def download_api_v8_core_exercise_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def download_api_v8_core_exercise_solution_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def download_api_v8_core_submission_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def download_api_v8_organization_course_exercise_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_course_template_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_oauth_application_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_participant_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_password_reset_key_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_setup_organization_course_course_details_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_setup_organization_course_course_timing_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_setup_organization_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_user_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def emails_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def enable_organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def exercise_feedback_answers_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def exercise_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def exercise_solution_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def exercise_submissions_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def exercise_update_submissions_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def feedback_answer_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def feedback_question_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def feedback_question_position_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def feedback_replies_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def force_migrate_to_courses_mooc_fi_participant_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def get_user_with_email_api_v8_users_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def list_requests_organizations_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 manage_deadlines_organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def manage_exercises_organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def manage_unlocks_organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def me_participants_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def migrate_course_migrate_to_other_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def migrate_organization_course_migrate_to_other_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def model_solution_token_used_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def model_solution_token_useds_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def native_oauth_authorization_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_course_template_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_custom_setup_organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_oauth_application_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_organization_course_course_notifications_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_organization_course_feedback_question_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_organization_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_participant_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_password_reset_key_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_session_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_setup_organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_setup_organization_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_submission_review_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_user_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_application_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_applications_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_authorization_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_authorized_application_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_authorized_applications_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_discovery_keys_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_discovery_provider_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_discovery_webfinger_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_introspect_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_revoke_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_token_info_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_token_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_userinfo_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def one_course_json_organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_course_notifications_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_exercise_status_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_exercises_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_feedback_answers_chart_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_feedback_answers_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_feedback_questions_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_help_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_migrate_to_other_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_point_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_points_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_reviewed_submissions_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_reviews_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_stat_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_stats_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_submissions_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_templates_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_unlock_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_courses_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_emails_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_exercise_feedback_answers_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_exercise_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_exercise_solution_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_exercise_submissions_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_participants_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_stats_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_teacher_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_teachers_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def organizations_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def page_presence_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def participant_certificates_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def participant_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def participant_settings_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def participants_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def password_reset_key_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def password_reset_keys_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def password_reset_link_participant_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def paste_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def pg_hero_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_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 refresh_course_template_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def refresh_organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def reset_password_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def reset_password_pretty_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def review_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def root_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def save_deadlines_organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def save_unlocks_organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def send_destroy_email_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def send_verification_email_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def session_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def sessions_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def set_disabled_statuses_organization_course_exercises_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def set_password_managed_by_courses_mooc_fi_api_v8_user_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_organization_course_chooser_index_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_organization_course_course_assistant_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_organization_course_course_assistants_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_organization_course_course_details_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_organization_course_course_finisher_index_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_organization_course_course_timing_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_organization_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_organizations_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_start_index_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def signin_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def signout_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def stats_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def status_index_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def students_organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def submission_difference_with_solution_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def submission_feedback_answers_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def submission_files_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def submission_full_zip_index_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def submission_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def submission_processing_times_api_beta_stats_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def submission_queue_times_api_beta_stats_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def submission_result_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def submission_reviews_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def toggle_code_review_requests_organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def toggle_hidden_course_template_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def toggle_hidden_organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def toggle_submission_result_visibility_organization_course_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def toggle_submission_result_visibility_organization_exercise_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def toggle_visibility_organization_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_has_submissions_participant_settings_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 + + sig { params(args: T.untyped).returns(String) } + def verify_dangerously_destroying_user_participant_settings_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def verify_destroying_user_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def verify_organization_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 000000000..c71c54882 --- /dev/null +++ b/sorbet/rbi/dsl/generated_url_helpers_module.rbi @@ -0,0 +1,779 @@ +# 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 all_courses_organization_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_beta_course_id_information_index_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_beta_demo_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_beta_participant_index_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_apidocs_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_application_credentials_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_course_review_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_course_reviews_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_course_unlock_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_exercise_submissions_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_exercise_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_exercises_details_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_organization_courses_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_submission_feedback_index_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_submission_reviews_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_core_submission_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_all_courses_with_this_template_index_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_exercise_points_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_exercise_user_points_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_exercises_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_points_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_submissions_last_hour_index_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_submissions_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_user_points_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_course_user_submissions_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_exercise_model_solutions_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_exercise_user_submissions_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_eligible_students_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_exercise_points_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_exercise_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_exercise_user_points_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_exercises_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_points_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_submissions_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_user_points_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_user_progress_index_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_course_user_submissions_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_memberships_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organization_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_organizations_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_user_app_datum_index_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_user_assistantships_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_user_field_value_index_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_user_request_deletion_index_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_user_teacherships_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_user_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_users_basic_info_by_emails_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_users_basic_info_by_ids_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_users_basic_info_by_usernames_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_users_password_reset_index_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_users_recently_changed_user_details_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def api_v8_users_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def auth_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def certificate_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def certificates_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def confirm_email_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def course_migrate_to_other_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def course_template_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def course_templates_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def courses_api_beta_participant_index_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def courses_api_beta_participant_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def courses_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def dangerously_destroy_user_participant_settings_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def destroy_user_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def disable_organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def disable_organization_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def disable_reason_input_organization_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def download_api_v8_core_exercise_solution_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def download_api_v8_core_exercise_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def download_api_v8_core_submission_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def download_api_v8_organization_course_exercise_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_course_template_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_oauth_application_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_participant_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_password_reset_key_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_setup_organization_course_course_details_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_setup_organization_course_course_timing_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_setup_organization_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def edit_user_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def emails_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def enable_organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def exercise_feedback_answers_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def exercise_solution_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def exercise_submissions_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def exercise_update_submissions_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def exercise_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def feedback_answer_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def feedback_question_position_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def feedback_question_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def feedback_replies_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def force_migrate_to_courses_mooc_fi_participant_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def get_user_with_email_api_v8_users_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def list_requests_organizations_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 manage_deadlines_organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def manage_exercises_organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def manage_unlocks_organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def me_participants_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def migrate_course_migrate_to_other_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def migrate_organization_course_migrate_to_other_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def model_solution_token_used_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def model_solution_token_useds_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def native_oauth_authorization_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_course_template_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_custom_setup_organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_oauth_application_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_organization_course_course_notifications_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_organization_course_feedback_question_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_organization_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_participant_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_password_reset_key_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_session_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_setup_organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_setup_organization_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_submission_review_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def new_user_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_application_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_applications_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_authorization_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_authorized_application_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_authorized_applications_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_discovery_keys_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_discovery_provider_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_discovery_webfinger_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_introspect_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_revoke_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_token_info_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_token_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def oauth_userinfo_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def one_course_json_organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_course_notifications_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_exercise_status_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_exercises_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_feedback_answers_chart_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_feedback_answers_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_feedback_questions_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_help_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_migrate_to_other_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_point_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_points_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_reviewed_submissions_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_reviews_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_stat_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_stats_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_submissions_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_templates_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_unlock_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_courses_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_emails_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_exercise_feedback_answers_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_exercise_solution_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_exercise_submissions_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_exercise_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_participants_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_stats_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_teacher_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_teachers_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organization_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def organizations_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def page_presence_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def participant_certificates_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def participant_settings_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def participant_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def participants_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def password_reset_key_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def password_reset_keys_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def password_reset_link_participant_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def paste_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def pg_hero_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_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 refresh_course_template_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def refresh_organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def reset_password_pretty_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def reset_password_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def review_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def root_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def save_deadlines_organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def save_unlocks_organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def send_destroy_email_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def send_verification_email_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def session_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def sessions_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def set_disabled_statuses_organization_course_exercises_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def set_password_managed_by_courses_mooc_fi_api_v8_user_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_organization_course_chooser_index_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_organization_course_course_assistant_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_organization_course_course_assistants_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_organization_course_course_details_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_organization_course_course_finisher_index_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_organization_course_course_timing_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_organization_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_organizations_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def setup_start_index_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def signin_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def signout_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def stats_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def status_index_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def students_organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def submission_difference_with_solution_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def submission_feedback_answers_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def submission_files_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def submission_full_zip_index_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def submission_processing_times_api_beta_stats_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def submission_queue_times_api_beta_stats_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def submission_result_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def submission_reviews_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def submission_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def toggle_code_review_requests_organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def toggle_hidden_course_template_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def toggle_hidden_organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def toggle_submission_result_visibility_organization_course_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def toggle_submission_result_visibility_organization_exercise_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def toggle_visibility_organization_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_has_submissions_participant_settings_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 + + sig { params(args: T.untyped).returns(String) } + def verify_dangerously_destroying_user_participant_settings_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def verify_destroying_user_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def verify_organization_url(*args); end +end diff --git a/sorbet/rbi/dsl/guest.rbi b/sorbet/rbi/dsl/guest.rbi new file mode 100644 index 000000000..27a8cb12a --- /dev/null +++ b/sorbet/rbi/dsl/guest.rbi @@ -0,0 +1,1917 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Guest`. +# Please instead update this file by running `bin/tapioca dsl Guest`. + + +class Guest + 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: ::Guest).void)).returns(::Guest) } + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::Guest).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: ::Guest).void)).returns(::Guest) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Guest).void) + ).returns(T::Array[::Guest]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Guest).void)).returns(::Guest) } + 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: ::Guest).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Guest).void)).returns(::Guest) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Guest).void) + ).returns(T::Array[::Guest]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Guest).void)).returns(::Guest) } + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Guest).void)).returns(::Guest) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Guest).void) + ).returns(T::Array[::Guest]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Guest).void)).returns(::Guest) } + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Guest).void) + ).returns(T::Array[::Guest]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Guest).void)).returns(::Guest) } + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Guest).void) + ).returns(T::Array[::Guest]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Guest).void)).returns(::Guest) } + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::Guest]) } + def destroy_all; end + + sig { returns(T::Array[::Guest]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Guest]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Guest)) } + def fifth; end + + sig { returns(::Guest) } + 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(::Guest) + 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[::Guest]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::Guest).void).returns(T.nilable(::Guest)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Guest)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Guest) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::Guest).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::Guest]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::Guest]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::Guest]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Guest).void) + ).returns(T::Array[::Guest]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Guest).void)).returns(::Guest) } + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Guest).void) + ).returns(T::Array[::Guest]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Guest).void)).returns(::Guest) } + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Guest).void) + ).returns(T::Array[::Guest]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Guest).void)).returns(::Guest) } + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Guest)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Guest) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Guest) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Guest)) } + sig { params(limit: Integer).returns(T::Array[::Guest]) } + def first(limit = nil); end + + sig { returns(::Guest) } + def first!; end + + sig { returns(T.nilable(::Guest)) } + def forty_two; end + + sig { returns(::Guest) } + def forty_two!; end + + sig { returns(T.nilable(::Guest)) } + def fourth; end + + sig { returns(::Guest) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::Guest)) } + sig { params(limit: Integer).returns(T::Array[::Guest]) } + def last(limit = nil); end + + sig { returns(::Guest) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::Guest).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: ::Guest).void)).returns(::Guest) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Guest).void) + ).returns(T::Array[::Guest]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Guest).void)).returns(::Guest) } + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Guest).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Guest).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(::Guest)) } + def second; end + + sig { returns(::Guest) } + def second!; end + + sig { returns(T.nilable(::Guest)) } + def second_to_last; end + + sig { returns(::Guest) } + def second_to_last!; end + + sig { returns(::Guest) } + 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: ::Guest).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Guest)) } + sig { params(limit: Integer).returns(T::Array[::Guest]) } + def take(limit = nil); end + + sig { returns(::Guest) } + def take!; end + + sig { returns(T.nilable(::Guest)) } + def third; end + + sig { returns(::Guest) } + def third!; end + + sig { returns(T.nilable(::Guest)) } + def third_to_last; end + + sig { returns(::Guest) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { returns(T::Array[T.untyped]) } + def action_token_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def action_token_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :action_tokens`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::ActionToken::PrivateCollectionProxy) } + def action_tokens; end + + sig { params(value: T::Enumerable[::ActionToken]).void } + def action_tokens=(value); end + + sig { returns(T::Array[T.untyped]) } + def assistantship_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def assistantship_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :assistantships`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Assistantship::PrivateCollectionProxy) } + def assistantships; end + + sig { params(value: T::Enumerable[::Assistantship]).void } + def assistantships=(value); end + + sig { returns(T::Array[T.untyped]) } + def assisted_course_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def assisted_course_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :assisted_courses, through: :assistantships`. + # 🔗 [Rails guide for `has_many_through` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-through-association) + sig { returns(::Course::PrivateCollectionProxy) } + def assisted_courses; end + + sig { params(value: T::Enumerable[::Course]).void } + def assisted_courses=(value); end + + sig { returns(T::Array[T.untyped]) } + def awarded_point_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def awarded_point_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :awarded_points`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::AwardedPoint::PrivateCollectionProxy) } + def awarded_points; end + + sig { params(value: T::Enumerable[::AwardedPoint]).void } + def awarded_points=(value); end + + sig { returns(T::Array[T.untyped]) } + def certificate_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def certificate_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :certificates`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Certificate::PrivateCollectionProxy) } + def certificates; end + + sig { params(value: T::Enumerable[::Certificate]).void } + def certificates=(value); end + + sig { returns(T::Array[T.untyped]) } + def course_notification_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def course_notification_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :course_notifications`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::CourseNotification::PrivateCollectionProxy) } + def course_notifications; end + + sig { params(value: T::Enumerable[::CourseNotification]).void } + def course_notifications=(value); end + + sig { returns(T::Array[T.untyped]) } + def course_template_refresh_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def course_template_refresh_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :course_template_refreshes`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::CourseTemplateRefresh::PrivateCollectionProxy) } + def course_template_refreshes; end + + sig { params(value: T::Enumerable[::CourseTemplateRefresh]).void } + def course_template_refreshes=(value); end + + sig { returns(T::Array[T.untyped]) } + def membership_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def membership_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :memberships, through: :organization_memberships`. + # 🔗 [Rails guide for `has_many_through` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-through-association) + sig { returns(::Organization::PrivateCollectionProxy) } + def memberships; end + + sig { params(value: T::Enumerable[::Organization]).void } + def memberships=(value); end + + sig { returns(T::Array[T.untyped]) } + def model_solution_token_used_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def model_solution_token_used_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :model_solution_token_useds`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::ModelSolutionTokenUsed::PrivateCollectionProxy) } + def model_solution_token_useds; end + + sig { params(value: T::Enumerable[::ModelSolutionTokenUsed]).void } + def model_solution_token_useds=(value); end + + sig { returns(T::Array[T.untyped]) } + def organization_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def organization_ids=(ids); end + + sig { returns(T::Array[T.untyped]) } + def organization_membership_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def organization_membership_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :organization_memberships`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::OrganizationMembership::PrivateCollectionProxy) } + def organization_memberships; end + + sig { params(value: T::Enumerable[::OrganizationMembership]).void } + def organization_memberships=(value); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :organizations, through: :teacherships`. + # 🔗 [Rails guide for `has_many_through` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-through-association) + sig { returns(::Organization::PrivateCollectionProxy) } + def organizations; end + + sig { params(value: T::Enumerable[::Organization]).void } + def organizations=(value); end + + sig { returns(T::Array[T.untyped]) } + def review_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def review_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :reviews`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Review::PrivateCollectionProxy) } + def reviews; end + + sig { params(value: T::Enumerable[::Review]).void } + def reviews=(value); end + + sig { returns(T::Array[T.untyped]) } + def submission_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def submission_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :submissions`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Submission::PrivateCollectionProxy) } + def submissions; end + + sig { params(value: T::Enumerable[::Submission]).void } + def submissions=(value); end + + sig { returns(T::Array[T.untyped]) } + def teachership_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def teachership_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :teacherships`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Teachership::PrivateCollectionProxy) } + def teacherships; end + + sig { params(value: T::Enumerable[::Teachership]).void } + def teacherships=(value); end + + sig { returns(T::Array[T.untyped]) } + def uncomputed_unlock_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def uncomputed_unlock_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :uncomputed_unlocks`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::UncomputedUnlock::PrivateCollectionProxy) } + def uncomputed_unlocks; end + + sig { params(value: T::Enumerable[::UncomputedUnlock]).void } + def uncomputed_unlocks=(value); end + + sig { returns(T::Array[T.untyped]) } + def unlock_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def unlock_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :unlocks`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Unlock::PrivateCollectionProxy) } + def unlocks; end + + sig { params(value: T::Enumerable[::Unlock]).void } + def unlocks=(value); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :user_app_data`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::UserAppDatum::PrivateCollectionProxy) } + def user_app_data; end + + sig { params(value: T::Enumerable[::UserAppDatum]).void } + def user_app_data=(value); end + + sig { returns(T::Array[T.untyped]) } + def user_app_datum_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def user_app_datum_ids=(ids); end + + sig { returns(T::Array[T.untyped]) } + def user_field_value_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def user_field_value_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :user_field_values`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::UserFieldValue::PrivateCollectionProxy) } + def user_field_values; end + + sig { params(value: T::Enumerable[::UserFieldValue]).void } + def user_field_values=(value); end + + sig { returns(T::Array[T.untyped]) } + def verification_token_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def verification_token_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :verification_tokens`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::VerificationToken::PrivateCollectionProxy) } + def verification_tokens; end + + sig { params(value: T::Enumerable[::VerificationToken]).void } + def verification_tokens=(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 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 legitimate_students(*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 non_legitimate_students(*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: ::Guest).returns(BasicObject)).returns(T::Array[::Guest]) } + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T::Boolean) } + def administrator; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def administrator=(value); end + + sig { returns(T::Boolean) } + def administrator?; end + + sig { returns(T.nilable(T::Boolean)) } + def administrator_before_last_save; end + + sig { returns(T.untyped) } + def administrator_before_type_cast; end + + sig { returns(T::Boolean) } + def administrator_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def administrator_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def administrator_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def administrator_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def administrator_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def administrator_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def administrator_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def administrator_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def administrator_was; end + + sig { void } + def administrator_will_change!; end + + sig { returns(T.nilable(::String)) } + def argon_hash; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def argon_hash=(value); end + + sig { returns(T::Boolean) } + def argon_hash?; end + + sig { returns(T.nilable(::String)) } + def argon_hash_before_last_save; end + + sig { returns(T.untyped) } + def argon_hash_before_type_cast; end + + sig { returns(T::Boolean) } + def argon_hash_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def argon_hash_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def argon_hash_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def argon_hash_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def argon_hash_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def argon_hash_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def argon_hash_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def argon_hash_previously_was; end + + sig { returns(T.nilable(::String)) } + def argon_hash_was; end + + sig { void } + def argon_hash_will_change!; end + + sig { returns(T.nilable(::String)) } + def courses_mooc_fi_user_id; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def courses_mooc_fi_user_id=(value); end + + sig { returns(T::Boolean) } + def courses_mooc_fi_user_id?; end + + sig { returns(T.nilable(::String)) } + def courses_mooc_fi_user_id_before_last_save; end + + sig { returns(T.untyped) } + def courses_mooc_fi_user_id_before_type_cast; end + + sig { returns(T::Boolean) } + def courses_mooc_fi_user_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def courses_mooc_fi_user_id_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def courses_mooc_fi_user_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def courses_mooc_fi_user_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def courses_mooc_fi_user_id_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def courses_mooc_fi_user_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def courses_mooc_fi_user_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def courses_mooc_fi_user_id_previously_was; end + + sig { returns(T.nilable(::String)) } + def courses_mooc_fi_user_id_was; end + + sig { void } + def courses_mooc_fi_user_id_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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(::String) } + def email; end + + sig { params(value: ::String).returns(::String) } + def email=(value); end + + sig { returns(T::Boolean) } + def email?; end + + sig { returns(T.nilable(::String)) } + def email_before_last_save; end + + sig { returns(T.untyped) } + def email_before_type_cast; end + + sig { returns(T::Boolean) } + def email_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def email_change; end + + sig { returns(T.nilable([::String, ::String])) } + def email_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def email_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def email_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def email_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def email_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def email_previously_was; end + + sig { returns(T::Boolean) } + def email_verified; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def email_verified=(value); end + + sig { returns(T::Boolean) } + def email_verified?; end + + sig { returns(T.nilable(T::Boolean)) } + def email_verified_before_last_save; end + + sig { returns(T.untyped) } + def email_verified_before_type_cast; end + + sig { returns(T::Boolean) } + def email_verified_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def email_verified_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def email_verified_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def email_verified_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def email_verified_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def email_verified_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def email_verified_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def email_verified_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def email_verified_was; end + + sig { void } + def email_verified_will_change!; end + + sig { returns(T.nilable(::String)) } + def email_was; end + + sig { void } + def email_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::Boolean) } + def legitimate_student; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def legitimate_student=(value); end + + sig { returns(T::Boolean) } + def legitimate_student?; end + + sig { returns(T.nilable(T::Boolean)) } + def legitimate_student_before_last_save; end + + sig { returns(T.untyped) } + def legitimate_student_before_type_cast; end + + sig { returns(T::Boolean) } + def legitimate_student_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def legitimate_student_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def legitimate_student_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def legitimate_student_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def legitimate_student_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def legitimate_student_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def legitimate_student_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def legitimate_student_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def legitimate_student_was; end + + sig { void } + def legitimate_student_will_change!; end + + sig { returns(::String) } + def login; end + + sig { params(value: ::String).returns(::String) } + def login=(value); end + + sig { returns(T::Boolean) } + def login?; end + + sig { returns(T.nilable(::String)) } + def login_before_last_save; end + + sig { returns(T.untyped) } + def login_before_type_cast; end + + sig { returns(T::Boolean) } + def login_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def login_change; end + + sig { returns(T.nilable([::String, ::String])) } + def login_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def login_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def login_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def login_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def login_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def login_previously_was; end + + sig { returns(T.nilable(::String)) } + def login_was; end + + sig { void } + def login_will_change!; end + + sig { returns(T.nilable(::String)) } + def password_hash; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def password_hash=(value); end + + sig { returns(T::Boolean) } + def password_hash?; end + + sig { returns(T.nilable(::String)) } + def password_hash_before_last_save; end + + sig { returns(T.untyped) } + def password_hash_before_type_cast; end + + sig { returns(T::Boolean) } + def password_hash_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def password_hash_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def password_hash_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def password_hash_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def password_hash_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def password_hash_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def password_hash_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def password_hash_previously_was; end + + sig { returns(T.nilable(::String)) } + def password_hash_was; end + + sig { void } + def password_hash_will_change!; end + + sig { returns(T::Boolean) } + def password_managed_by_courses_mooc_fi; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def password_managed_by_courses_mooc_fi=(value); end + + sig { returns(T::Boolean) } + def password_managed_by_courses_mooc_fi?; end + + sig { returns(T.nilable(T::Boolean)) } + def password_managed_by_courses_mooc_fi_before_last_save; end + + sig { returns(T.untyped) } + def password_managed_by_courses_mooc_fi_before_type_cast; end + + sig { returns(T::Boolean) } + def password_managed_by_courses_mooc_fi_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def password_managed_by_courses_mooc_fi_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def password_managed_by_courses_mooc_fi_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def password_managed_by_courses_mooc_fi_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def password_managed_by_courses_mooc_fi_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def password_managed_by_courses_mooc_fi_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def password_managed_by_courses_mooc_fi_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def password_managed_by_courses_mooc_fi_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def password_managed_by_courses_mooc_fi_was; end + + sig { void } + def password_managed_by_courses_mooc_fi_will_change!; end + + sig { void } + def restore_administrator!; end + + sig { void } + def restore_argon_hash!; end + + sig { void } + def restore_courses_mooc_fi_user_id!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_email!; end + + sig { void } + def restore_email_verified!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_legitimate_student!; end + + sig { void } + def restore_login!; end + + sig { void } + def restore_password_hash!; end + + sig { void } + def restore_password_managed_by_courses_mooc_fi!; end + + sig { void } + def restore_salt!; end + + sig { void } + def restore_updated_at!; end + + sig { returns(T.nilable(::String)) } + def salt; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def salt=(value); end + + sig { returns(T::Boolean) } + def salt?; end + + sig { returns(T.nilable(::String)) } + def salt_before_last_save; end + + sig { returns(T.untyped) } + def salt_before_type_cast; end + + sig { returns(T::Boolean) } + def salt_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def salt_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def salt_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def salt_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def salt_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def salt_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def salt_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def salt_previously_was; end + + sig { returns(T.nilable(::String)) } + def salt_was; end + + sig { void } + def salt_will_change!; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_administrator; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_administrator?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_argon_hash; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_argon_hash?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_courses_mooc_fi_user_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_courses_mooc_fi_user_id?(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_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([::String, ::String])) } + def saved_change_to_email; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_email?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_email_verified; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_email_verified?(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::Boolean, T::Boolean])) } + def saved_change_to_legitimate_student; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_legitimate_student?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_login; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_login?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_password_hash; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_password_hash?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_password_managed_by_courses_mooc_fi; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_password_managed_by_courses_mooc_fi?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_salt; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_salt?(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_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 updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_administrator?(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_argon_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_courses_mooc_fi_user_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_email?(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_email_verified?(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_legitimate_student?(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_login?(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_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_password_managed_by_courses_mooc_fi?(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_salt?(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 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 legitimate_students(*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 non_legitimate_students(*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: ::Guest).returns(BasicObject)).returns(T::Array[::Guest]) } + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Guest } } + + sig { returns(T::Array[::Guest]) } + def to_a; end + + sig { returns(T::Array[::Guest]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Guest } } + + 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: ::Guest } } + + 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: ::Guest } } + + sig do + params( + records: T.any(::Guest, T::Enumerable[T.any(::Guest, T::Enumerable[::Guest])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Guest, T::Enumerable[T.any(::Guest, T::Enumerable[::Guest])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Guest, T::Enumerable[T.any(::Guest, T::Enumerable[::Guest])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::Guest, Integer, String, T::Enumerable[T.any(::Guest, Integer, String, T::Enumerable[::Guest])]) + ).returns(T::Array[::Guest]) + end + def delete(*records); end + + sig do + params( + records: T.any(::Guest, Integer, String, T::Enumerable[T.any(::Guest, Integer, String, T::Enumerable[::Guest])]) + ).returns(T::Array[::Guest]) + end + def destroy(*records); end + + sig { returns(T::Array[::Guest]) } + def load_target; end + + sig do + params( + records: T.any(::Guest, T::Enumerable[T.any(::Guest, T::Enumerable[::Guest])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Guest, T::Enumerable[T.any(::Guest, T::Enumerable[::Guest])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Guest, T::Enumerable[T.any(::Guest, T::Enumerable[::Guest])]) + ).returns(T::Array[::Guest]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Guest]) } + def target; end + + sig { returns(T::Array[::Guest]) } + def to_a; end + + sig { returns(T::Array[::Guest]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Guest } } + + sig { returns(T::Array[::Guest]) } + def to_a; end + + sig { returns(T::Array[::Guest]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Guest } } + + 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: ::Guest } } + + 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/kafka_batch_update_points.rbi b/sorbet/rbi/dsl/kafka_batch_update_points.rbi new file mode 100644 index 000000000..664f8c6f3 --- /dev/null +++ b/sorbet/rbi/dsl/kafka_batch_update_points.rbi @@ -0,0 +1,1476 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `KafkaBatchUpdatePoints`. +# Please instead update this file by running `bin/tapioca dsl KafkaBatchUpdatePoints`. + + +class KafkaBatchUpdatePoints + 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: ::KafkaBatchUpdatePoints).void) + ).returns(::KafkaBatchUpdatePoints) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::KafkaBatchUpdatePoints).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: ::KafkaBatchUpdatePoints).void) + ).returns(::KafkaBatchUpdatePoints) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(T::Array[::KafkaBatchUpdatePoints]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(::KafkaBatchUpdatePoints) + 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: ::KafkaBatchUpdatePoints).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(::KafkaBatchUpdatePoints) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(T::Array[::KafkaBatchUpdatePoints]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(::KafkaBatchUpdatePoints) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(::KafkaBatchUpdatePoints) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(T::Array[::KafkaBatchUpdatePoints]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(::KafkaBatchUpdatePoints) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(T::Array[::KafkaBatchUpdatePoints]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(::KafkaBatchUpdatePoints) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(T::Array[::KafkaBatchUpdatePoints]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(::KafkaBatchUpdatePoints) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::KafkaBatchUpdatePoints]) } + def destroy_all; end + + sig { returns(T::Array[::KafkaBatchUpdatePoints]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::KafkaBatchUpdatePoints]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::KafkaBatchUpdatePoints)) } + def fifth; end + + sig { returns(::KafkaBatchUpdatePoints) } + 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(::KafkaBatchUpdatePoints) + 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[::KafkaBatchUpdatePoints]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::KafkaBatchUpdatePoints).void + ).returns(T.nilable(::KafkaBatchUpdatePoints)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::KafkaBatchUpdatePoints)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::KafkaBatchUpdatePoints) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::KafkaBatchUpdatePoints).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::KafkaBatchUpdatePoints]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::KafkaBatchUpdatePoints]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::KafkaBatchUpdatePoints]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(T::Array[::KafkaBatchUpdatePoints]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(::KafkaBatchUpdatePoints) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(T::Array[::KafkaBatchUpdatePoints]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(::KafkaBatchUpdatePoints) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(T::Array[::KafkaBatchUpdatePoints]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(::KafkaBatchUpdatePoints) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::KafkaBatchUpdatePoints)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::KafkaBatchUpdatePoints) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::KafkaBatchUpdatePoints) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::KafkaBatchUpdatePoints)) } + sig { params(limit: Integer).returns(T::Array[::KafkaBatchUpdatePoints]) } + def first(limit = nil); end + + sig { returns(::KafkaBatchUpdatePoints) } + def first!; end + + sig { returns(T.nilable(::KafkaBatchUpdatePoints)) } + def forty_two; end + + sig { returns(::KafkaBatchUpdatePoints) } + def forty_two!; end + + sig { returns(T.nilable(::KafkaBatchUpdatePoints)) } + def fourth; end + + sig { returns(::KafkaBatchUpdatePoints) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::KafkaBatchUpdatePoints)) } + sig { params(limit: Integer).returns(T::Array[::KafkaBatchUpdatePoints]) } + def last(limit = nil); end + + sig { returns(::KafkaBatchUpdatePoints) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::KafkaBatchUpdatePoints).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: ::KafkaBatchUpdatePoints).void) + ).returns(::KafkaBatchUpdatePoints) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(T::Array[::KafkaBatchUpdatePoints]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::KafkaBatchUpdatePoints).void) + ).returns(::KafkaBatchUpdatePoints) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::KafkaBatchUpdatePoints).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::KafkaBatchUpdatePoints).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(::KafkaBatchUpdatePoints)) } + def second; end + + sig { returns(::KafkaBatchUpdatePoints) } + def second!; end + + sig { returns(T.nilable(::KafkaBatchUpdatePoints)) } + def second_to_last; end + + sig { returns(::KafkaBatchUpdatePoints) } + def second_to_last!; end + + sig { returns(::KafkaBatchUpdatePoints) } + 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: ::KafkaBatchUpdatePoints).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::KafkaBatchUpdatePoints)) } + sig { params(limit: Integer).returns(T::Array[::KafkaBatchUpdatePoints]) } + def take(limit = nil); end + + sig { returns(::KafkaBatchUpdatePoints) } + def take!; end + + sig { returns(T.nilable(::KafkaBatchUpdatePoints)) } + def third; end + + sig { returns(::KafkaBatchUpdatePoints) } + def third!; end + + sig { returns(T.nilable(::KafkaBatchUpdatePoints)) } + def third_to_last; end + + sig { returns(::KafkaBatchUpdatePoints) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def build_course(*args, &blk); end + + sig { returns(T.nilable(::Course)) } + def course; end + + sig { params(value: T.nilable(::Course)).void } + def course=(value); end + + sig { returns(T::Boolean) } + def course_changed?; end + + sig { returns(T::Boolean) } + def course_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course!(*args, &blk); end + + sig { returns(T.nilable(::Course)) } + def reload_course; end + + sig { void } + def reset_course; 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 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: ::KafkaBatchUpdatePoints).returns(BasicObject) + ).returns(T::Array[::KafkaBatchUpdatePoints]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.nilable(::Integer)) } + def course_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def course_id=(value); end + + sig { returns(T::Boolean) } + def course_id?; end + + sig { returns(T.nilable(::Integer)) } + def course_id_before_last_save; end + + sig { returns(T.untyped) } + def course_id_before_type_cast; end + + sig { returns(T::Boolean) } + def course_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def course_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def course_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def course_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def course_id_was; end + + sig { void } + def course_id_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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(::Integer)) } + def exercise_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def exercise_id=(value); end + + sig { returns(T::Boolean) } + def exercise_id?; end + + sig { returns(T.nilable(::Integer)) } + def exercise_id_before_last_save; end + + sig { returns(T.untyped) } + def exercise_id_before_type_cast; end + + sig { returns(T::Boolean) } + def exercise_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def exercise_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def exercise_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def exercise_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def exercise_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def exercise_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def exercise_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def exercise_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def exercise_id_was; end + + sig { void } + def exercise_id_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(T::Boolean)) } + def realtime; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def realtime=(value); end + + sig { returns(T::Boolean) } + def realtime?; end + + sig { returns(T.nilable(T::Boolean)) } + def realtime_before_last_save; end + + sig { returns(T.untyped) } + def realtime_before_type_cast; end + + sig { returns(T::Boolean) } + def realtime_came_from_user?; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def realtime_change; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def realtime_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def realtime_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def realtime_in_database; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def realtime_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def realtime_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def realtime_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def realtime_was; end + + sig { void } + def realtime_will_change!; end + + sig { void } + def restore_course_id!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_exercise_id!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_realtime!; end + + sig { void } + def restore_task_type!; end + + sig { void } + def restore_updated_at!; end + + sig { void } + def restore_user_id!; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_course_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_course_id?(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_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(::Integer), T.nilable(::Integer)])) } + def saved_change_to_exercise_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_exercise_id?(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(T::Boolean), T.nilable(T::Boolean)])) } + def saved_change_to_realtime; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_realtime?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_task_type; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_task_type?(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_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(::String) } + def task_type; end + + sig { params(value: ::String).returns(::String) } + def task_type=(value); end + + sig { returns(T::Boolean) } + def task_type?; end + + sig { returns(T.nilable(::String)) } + def task_type_before_last_save; end + + sig { returns(T.untyped) } + def task_type_before_type_cast; end + + sig { returns(T::Boolean) } + def task_type_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def task_type_change; end + + sig { returns(T.nilable([::String, ::String])) } + def task_type_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def task_type_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def task_type_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def task_type_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def task_type_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def task_type_previously_was; end + + sig { returns(T.nilable(::String)) } + def task_type_was; end + + sig { void } + def task_type_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_course_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_exercise_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?(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_realtime?(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_type?(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 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: ::KafkaBatchUpdatePoints).returns(BasicObject) + ).returns(T::Array[::KafkaBatchUpdatePoints]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::KafkaBatchUpdatePoints } } + + sig { returns(T::Array[::KafkaBatchUpdatePoints]) } + def to_a; end + + sig { returns(T::Array[::KafkaBatchUpdatePoints]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::KafkaBatchUpdatePoints } } + + 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: ::KafkaBatchUpdatePoints } } + + 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: ::KafkaBatchUpdatePoints } } + + sig do + params( + records: T.any(::KafkaBatchUpdatePoints, T::Enumerable[T.any(::KafkaBatchUpdatePoints, T::Enumerable[::KafkaBatchUpdatePoints])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::KafkaBatchUpdatePoints, T::Enumerable[T.any(::KafkaBatchUpdatePoints, T::Enumerable[::KafkaBatchUpdatePoints])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::KafkaBatchUpdatePoints, T::Enumerable[T.any(::KafkaBatchUpdatePoints, T::Enumerable[::KafkaBatchUpdatePoints])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::KafkaBatchUpdatePoints, Integer, String, T::Enumerable[T.any(::KafkaBatchUpdatePoints, Integer, String, T::Enumerable[::KafkaBatchUpdatePoints])]) + ).returns(T::Array[::KafkaBatchUpdatePoints]) + end + def delete(*records); end + + sig do + params( + records: T.any(::KafkaBatchUpdatePoints, Integer, String, T::Enumerable[T.any(::KafkaBatchUpdatePoints, Integer, String, T::Enumerable[::KafkaBatchUpdatePoints])]) + ).returns(T::Array[::KafkaBatchUpdatePoints]) + end + def destroy(*records); end + + sig { returns(T::Array[::KafkaBatchUpdatePoints]) } + def load_target; end + + sig do + params( + records: T.any(::KafkaBatchUpdatePoints, T::Enumerable[T.any(::KafkaBatchUpdatePoints, T::Enumerable[::KafkaBatchUpdatePoints])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::KafkaBatchUpdatePoints, T::Enumerable[T.any(::KafkaBatchUpdatePoints, T::Enumerable[::KafkaBatchUpdatePoints])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::KafkaBatchUpdatePoints, T::Enumerable[T.any(::KafkaBatchUpdatePoints, T::Enumerable[::KafkaBatchUpdatePoints])]) + ).returns(T::Array[::KafkaBatchUpdatePoints]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::KafkaBatchUpdatePoints]) } + def target; end + + sig { returns(T::Array[::KafkaBatchUpdatePoints]) } + def to_a; end + + sig { returns(T::Array[::KafkaBatchUpdatePoints]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::KafkaBatchUpdatePoints } } + + sig { returns(T::Array[::KafkaBatchUpdatePoints]) } + def to_a; end + + sig { returns(T::Array[::KafkaBatchUpdatePoints]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::KafkaBatchUpdatePoints } } + + 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: ::KafkaBatchUpdatePoints } } + + 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/migrated_submissions.rbi b/sorbet/rbi/dsl/migrated_submissions.rbi new file mode 100644 index 000000000..a0d744a84 --- /dev/null +++ b/sorbet/rbi/dsl/migrated_submissions.rbi @@ -0,0 +1,1316 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `MigratedSubmissions`. +# Please instead update this file by running `bin/tapioca dsl MigratedSubmissions`. + + +class MigratedSubmissions + 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: ::MigratedSubmissions).void) + ).returns(::MigratedSubmissions) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::MigratedSubmissions).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: ::MigratedSubmissions).void)).returns(::MigratedSubmissions) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void) + ).returns(T::Array[::MigratedSubmissions]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void) + ).returns(::MigratedSubmissions) + 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: ::MigratedSubmissions).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void)).returns(::MigratedSubmissions) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void) + ).returns(T::Array[::MigratedSubmissions]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void) + ).returns(::MigratedSubmissions) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void)).returns(::MigratedSubmissions) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void) + ).returns(T::Array[::MigratedSubmissions]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void) + ).returns(::MigratedSubmissions) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void) + ).returns(T::Array[::MigratedSubmissions]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void) + ).returns(::MigratedSubmissions) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void) + ).returns(T::Array[::MigratedSubmissions]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void) + ).returns(::MigratedSubmissions) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::MigratedSubmissions]) } + def destroy_all; end + + sig { returns(T::Array[::MigratedSubmissions]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::MigratedSubmissions]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::MigratedSubmissions)) } + def fifth; end + + sig { returns(::MigratedSubmissions) } + 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(::MigratedSubmissions) + 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[::MigratedSubmissions]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::MigratedSubmissions).void + ).returns(T.nilable(::MigratedSubmissions)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::MigratedSubmissions)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::MigratedSubmissions) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::MigratedSubmissions).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::MigratedSubmissions]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::MigratedSubmissions]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::MigratedSubmissions]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void) + ).returns(T::Array[::MigratedSubmissions]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void) + ).returns(::MigratedSubmissions) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void) + ).returns(T::Array[::MigratedSubmissions]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void) + ).returns(::MigratedSubmissions) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void) + ).returns(T::Array[::MigratedSubmissions]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void) + ).returns(::MigratedSubmissions) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::MigratedSubmissions)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::MigratedSubmissions) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::MigratedSubmissions) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::MigratedSubmissions)) } + sig { params(limit: Integer).returns(T::Array[::MigratedSubmissions]) } + def first(limit = nil); end + + sig { returns(::MigratedSubmissions) } + def first!; end + + sig { returns(T.nilable(::MigratedSubmissions)) } + def forty_two; end + + sig { returns(::MigratedSubmissions) } + def forty_two!; end + + sig { returns(T.nilable(::MigratedSubmissions)) } + def fourth; end + + sig { returns(::MigratedSubmissions) } + def fourth!; end + + sig { returns(T::Array[T.untyped]) } + def ids; end + + sig do + params( + of: Integer, + start: T.untyped, + finish: T.untyped, + load: T.untyped, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::MigratedSubmissions)) } + sig { params(limit: Integer).returns(T::Array[::MigratedSubmissions]) } + def last(limit = nil); end + + sig { returns(::MigratedSubmissions) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::MigratedSubmissions).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: ::MigratedSubmissions).void)).returns(::MigratedSubmissions) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void) + ).returns(T::Array[::MigratedSubmissions]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::MigratedSubmissions).void) + ).returns(::MigratedSubmissions) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::MigratedSubmissions).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::MigratedSubmissions).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(::MigratedSubmissions)) } + def second; end + + sig { returns(::MigratedSubmissions) } + def second!; end + + sig { returns(T.nilable(::MigratedSubmissions)) } + def second_to_last; end + + sig { returns(::MigratedSubmissions) } + def second_to_last!; end + + sig { returns(::MigratedSubmissions) } + 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: ::MigratedSubmissions).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::MigratedSubmissions)) } + sig { params(limit: Integer).returns(T::Array[::MigratedSubmissions]) } + def take(limit = nil); end + + sig { returns(::MigratedSubmissions) } + def take!; end + + sig { returns(T.nilable(::MigratedSubmissions)) } + def third; end + + sig { returns(::MigratedSubmissions) } + def third!; end + + sig { returns(T.nilable(::MigratedSubmissions)) } + def third_to_last; end + + sig { returns(::MigratedSubmissions) } + def third_to_last!; 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 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: ::MigratedSubmissions).returns(BasicObject) + ).returns(T::Array[::MigratedSubmissions]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 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(::Integer)) } + def from_course_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def from_course_id=(value); end + + sig { returns(T::Boolean) } + def from_course_id?; end + + sig { returns(T.nilable(::Integer)) } + def from_course_id_before_last_save; end + + sig { returns(T.untyped) } + def from_course_id_before_type_cast; end + + sig { returns(T::Boolean) } + def from_course_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def from_course_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def from_course_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def from_course_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def from_course_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def from_course_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def from_course_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def from_course_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def from_course_id_was; end + + sig { void } + def from_course_id_will_change!; end + + sig { returns(T.untyped) } + def id; end + + sig { params(value: T.untyped).returns(T.untyped) } + def id=(value); end + + sig { returns(T::Boolean) } + def id?; end + + sig { returns(T.untyped) } + 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([T.untyped, T.untyped])) } + def id_change; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + 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.untyped) } + def id_in_database; end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + 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.untyped) } + def id_previously_was; end + + sig { returns(T.untyped) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def new_submission_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def new_submission_id=(value); end + + sig { returns(T::Boolean) } + def new_submission_id?; end + + sig { returns(T.nilable(::Integer)) } + def new_submission_id_before_last_save; end + + sig { returns(T.untyped) } + def new_submission_id_before_type_cast; end + + sig { returns(T::Boolean) } + def new_submission_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def new_submission_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def new_submission_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def new_submission_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def new_submission_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def new_submission_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def new_submission_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def new_submission_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def new_submission_id_was; end + + sig { void } + def new_submission_id_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def original_submission_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def original_submission_id=(value); end + + sig { returns(T::Boolean) } + def original_submission_id?; end + + sig { returns(T.nilable(::Integer)) } + def original_submission_id_before_last_save; end + + sig { returns(T.untyped) } + def original_submission_id_before_type_cast; end + + sig { returns(T::Boolean) } + def original_submission_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def original_submission_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def original_submission_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def original_submission_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def original_submission_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def original_submission_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def original_submission_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def original_submission_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def original_submission_id_was; end + + sig { void } + def original_submission_id_will_change!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_from_course_id!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_new_submission_id!; end + + sig { void } + def restore_original_submission_id!; end + + sig { void } + def restore_to_course_id!; 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(::Integer), T.nilable(::Integer)])) } + def saved_change_to_from_course_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_from_course_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.untyped, T.untyped])) } + 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([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_new_submission_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_new_submission_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_original_submission_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_original_submission_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_to_course_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_to_course_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(::Integer)) } + def to_course_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def to_course_id=(value); end + + sig { returns(T::Boolean) } + def to_course_id?; end + + sig { returns(T.nilable(::Integer)) } + def to_course_id_before_last_save; end + + sig { returns(T.untyped) } + def to_course_id_before_type_cast; end + + sig { returns(T::Boolean) } + def to_course_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def to_course_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def to_course_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def to_course_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def to_course_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def to_course_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def to_course_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def to_course_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def to_course_id_was; end + + sig { void } + def to_course_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 { 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_from_course_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?(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_new_submission_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_original_submission_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_to_course_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 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: ::MigratedSubmissions).returns(BasicObject) + ).returns(T::Array[::MigratedSubmissions]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::MigratedSubmissions } } + + sig { returns(T::Array[::MigratedSubmissions]) } + def to_a; end + + sig { returns(T::Array[::MigratedSubmissions]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::MigratedSubmissions } } + + 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: ::MigratedSubmissions } } + + 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: ::MigratedSubmissions } } + + sig do + params( + records: T.any(::MigratedSubmissions, T::Enumerable[T.any(::MigratedSubmissions, T::Enumerable[::MigratedSubmissions])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::MigratedSubmissions, T::Enumerable[T.any(::MigratedSubmissions, T::Enumerable[::MigratedSubmissions])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::MigratedSubmissions, T::Enumerable[T.any(::MigratedSubmissions, T::Enumerable[::MigratedSubmissions])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::MigratedSubmissions, Integer, String, T::Enumerable[T.any(::MigratedSubmissions, Integer, String, T::Enumerable[::MigratedSubmissions])]) + ).returns(T::Array[::MigratedSubmissions]) + end + def delete(*records); end + + sig do + params( + records: T.any(::MigratedSubmissions, Integer, String, T::Enumerable[T.any(::MigratedSubmissions, Integer, String, T::Enumerable[::MigratedSubmissions])]) + ).returns(T::Array[::MigratedSubmissions]) + end + def destroy(*records); end + + sig { returns(T::Array[::MigratedSubmissions]) } + def load_target; end + + sig do + params( + records: T.any(::MigratedSubmissions, T::Enumerable[T.any(::MigratedSubmissions, T::Enumerable[::MigratedSubmissions])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::MigratedSubmissions, T::Enumerable[T.any(::MigratedSubmissions, T::Enumerable[::MigratedSubmissions])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::MigratedSubmissions, T::Enumerable[T.any(::MigratedSubmissions, T::Enumerable[::MigratedSubmissions])]) + ).returns(T::Array[::MigratedSubmissions]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::MigratedSubmissions]) } + def target; end + + sig { returns(T::Array[::MigratedSubmissions]) } + def to_a; end + + sig { returns(T::Array[::MigratedSubmissions]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::MigratedSubmissions } } + + sig { returns(T::Array[::MigratedSubmissions]) } + def to_a; end + + sig { returns(T::Array[::MigratedSubmissions]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::MigratedSubmissions } } + + 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: ::MigratedSubmissions } } + + 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/model_solution_access_log.rbi b/sorbet/rbi/dsl/model_solution_access_log.rbi new file mode 100644 index 000000000..5e394aeee --- /dev/null +++ b/sorbet/rbi/dsl/model_solution_access_log.rbi @@ -0,0 +1,1389 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ModelSolutionAccessLog`. +# Please instead update this file by running `bin/tapioca dsl ModelSolutionAccessLog`. + + +class ModelSolutionAccessLog + 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: ::ModelSolutionAccessLog).void) + ).returns(::ModelSolutionAccessLog) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::ModelSolutionAccessLog).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: ::ModelSolutionAccessLog).void) + ).returns(::ModelSolutionAccessLog) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(T::Array[::ModelSolutionAccessLog]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(::ModelSolutionAccessLog) + 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: ::ModelSolutionAccessLog).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(::ModelSolutionAccessLog) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(T::Array[::ModelSolutionAccessLog]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(::ModelSolutionAccessLog) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(::ModelSolutionAccessLog) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(T::Array[::ModelSolutionAccessLog]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(::ModelSolutionAccessLog) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(T::Array[::ModelSolutionAccessLog]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(::ModelSolutionAccessLog) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(T::Array[::ModelSolutionAccessLog]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(::ModelSolutionAccessLog) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::ModelSolutionAccessLog]) } + def destroy_all; end + + sig { returns(T::Array[::ModelSolutionAccessLog]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::ModelSolutionAccessLog]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::ModelSolutionAccessLog)) } + def fifth; end + + sig { returns(::ModelSolutionAccessLog) } + 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(::ModelSolutionAccessLog) + 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[::ModelSolutionAccessLog]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::ModelSolutionAccessLog).void + ).returns(T.nilable(::ModelSolutionAccessLog)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::ModelSolutionAccessLog)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::ModelSolutionAccessLog) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::ModelSolutionAccessLog).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::ModelSolutionAccessLog]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::ModelSolutionAccessLog]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::ModelSolutionAccessLog]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(T::Array[::ModelSolutionAccessLog]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(::ModelSolutionAccessLog) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(T::Array[::ModelSolutionAccessLog]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(::ModelSolutionAccessLog) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(T::Array[::ModelSolutionAccessLog]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(::ModelSolutionAccessLog) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::ModelSolutionAccessLog)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::ModelSolutionAccessLog) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::ModelSolutionAccessLog) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::ModelSolutionAccessLog)) } + sig { params(limit: Integer).returns(T::Array[::ModelSolutionAccessLog]) } + def first(limit = nil); end + + sig { returns(::ModelSolutionAccessLog) } + def first!; end + + sig { returns(T.nilable(::ModelSolutionAccessLog)) } + def forty_two; end + + sig { returns(::ModelSolutionAccessLog) } + def forty_two!; end + + sig { returns(T.nilable(::ModelSolutionAccessLog)) } + def fourth; end + + sig { returns(::ModelSolutionAccessLog) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::ModelSolutionAccessLog)) } + sig { params(limit: Integer).returns(T::Array[::ModelSolutionAccessLog]) } + def last(limit = nil); end + + sig { returns(::ModelSolutionAccessLog) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ModelSolutionAccessLog).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: ::ModelSolutionAccessLog).void) + ).returns(::ModelSolutionAccessLog) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(T::Array[::ModelSolutionAccessLog]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ModelSolutionAccessLog).void) + ).returns(::ModelSolutionAccessLog) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ModelSolutionAccessLog).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ModelSolutionAccessLog).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(::ModelSolutionAccessLog)) } + def second; end + + sig { returns(::ModelSolutionAccessLog) } + def second!; end + + sig { returns(T.nilable(::ModelSolutionAccessLog)) } + def second_to_last; end + + sig { returns(::ModelSolutionAccessLog) } + def second_to_last!; end + + sig { returns(::ModelSolutionAccessLog) } + 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: ::ModelSolutionAccessLog).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::ModelSolutionAccessLog)) } + sig { params(limit: Integer).returns(T::Array[::ModelSolutionAccessLog]) } + def take(limit = nil); end + + sig { returns(::ModelSolutionAccessLog) } + def take!; end + + sig { returns(T.nilable(::ModelSolutionAccessLog)) } + def third; end + + sig { returns(::ModelSolutionAccessLog) } + def third!; end + + sig { returns(T.nilable(::ModelSolutionAccessLog)) } + def third_to_last; end + + sig { returns(::ModelSolutionAccessLog) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def build_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def build_user(*args, &blk); end + + sig { returns(T.nilable(::Course)) } + def course; end + + sig { params(value: T.nilable(::Course)).void } + def course=(value); end + + sig { returns(T::Boolean) } + def course_changed?; end + + sig { returns(T::Boolean) } + def course_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course!(*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(::Course)) } + def reload_course; end + + sig { returns(T.nilable(::User)) } + def reload_user; end + + sig { void } + def reset_course; 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 { 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 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: ::ModelSolutionAccessLog).returns(BasicObject) + ).returns(T::Array[::ModelSolutionAccessLog]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::Integer) } + def course_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def course_id=(value); end + + sig { returns(T::Boolean) } + def course_id?; end + + sig { returns(T.nilable(::Integer)) } + def course_id_before_last_save; end + + sig { returns(T.untyped) } + def course_id_before_type_cast; end + + sig { returns(T::Boolean) } + def course_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def course_id_was; end + + sig { void } + def course_id_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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(::String) } + def exercise_name; end + + sig { params(value: ::String).returns(::String) } + def exercise_name=(value); end + + sig { returns(T::Boolean) } + def exercise_name?; end + + sig { returns(T.nilable(::String)) } + def exercise_name_before_last_save; end + + sig { returns(T.untyped) } + def exercise_name_before_type_cast; end + + sig { returns(T::Boolean) } + def exercise_name_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def exercise_name_change; end + + sig { returns(T.nilable([::String, ::String])) } + def exercise_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def exercise_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def exercise_name_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def exercise_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def exercise_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def exercise_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def exercise_name_was; end + + sig { void } + def exercise_name_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 { void } + def restore_course_id!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_exercise_name!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_updated_at!; end + + sig { void } + def restore_user_id!; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_course_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_course_id?(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_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([::String, ::String])) } + def saved_change_to_exercise_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_exercise_name?(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(::ActiveSupport::TimeWithZone), T.nilable(::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_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(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 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_course_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_exercise_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_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 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: ::ModelSolutionAccessLog).returns(BasicObject) + ).returns(T::Array[::ModelSolutionAccessLog]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::ModelSolutionAccessLog } } + + sig { returns(T::Array[::ModelSolutionAccessLog]) } + def to_a; end + + sig { returns(T::Array[::ModelSolutionAccessLog]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::ModelSolutionAccessLog } } + + 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: ::ModelSolutionAccessLog } } + + 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: ::ModelSolutionAccessLog } } + + sig do + params( + records: T.any(::ModelSolutionAccessLog, T::Enumerable[T.any(::ModelSolutionAccessLog, T::Enumerable[::ModelSolutionAccessLog])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::ModelSolutionAccessLog, T::Enumerable[T.any(::ModelSolutionAccessLog, T::Enumerable[::ModelSolutionAccessLog])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::ModelSolutionAccessLog, T::Enumerable[T.any(::ModelSolutionAccessLog, T::Enumerable[::ModelSolutionAccessLog])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::ModelSolutionAccessLog, Integer, String, T::Enumerable[T.any(::ModelSolutionAccessLog, Integer, String, T::Enumerable[::ModelSolutionAccessLog])]) + ).returns(T::Array[::ModelSolutionAccessLog]) + end + def delete(*records); end + + sig do + params( + records: T.any(::ModelSolutionAccessLog, Integer, String, T::Enumerable[T.any(::ModelSolutionAccessLog, Integer, String, T::Enumerable[::ModelSolutionAccessLog])]) + ).returns(T::Array[::ModelSolutionAccessLog]) + end + def destroy(*records); end + + sig { returns(T::Array[::ModelSolutionAccessLog]) } + def load_target; end + + sig do + params( + records: T.any(::ModelSolutionAccessLog, T::Enumerable[T.any(::ModelSolutionAccessLog, T::Enumerable[::ModelSolutionAccessLog])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::ModelSolutionAccessLog, T::Enumerable[T.any(::ModelSolutionAccessLog, T::Enumerable[::ModelSolutionAccessLog])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::ModelSolutionAccessLog, T::Enumerable[T.any(::ModelSolutionAccessLog, T::Enumerable[::ModelSolutionAccessLog])]) + ).returns(T::Array[::ModelSolutionAccessLog]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::ModelSolutionAccessLog]) } + def target; end + + sig { returns(T::Array[::ModelSolutionAccessLog]) } + def to_a; end + + sig { returns(T::Array[::ModelSolutionAccessLog]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::ModelSolutionAccessLog } } + + sig { returns(T::Array[::ModelSolutionAccessLog]) } + def to_a; end + + sig { returns(T::Array[::ModelSolutionAccessLog]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::ModelSolutionAccessLog } } + + 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: ::ModelSolutionAccessLog } } + + 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/model_solution_token_used.rbi b/sorbet/rbi/dsl/model_solution_token_used.rbi new file mode 100644 index 000000000..0a18c6cde --- /dev/null +++ b/sorbet/rbi/dsl/model_solution_token_used.rbi @@ -0,0 +1,1446 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ModelSolutionTokenUsed`. +# Please instead update this file by running `bin/tapioca dsl ModelSolutionTokenUsed`. + + +class ModelSolutionTokenUsed + 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: ::ModelSolutionTokenUsed).void) + ).returns(::ModelSolutionTokenUsed) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::ModelSolutionTokenUsed).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: ::ModelSolutionTokenUsed).void) + ).returns(::ModelSolutionTokenUsed) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(T::Array[::ModelSolutionTokenUsed]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(::ModelSolutionTokenUsed) + 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: ::ModelSolutionTokenUsed).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(::ModelSolutionTokenUsed) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(T::Array[::ModelSolutionTokenUsed]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(::ModelSolutionTokenUsed) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(::ModelSolutionTokenUsed) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(T::Array[::ModelSolutionTokenUsed]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(::ModelSolutionTokenUsed) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(T::Array[::ModelSolutionTokenUsed]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(::ModelSolutionTokenUsed) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(T::Array[::ModelSolutionTokenUsed]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(::ModelSolutionTokenUsed) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::ModelSolutionTokenUsed]) } + def destroy_all; end + + sig { returns(T::Array[::ModelSolutionTokenUsed]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::ModelSolutionTokenUsed]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::ModelSolutionTokenUsed)) } + def fifth; end + + sig { returns(::ModelSolutionTokenUsed) } + 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(::ModelSolutionTokenUsed) + 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[::ModelSolutionTokenUsed]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::ModelSolutionTokenUsed).void + ).returns(T.nilable(::ModelSolutionTokenUsed)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::ModelSolutionTokenUsed)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::ModelSolutionTokenUsed) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::ModelSolutionTokenUsed).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::ModelSolutionTokenUsed]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::ModelSolutionTokenUsed]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::ModelSolutionTokenUsed]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(T::Array[::ModelSolutionTokenUsed]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(::ModelSolutionTokenUsed) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(T::Array[::ModelSolutionTokenUsed]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(::ModelSolutionTokenUsed) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(T::Array[::ModelSolutionTokenUsed]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(::ModelSolutionTokenUsed) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::ModelSolutionTokenUsed)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::ModelSolutionTokenUsed) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::ModelSolutionTokenUsed) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::ModelSolutionTokenUsed)) } + sig { params(limit: Integer).returns(T::Array[::ModelSolutionTokenUsed]) } + def first(limit = nil); end + + sig { returns(::ModelSolutionTokenUsed) } + def first!; end + + sig { returns(T.nilable(::ModelSolutionTokenUsed)) } + def forty_two; end + + sig { returns(::ModelSolutionTokenUsed) } + def forty_two!; end + + sig { returns(T.nilable(::ModelSolutionTokenUsed)) } + def fourth; end + + sig { returns(::ModelSolutionTokenUsed) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::ModelSolutionTokenUsed)) } + sig { params(limit: Integer).returns(T::Array[::ModelSolutionTokenUsed]) } + def last(limit = nil); end + + sig { returns(::ModelSolutionTokenUsed) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ModelSolutionTokenUsed).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: ::ModelSolutionTokenUsed).void) + ).returns(::ModelSolutionTokenUsed) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(T::Array[::ModelSolutionTokenUsed]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ModelSolutionTokenUsed).void) + ).returns(::ModelSolutionTokenUsed) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ModelSolutionTokenUsed).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ModelSolutionTokenUsed).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(::ModelSolutionTokenUsed)) } + def second; end + + sig { returns(::ModelSolutionTokenUsed) } + def second!; end + + sig { returns(T.nilable(::ModelSolutionTokenUsed)) } + def second_to_last; end + + sig { returns(::ModelSolutionTokenUsed) } + def second_to_last!; end + + sig { returns(::ModelSolutionTokenUsed) } + 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: ::ModelSolutionTokenUsed).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::ModelSolutionTokenUsed)) } + sig { params(limit: Integer).returns(T::Array[::ModelSolutionTokenUsed]) } + def take(limit = nil); end + + sig { returns(::ModelSolutionTokenUsed) } + def take!; end + + sig { returns(T.nilable(::ModelSolutionTokenUsed)) } + def third; end + + sig { returns(::ModelSolutionTokenUsed) } + def third!; end + + sig { returns(T.nilable(::ModelSolutionTokenUsed)) } + def third_to_last; end + + sig { returns(::ModelSolutionTokenUsed) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def build_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def build_user(*args, &blk); end + + sig { returns(T.nilable(::Course)) } + def course; end + + sig { params(value: T.nilable(::Course)).void } + def course=(value); end + + sig { returns(T::Boolean) } + def course_changed?; end + + sig { returns(T::Boolean) } + def course_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course!(*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(::Course)) } + def reload_course; end + + sig { returns(T.nilable(::User)) } + def reload_user; end + + sig { void } + def reset_course; 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 { 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 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: ::ModelSolutionTokenUsed).returns(BasicObject) + ).returns(T::Array[::ModelSolutionTokenUsed]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::Integer) } + def cost; end + + sig { params(value: ::Integer).returns(::Integer) } + def cost=(value); end + + sig { returns(T::Boolean) } + def cost?; end + + sig { returns(T.nilable(::Integer)) } + def cost_before_last_save; end + + sig { returns(T.untyped) } + def cost_before_type_cast; end + + sig { returns(T::Boolean) } + def cost_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def cost_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def cost_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def cost_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def cost_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def cost_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def cost_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def cost_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def cost_was; end + + sig { void } + def cost_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def course_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def course_id=(value); end + + sig { returns(T::Boolean) } + def course_id?; end + + sig { returns(T.nilable(::Integer)) } + def course_id_before_last_save; end + + sig { returns(T.untyped) } + def course_id_before_type_cast; end + + sig { returns(T::Boolean) } + def course_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def course_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def course_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def course_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def course_id_was; end + + sig { void } + def course_id_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 exercise_name; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def exercise_name=(value); end + + sig { returns(T::Boolean) } + def exercise_name?; end + + sig { returns(T.nilable(::String)) } + def exercise_name_before_last_save; end + + sig { returns(T.untyped) } + def exercise_name_before_type_cast; end + + sig { returns(T::Boolean) } + def exercise_name_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def exercise_name_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def exercise_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def exercise_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def exercise_name_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def exercise_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def exercise_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def exercise_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def exercise_name_was; end + + sig { void } + def exercise_name_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 { void } + def restore_cost!; end + + sig { void } + def restore_course_id!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_exercise_name!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_updated_at!; end + + sig { void } + def restore_user_id!; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_cost; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_cost?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_course_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_course_id?(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_exercise_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_exercise_name?(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([::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(::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_cost?(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_course_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_exercise_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_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 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: ::ModelSolutionTokenUsed).returns(BasicObject) + ).returns(T::Array[::ModelSolutionTokenUsed]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::ModelSolutionTokenUsed } } + + sig { returns(T::Array[::ModelSolutionTokenUsed]) } + def to_a; end + + sig { returns(T::Array[::ModelSolutionTokenUsed]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::ModelSolutionTokenUsed } } + + 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: ::ModelSolutionTokenUsed } } + + 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: ::ModelSolutionTokenUsed } } + + sig do + params( + records: T.any(::ModelSolutionTokenUsed, T::Enumerable[T.any(::ModelSolutionTokenUsed, T::Enumerable[::ModelSolutionTokenUsed])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::ModelSolutionTokenUsed, T::Enumerable[T.any(::ModelSolutionTokenUsed, T::Enumerable[::ModelSolutionTokenUsed])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::ModelSolutionTokenUsed, T::Enumerable[T.any(::ModelSolutionTokenUsed, T::Enumerable[::ModelSolutionTokenUsed])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::ModelSolutionTokenUsed, Integer, String, T::Enumerable[T.any(::ModelSolutionTokenUsed, Integer, String, T::Enumerable[::ModelSolutionTokenUsed])]) + ).returns(T::Array[::ModelSolutionTokenUsed]) + end + def delete(*records); end + + sig do + params( + records: T.any(::ModelSolutionTokenUsed, Integer, String, T::Enumerable[T.any(::ModelSolutionTokenUsed, Integer, String, T::Enumerable[::ModelSolutionTokenUsed])]) + ).returns(T::Array[::ModelSolutionTokenUsed]) + end + def destroy(*records); end + + sig { returns(T::Array[::ModelSolutionTokenUsed]) } + def load_target; end + + sig do + params( + records: T.any(::ModelSolutionTokenUsed, T::Enumerable[T.any(::ModelSolutionTokenUsed, T::Enumerable[::ModelSolutionTokenUsed])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::ModelSolutionTokenUsed, T::Enumerable[T.any(::ModelSolutionTokenUsed, T::Enumerable[::ModelSolutionTokenUsed])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::ModelSolutionTokenUsed, T::Enumerable[T.any(::ModelSolutionTokenUsed, T::Enumerable[::ModelSolutionTokenUsed])]) + ).returns(T::Array[::ModelSolutionTokenUsed]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::ModelSolutionTokenUsed]) } + def target; end + + sig { returns(T::Array[::ModelSolutionTokenUsed]) } + def to_a; end + + sig { returns(T::Array[::ModelSolutionTokenUsed]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::ModelSolutionTokenUsed } } + + sig { returns(T::Array[::ModelSolutionTokenUsed]) } + def to_a; end + + sig { returns(T::Array[::ModelSolutionTokenUsed]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::ModelSolutionTokenUsed } } + + 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: ::ModelSolutionTokenUsed } } + + 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/new_organization_request_mailer.rbi b/sorbet/rbi/dsl/new_organization_request_mailer.rbi new file mode 100644 index 000000000..8655e0ff2 --- /dev/null +++ b/sorbet/rbi/dsl/new_organization_request_mailer.rbi @@ -0,0 +1,16 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `NewOrganizationRequestMailer`. +# Please instead update this file by running `bin/tapioca dsl NewOrganizationRequestMailer`. + + +class NewOrganizationRequestMailer + include GeneratedUrlHelpersModule + include GeneratedMountedHelpers + + class << self + sig { params(organization: ::Organization).returns(::ActionMailer::MessageDelivery) } + def request_email(organization); end + end +end diff --git a/sorbet/rbi/dsl/organization.rbi b/sorbet/rbi/dsl/organization.rbi new file mode 100644 index 000000000..266851a2e --- /dev/null +++ b/sorbet/rbi/dsl/organization.rbi @@ -0,0 +1,2451 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Organization`. +# Please instead update this file by running `bin/tapioca dsl Organization`. + + +class Organization + include GeneratedAssociationMethods + include GeneratedAttributeMethods + extend CommonRelationMethods + extend GeneratedRelationMethods + + sig { returns(ActiveStorage::Attached::One) } + def logo; end + + sig { params(attachable: T.untyped).returns(T.untyped) } + def logo=(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: ::Organization).void) + ).returns(::Organization) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::Organization).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: ::Organization).void)).returns(::Organization) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Organization).void) + ).returns(T::Array[::Organization]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Organization).void) + ).returns(::Organization) + 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: ::Organization).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Organization).void)).returns(::Organization) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Organization).void) + ).returns(T::Array[::Organization]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Organization).void) + ).returns(::Organization) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Organization).void)).returns(::Organization) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Organization).void) + ).returns(T::Array[::Organization]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Organization).void) + ).returns(::Organization) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Organization).void) + ).returns(T::Array[::Organization]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Organization).void) + ).returns(::Organization) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Organization).void) + ).returns(T::Array[::Organization]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Organization).void) + ).returns(::Organization) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::Organization]) } + def destroy_all; end + + sig { returns(T::Array[::Organization]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Organization]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Organization)) } + def fifth; end + + sig { returns(::Organization) } + 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(::Organization) + 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[::Organization]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::Organization).void + ).returns(T.nilable(::Organization)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Organization)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Organization) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::Organization).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::Organization]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::Organization]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::Organization]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Organization).void) + ).returns(T::Array[::Organization]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Organization).void) + ).returns(::Organization) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Organization).void) + ).returns(T::Array[::Organization]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Organization).void) + ).returns(::Organization) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Organization).void) + ).returns(T::Array[::Organization]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Organization).void) + ).returns(::Organization) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Organization)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Organization) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Organization) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Organization)) } + sig { params(limit: Integer).returns(T::Array[::Organization]) } + def first(limit = nil); end + + sig { returns(::Organization) } + def first!; end + + sig { returns(T.nilable(::Organization)) } + def forty_two; end + + sig { returns(::Organization) } + def forty_two!; end + + sig { returns(T.nilable(::Organization)) } + def fourth; end + + sig { returns(::Organization) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::Organization)) } + sig { params(limit: Integer).returns(T::Array[::Organization]) } + def last(limit = nil); end + + sig { returns(::Organization) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::Organization).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: ::Organization).void)).returns(::Organization) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Organization).void) + ).returns(T::Array[::Organization]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Organization).void) + ).returns(::Organization) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Organization).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Organization).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(::Organization)) } + def second; end + + sig { returns(::Organization) } + def second!; end + + sig { returns(T.nilable(::Organization)) } + def second_to_last; end + + sig { returns(::Organization) } + def second_to_last!; end + + sig { returns(::Organization) } + 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: ::Organization).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Organization)) } + sig { params(limit: Integer).returns(T::Array[::Organization]) } + def take(limit = nil); end + + sig { returns(::Organization) } + def take!; end + + sig { returns(T.nilable(::Organization)) } + def third; end + + sig { returns(::Organization) } + def third!; end + + sig { returns(T.nilable(::Organization)) } + def third_to_last; end + + sig { returns(::Organization) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def build_creator(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Attachment) } + def build_logo_attachment(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Blob) } + def build_logo_blob(*args, &blk); end + + sig { returns(T::Array[T.untyped]) } + def course_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def course_ids=(ids); end + + # This method is created by ActiveRecord on the `Organization` class because it declared `has_many :courses`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Course::PrivateCollectionProxy) } + def courses; end + + sig { params(value: T::Enumerable[::Course]).void } + def courses=(value); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def create_creator(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def create_creator!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Attachment) } + def create_logo_attachment(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Attachment) } + def create_logo_attachment!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Blob) } + def create_logo_blob(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::ActiveStorage::Blob) } + def create_logo_blob!(*args, &blk); end + + sig { returns(T.nilable(::User)) } + def creator; end + + sig { params(value: T.nilable(::User)).void } + def creator=(value); end + + sig { returns(T::Boolean) } + def creator_changed?; end + + sig { returns(T::Boolean) } + def creator_previously_changed?; end + + sig { returns(T.nilable(::ActiveStorage::Attachment)) } + def logo_attachment; end + + sig { params(value: T.nilable(::ActiveStorage::Attachment)).void } + def logo_attachment=(value); end + + sig { returns(T.nilable(::ActiveStorage::Blob)) } + def logo_blob; end + + sig { params(value: T.nilable(::ActiveStorage::Blob)).void } + def logo_blob=(value); end + + sig { returns(T::Array[T.untyped]) } + def member_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def member_ids=(ids); end + + # This method is created by ActiveRecord on the `Organization` class because it declared `has_many :members, through: :organization_memberships`. + # 🔗 [Rails guide for `has_many_through` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-through-association) + sig { returns(::User::PrivateCollectionProxy) } + def members; end + + sig { params(value: T::Enumerable[::User]).void } + def members=(value); end + + sig { returns(T::Array[T.untyped]) } + def organization_membership_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def organization_membership_ids=(ids); end + + # This method is created by ActiveRecord on the `Organization` class because it declared `has_many :organization_memberships`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::OrganizationMembership::PrivateCollectionProxy) } + def organization_memberships; end + + sig { params(value: T::Enumerable[::OrganizationMembership]).void } + def organization_memberships=(value); end + + sig { returns(T.nilable(::User)) } + def reload_creator; end + + sig { returns(T.nilable(::ActiveStorage::Attachment)) } + def reload_logo_attachment; end + + sig { returns(T.nilable(::ActiveStorage::Blob)) } + def reload_logo_blob; end + + sig { void } + def reset_creator; end + + sig { void } + def reset_logo_attachment; end + + sig { void } + def reset_logo_blob; end + + sig { returns(T::Array[T.untyped]) } + def teacher_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def teacher_ids=(ids); end + + # This method is created by ActiveRecord on the `Organization` class because it declared `has_many :teachers, through: :teacherships`. + # 🔗 [Rails guide for `has_many_through` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-through-association) + sig { returns(::User::PrivateCollectionProxy) } + def teachers; end + + sig { params(value: T::Enumerable[::User]).void } + def teachers=(value); end + + sig { returns(T::Array[T.untyped]) } + def teachership_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def teachership_ids=(ids); end + + # This method is created by ActiveRecord on the `Organization` class because it declared `has_many :teacherships`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Teachership::PrivateCollectionProxy) } + def teacherships; end + + sig { params(value: T::Enumerable[::Teachership]).void } + def teacherships=(value); end + end + + module GeneratedAssociationRelationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def accepted_organizations(*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 assisted_organizations(*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 participated_organizations(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def pending_organizations(*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: ::Organization).returns(BasicObject)).returns(T::Array[::Organization]) } + 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 taught_organizations(*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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def visible_organizations(*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_logo(*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 contact_information; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def contact_information=(value); end + + sig { returns(T::Boolean) } + def contact_information?; end + + sig { returns(T.nilable(::String)) } + def contact_information_before_last_save; end + + sig { returns(T.untyped) } + def contact_information_before_type_cast; end + + sig { returns(T::Boolean) } + def contact_information_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def contact_information_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def contact_information_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def contact_information_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def contact_information_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def contact_information_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def contact_information_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def contact_information_previously_was; end + + sig { returns(T.nilable(::String)) } + def contact_information_was; end + + sig { void } + def contact_information_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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(::Integer)) } + def creator_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def creator_id=(value); end + + sig { returns(T::Boolean) } + def creator_id?; end + + sig { returns(T.nilable(::Integer)) } + def creator_id_before_last_save; end + + sig { returns(T.untyped) } + def creator_id_before_type_cast; end + + sig { returns(T::Boolean) } + def creator_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def creator_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def creator_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def creator_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def creator_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def creator_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def creator_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def creator_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def creator_id_was; end + + sig { void } + def creator_id_will_change!; end + + sig { returns(T::Boolean) } + def disabled; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def disabled=(value); end + + sig { returns(T::Boolean) } + def disabled?; end + + sig { returns(T.nilable(T::Boolean)) } + def disabled_before_last_save; end + + sig { returns(T.untyped) } + def disabled_before_type_cast; end + + sig { returns(T::Boolean) } + def disabled_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def disabled_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def disabled_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def disabled_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def disabled_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def disabled_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def disabled_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def disabled_previously_was; end + + sig { returns(T.nilable(::String)) } + def disabled_reason; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def disabled_reason=(value); end + + sig { returns(T::Boolean) } + def disabled_reason?; end + + sig { returns(T.nilable(::String)) } + def disabled_reason_before_last_save; end + + sig { returns(T.untyped) } + def disabled_reason_before_type_cast; end + + sig { returns(T::Boolean) } + def disabled_reason_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def disabled_reason_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def disabled_reason_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def disabled_reason_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def disabled_reason_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def disabled_reason_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def disabled_reason_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def disabled_reason_previously_was; end + + sig { returns(T.nilable(::String)) } + def disabled_reason_was; end + + sig { void } + def disabled_reason_will_change!; end + + sig { returns(T.nilable(T::Boolean)) } + def disabled_was; end + + sig { void } + def disabled_will_change!; end + + sig { returns(T.nilable(::String)) } + def email; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def email=(value); end + + sig { returns(T::Boolean) } + def email?; end + + sig { returns(T.nilable(::String)) } + def email_before_last_save; end + + sig { returns(T.untyped) } + def email_before_type_cast; end + + sig { returns(T::Boolean) } + def email_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def email_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def email_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def email_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def email_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def email_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def email_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def email_previously_was; end + + sig { returns(T.nilable(::String)) } + def email_was; end + + sig { void } + def email_will_change!; end + + sig { returns(T.nilable(T::Boolean)) } + def hidden; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def hidden=(value); end + + sig { returns(T::Boolean) } + def hidden?; end + + sig { returns(T.nilable(T::Boolean)) } + def hidden_before_last_save; end + + sig { returns(T.untyped) } + def hidden_before_type_cast; end + + sig { returns(T::Boolean) } + def hidden_came_from_user?; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def hidden_change; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def hidden_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hidden_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def hidden_in_database; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def hidden_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def hidden_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def hidden_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def hidden_was; end + + sig { void } + def hidden_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 information; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def information=(value); end + + sig { returns(T::Boolean) } + def information?; end + + sig { returns(T.nilable(::String)) } + def information_before_last_save; end + + sig { returns(T.untyped) } + def information_before_type_cast; end + + sig { returns(T::Boolean) } + def information_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def information_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def information_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def information_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def information_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def information_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def information_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def information_previously_was; end + + sig { returns(T.nilable(::String)) } + def information_was; end + + sig { void } + def information_will_change!; end + + sig { returns(T.nilable(::String)) } + def logo_content_type; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def logo_content_type=(value); end + + sig { returns(T::Boolean) } + def logo_content_type?; end + + sig { returns(T.nilable(::String)) } + def logo_content_type_before_last_save; end + + sig { returns(T.untyped) } + def logo_content_type_before_type_cast; end + + sig { returns(T::Boolean) } + def logo_content_type_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def logo_content_type_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def logo_content_type_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def logo_content_type_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def logo_content_type_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def logo_content_type_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def logo_content_type_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def logo_content_type_previously_was; end + + sig { returns(T.nilable(::String)) } + def logo_content_type_was; end + + sig { void } + def logo_content_type_will_change!; end + + sig { returns(T.nilable(::String)) } + def logo_file_name; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def logo_file_name=(value); end + + sig { returns(T::Boolean) } + def logo_file_name?; end + + sig { returns(T.nilable(::String)) } + def logo_file_name_before_last_save; end + + sig { returns(T.untyped) } + def logo_file_name_before_type_cast; end + + sig { returns(T::Boolean) } + def logo_file_name_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def logo_file_name_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def logo_file_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def logo_file_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def logo_file_name_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def logo_file_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def logo_file_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def logo_file_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def logo_file_name_was; end + + sig { void } + def logo_file_name_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def logo_file_size; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def logo_file_size=(value); end + + sig { returns(T::Boolean) } + def logo_file_size?; end + + sig { returns(T.nilable(::Integer)) } + def logo_file_size_before_last_save; end + + sig { returns(T.untyped) } + def logo_file_size_before_type_cast; end + + sig { returns(T::Boolean) } + def logo_file_size_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def logo_file_size_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def logo_file_size_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def logo_file_size_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def logo_file_size_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def logo_file_size_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def logo_file_size_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def logo_file_size_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def logo_file_size_was; end + + sig { void } + def logo_file_size_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def logo_updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def logo_updated_at=(value); end + + sig { returns(T::Boolean) } + def logo_updated_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def logo_updated_at_before_last_save; end + + sig { returns(T.untyped) } + def logo_updated_at_before_type_cast; end + + sig { returns(T::Boolean) } + def logo_updated_at_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def logo_updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def logo_updated_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def logo_updated_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def logo_updated_at_in_database; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def logo_updated_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def logo_updated_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def logo_updated_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def logo_updated_at_was; end + + sig { void } + def logo_updated_at_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(::String)) } + def phone; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def phone=(value); end + + sig { returns(T::Boolean) } + def phone?; end + + sig { returns(T.nilable(::String)) } + def phone_before_last_save; end + + sig { returns(T.untyped) } + def phone_before_type_cast; end + + sig { returns(T::Boolean) } + def phone_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def phone_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def phone_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def phone_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def phone_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def phone_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def phone_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def phone_previously_was; end + + sig { returns(T.nilable(::String)) } + def phone_was; end + + sig { void } + def phone_will_change!; end + + sig { returns(T::Boolean) } + def pinned; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def pinned=(value); end + + sig { returns(T::Boolean) } + def pinned?; end + + sig { returns(T.nilable(T::Boolean)) } + def pinned_before_last_save; end + + sig { returns(T.untyped) } + def pinned_before_type_cast; end + + sig { returns(T::Boolean) } + def pinned_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def pinned_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def pinned_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def pinned_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def pinned_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def pinned_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def pinned_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def pinned_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def pinned_was; end + + sig { void } + def pinned_will_change!; end + + sig { void } + def restore_contact_information!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_creator_id!; end + + sig { void } + def restore_disabled!; end + + sig { void } + def restore_disabled_reason!; end + + sig { void } + def restore_email!; end + + sig { void } + def restore_hidden!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_information!; end + + sig { void } + def restore_logo_content_type!; end + + sig { void } + def restore_logo_file_name!; end + + sig { void } + def restore_logo_file_size!; end + + sig { void } + def restore_logo_updated_at!; end + + sig { void } + def restore_name!; end + + sig { void } + def restore_phone!; end + + sig { void } + def restore_pinned!; end + + sig { void } + def restore_slug!; end + + sig { void } + def restore_teachers_can_create_custom_courses!; end + + sig { void } + def restore_updated_at!; end + + sig { void } + def restore_verified!; end + + sig { void } + def restore_verified_at!; end + + sig { void } + def restore_website!; end + + sig { void } + def restore_whitelisted_ips!; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_contact_information; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_contact_information?(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_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(::Integer), T.nilable(::Integer)])) } + def saved_change_to_creator_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_creator_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_disabled; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_disabled?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_disabled_reason; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_disabled_reason?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_email; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_email?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def saved_change_to_hidden; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_hidden?(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_information; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_information?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_logo_content_type; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_logo_content_type?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_logo_file_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_logo_file_name?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_logo_file_size; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_logo_file_size?(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_logo_updated_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_logo_updated_at?(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(::String), T.nilable(::String)])) } + def saved_change_to_phone; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_phone?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_pinned; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_pinned?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_slug; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_slug?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_teachers_can_create_custom_courses; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_teachers_can_create_custom_courses?(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_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(T::Boolean), T.nilable(T::Boolean)])) } + def saved_change_to_verified; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_verified?(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_verified_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_verified_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_website; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_website?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(T::Array[::String]), T.nilable(T::Array[::String])])) } + def saved_change_to_whitelisted_ips; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_whitelisted_ips?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def slug; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def slug=(value); end + + sig { returns(T::Boolean) } + def slug?; end + + sig { returns(T.nilable(::String)) } + def slug_before_last_save; end + + sig { returns(T.untyped) } + def slug_before_type_cast; end + + sig { returns(T::Boolean) } + def slug_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def slug_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def slug_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def slug_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def slug_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def slug_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def slug_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def slug_previously_was; end + + sig { returns(T.nilable(::String)) } + def slug_was; end + + sig { void } + def slug_will_change!; end + + sig { returns(T::Boolean) } + def teachers_can_create_custom_courses; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def teachers_can_create_custom_courses=(value); end + + sig { returns(T::Boolean) } + def teachers_can_create_custom_courses?; end + + sig { returns(T.nilable(T::Boolean)) } + def teachers_can_create_custom_courses_before_last_save; end + + sig { returns(T.untyped) } + def teachers_can_create_custom_courses_before_type_cast; end + + sig { returns(T::Boolean) } + def teachers_can_create_custom_courses_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def teachers_can_create_custom_courses_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def teachers_can_create_custom_courses_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def teachers_can_create_custom_courses_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def teachers_can_create_custom_courses_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def teachers_can_create_custom_courses_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def teachers_can_create_custom_courses_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def teachers_can_create_custom_courses_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def teachers_can_create_custom_courses_was; end + + sig { void } + def teachers_can_create_custom_courses_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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(T::Boolean)) } + def verified; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def verified=(value); end + + sig { returns(T::Boolean) } + def verified?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def verified_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def verified_at=(value); end + + sig { returns(T::Boolean) } + def verified_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def verified_at_before_last_save; end + + sig { returns(T.untyped) } + def verified_at_before_type_cast; end + + sig { returns(T::Boolean) } + def verified_at_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def verified_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def verified_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def verified_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def verified_at_in_database; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def verified_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def verified_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def verified_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def verified_at_was; end + + sig { void } + def verified_at_will_change!; end + + sig { returns(T.nilable(T::Boolean)) } + def verified_before_last_save; end + + sig { returns(T.untyped) } + def verified_before_type_cast; end + + sig { returns(T::Boolean) } + def verified_came_from_user?; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def verified_change; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def verified_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def verified_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def verified_in_database; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def verified_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def verified_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def verified_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def verified_was; end + + sig { void } + def verified_will_change!; end + + sig { returns(T.nilable(::String)) } + def website; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def website=(value); end + + sig { returns(T::Boolean) } + def website?; end + + sig { returns(T.nilable(::String)) } + def website_before_last_save; end + + sig { returns(T.untyped) } + def website_before_type_cast; end + + sig { returns(T::Boolean) } + def website_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def website_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def website_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def website_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def website_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def website_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def website_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def website_previously_was; end + + sig { returns(T.nilable(::String)) } + def website_was; end + + sig { void } + def website_will_change!; end + + sig { returns(T.nilable(T::Array[::String])) } + def whitelisted_ips; end + + sig { params(value: T.nilable(T::Array[::String])).returns(T.nilable(T::Array[::String])) } + def whitelisted_ips=(value); end + + sig { returns(T::Boolean) } + def whitelisted_ips?; end + + sig { returns(T.nilable(T::Array[::String])) } + def whitelisted_ips_before_last_save; end + + sig { returns(T.untyped) } + def whitelisted_ips_before_type_cast; end + + sig { returns(T::Boolean) } + def whitelisted_ips_came_from_user?; end + + sig { returns(T.nilable([T.nilable(T::Array[::String]), T.nilable(T::Array[::String])])) } + def whitelisted_ips_change; end + + sig { returns(T.nilable([T.nilable(T::Array[::String]), T.nilable(T::Array[::String])])) } + def whitelisted_ips_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def whitelisted_ips_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Array[::String])) } + def whitelisted_ips_in_database; end + + sig { returns(T.nilable([T.nilable(T::Array[::String]), T.nilable(T::Array[::String])])) } + def whitelisted_ips_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def whitelisted_ips_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Array[::String])) } + def whitelisted_ips_previously_was; end + + sig { returns(T.nilable(T::Array[::String])) } + def whitelisted_ips_was; end + + sig { void } + def whitelisted_ips_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_contact_information?(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_creator_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_disabled?(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_disabled_reason?(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_email?(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_hidden?(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_information?(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_logo_content_type?(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_logo_file_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_logo_file_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_logo_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_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_phone?(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_pinned?(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_slug?(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_teachers_can_create_custom_courses?(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_verified?(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_verified_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_website?(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_whitelisted_ips?(from: T.unsafe(nil), to: T.unsafe(nil)); end + end + + module GeneratedRelationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def accepted_organizations(*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 assisted_organizations(*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 participated_organizations(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def pending_organizations(*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: ::Organization).returns(BasicObject)).returns(T::Array[::Organization]) } + 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 taught_organizations(*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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def visible_organizations(*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_logo(*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: ::Organization } } + + sig { returns(T::Array[::Organization]) } + def to_a; end + + sig { returns(T::Array[::Organization]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Organization } } + + 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: ::Organization } } + + 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: ::Organization } } + + sig do + params( + records: T.any(::Organization, T::Enumerable[T.any(::Organization, T::Enumerable[::Organization])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Organization, T::Enumerable[T.any(::Organization, T::Enumerable[::Organization])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Organization, T::Enumerable[T.any(::Organization, T::Enumerable[::Organization])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::Organization, Integer, String, T::Enumerable[T.any(::Organization, Integer, String, T::Enumerable[::Organization])]) + ).returns(T::Array[::Organization]) + end + def delete(*records); end + + sig do + params( + records: T.any(::Organization, Integer, String, T::Enumerable[T.any(::Organization, Integer, String, T::Enumerable[::Organization])]) + ).returns(T::Array[::Organization]) + end + def destroy(*records); end + + sig { returns(T::Array[::Organization]) } + def load_target; end + + sig do + params( + records: T.any(::Organization, T::Enumerable[T.any(::Organization, T::Enumerable[::Organization])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Organization, T::Enumerable[T.any(::Organization, T::Enumerable[::Organization])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Organization, T::Enumerable[T.any(::Organization, T::Enumerable[::Organization])]) + ).returns(T::Array[::Organization]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Organization]) } + def target; end + + sig { returns(T::Array[::Organization]) } + def to_a; end + + sig { returns(T::Array[::Organization]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Organization } } + + sig { returns(T::Array[::Organization]) } + def to_a; end + + sig { returns(T::Array[::Organization]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Organization } } + + 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: ::Organization } } + + 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/organization_membership.rbi b/sorbet/rbi/dsl/organization_membership.rbi new file mode 100644 index 000000000..50fbb4345 --- /dev/null +++ b/sorbet/rbi/dsl/organization_membership.rbi @@ -0,0 +1,1332 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `OrganizationMembership`. +# Please instead update this file by running `bin/tapioca dsl OrganizationMembership`. + + +class OrganizationMembership + 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: ::OrganizationMembership).void) + ).returns(::OrganizationMembership) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::OrganizationMembership).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: ::OrganizationMembership).void) + ).returns(::OrganizationMembership) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(T::Array[::OrganizationMembership]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(::OrganizationMembership) + 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: ::OrganizationMembership).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(::OrganizationMembership) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(T::Array[::OrganizationMembership]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(::OrganizationMembership) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(::OrganizationMembership) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(T::Array[::OrganizationMembership]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(::OrganizationMembership) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(T::Array[::OrganizationMembership]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(::OrganizationMembership) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(T::Array[::OrganizationMembership]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(::OrganizationMembership) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::OrganizationMembership]) } + def destroy_all; end + + sig { returns(T::Array[::OrganizationMembership]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::OrganizationMembership]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::OrganizationMembership)) } + def fifth; end + + sig { returns(::OrganizationMembership) } + 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(::OrganizationMembership) + 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[::OrganizationMembership]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::OrganizationMembership).void + ).returns(T.nilable(::OrganizationMembership)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::OrganizationMembership)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::OrganizationMembership) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::OrganizationMembership).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::OrganizationMembership]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::OrganizationMembership]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::OrganizationMembership]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(T::Array[::OrganizationMembership]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(::OrganizationMembership) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(T::Array[::OrganizationMembership]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(::OrganizationMembership) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(T::Array[::OrganizationMembership]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(::OrganizationMembership) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::OrganizationMembership)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::OrganizationMembership) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::OrganizationMembership) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::OrganizationMembership)) } + sig { params(limit: Integer).returns(T::Array[::OrganizationMembership]) } + def first(limit = nil); end + + sig { returns(::OrganizationMembership) } + def first!; end + + sig { returns(T.nilable(::OrganizationMembership)) } + def forty_two; end + + sig { returns(::OrganizationMembership) } + def forty_two!; end + + sig { returns(T.nilable(::OrganizationMembership)) } + def fourth; end + + sig { returns(::OrganizationMembership) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::OrganizationMembership)) } + sig { params(limit: Integer).returns(T::Array[::OrganizationMembership]) } + def last(limit = nil); end + + sig { returns(::OrganizationMembership) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::OrganizationMembership).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: ::OrganizationMembership).void) + ).returns(::OrganizationMembership) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(T::Array[::OrganizationMembership]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::OrganizationMembership).void) + ).returns(::OrganizationMembership) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::OrganizationMembership).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::OrganizationMembership).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(::OrganizationMembership)) } + def second; end + + sig { returns(::OrganizationMembership) } + def second!; end + + sig { returns(T.nilable(::OrganizationMembership)) } + def second_to_last; end + + sig { returns(::OrganizationMembership) } + def second_to_last!; end + + sig { returns(::OrganizationMembership) } + 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: ::OrganizationMembership).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::OrganizationMembership)) } + sig { params(limit: Integer).returns(T::Array[::OrganizationMembership]) } + def take(limit = nil); end + + sig { returns(::OrganizationMembership) } + def take!; end + + sig { returns(T.nilable(::OrganizationMembership)) } + def third; end + + sig { returns(::OrganizationMembership) } + def third!; end + + sig { returns(T.nilable(::OrganizationMembership)) } + def third_to_last; end + + sig { returns(::OrganizationMembership) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Organization) } + def build_organization(*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(::Organization) } + def create_organization(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Organization) } + def create_organization!(*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(::Organization)) } + def organization; end + + sig { params(value: T.nilable(::Organization)).void } + def organization=(value); end + + sig { returns(T::Boolean) } + def organization_changed?; end + + sig { returns(T::Boolean) } + def organization_previously_changed?; end + + sig { returns(T.nilable(::Organization)) } + def reload_organization; end + + sig { returns(T.nilable(::User)) } + def reload_user; end + + sig { void } + def reset_organization; 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 { 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 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: ::OrganizationMembership).returns(BasicObject) + ).returns(T::Array[::OrganizationMembership]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 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(::Integer)) } + def organization_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def organization_id=(value); end + + sig { returns(T::Boolean) } + def organization_id?; end + + sig { returns(T.nilable(::Integer)) } + def organization_id_before_last_save; end + + sig { returns(T.untyped) } + def organization_id_before_type_cast; end + + sig { returns(T::Boolean) } + def organization_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def organization_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def organization_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def organization_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def organization_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def organization_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def organization_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def organization_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def organization_id_was; end + + sig { void } + def organization_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_organization_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(::Integer), T.nilable(::Integer)])) } + def saved_change_to_organization_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_organization_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(::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_organization_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 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: ::OrganizationMembership).returns(BasicObject) + ).returns(T::Array[::OrganizationMembership]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::OrganizationMembership } } + + sig { returns(T::Array[::OrganizationMembership]) } + def to_a; end + + sig { returns(T::Array[::OrganizationMembership]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::OrganizationMembership } } + + 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: ::OrganizationMembership } } + + 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: ::OrganizationMembership } } + + sig do + params( + records: T.any(::OrganizationMembership, T::Enumerable[T.any(::OrganizationMembership, T::Enumerable[::OrganizationMembership])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::OrganizationMembership, T::Enumerable[T.any(::OrganizationMembership, T::Enumerable[::OrganizationMembership])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::OrganizationMembership, T::Enumerable[T.any(::OrganizationMembership, T::Enumerable[::OrganizationMembership])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::OrganizationMembership, Integer, String, T::Enumerable[T.any(::OrganizationMembership, Integer, String, T::Enumerable[::OrganizationMembership])]) + ).returns(T::Array[::OrganizationMembership]) + end + def delete(*records); end + + sig do + params( + records: T.any(::OrganizationMembership, Integer, String, T::Enumerable[T.any(::OrganizationMembership, Integer, String, T::Enumerable[::OrganizationMembership])]) + ).returns(T::Array[::OrganizationMembership]) + end + def destroy(*records); end + + sig { returns(T::Array[::OrganizationMembership]) } + def load_target; end + + sig do + params( + records: T.any(::OrganizationMembership, T::Enumerable[T.any(::OrganizationMembership, T::Enumerable[::OrganizationMembership])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::OrganizationMembership, T::Enumerable[T.any(::OrganizationMembership, T::Enumerable[::OrganizationMembership])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::OrganizationMembership, T::Enumerable[T.any(::OrganizationMembership, T::Enumerable[::OrganizationMembership])]) + ).returns(T::Array[::OrganizationMembership]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::OrganizationMembership]) } + def target; end + + sig { returns(T::Array[::OrganizationMembership]) } + def to_a; end + + sig { returns(T::Array[::OrganizationMembership]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::OrganizationMembership } } + + sig { returns(T::Array[::OrganizationMembership]) } + def to_a; end + + sig { returns(T::Array[::OrganizationMembership]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::OrganizationMembership } } + + 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: ::OrganizationMembership } } + + 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/password_reset_key_mailer.rbi b/sorbet/rbi/dsl/password_reset_key_mailer.rbi new file mode 100644 index 000000000..15cf8969a --- /dev/null +++ b/sorbet/rbi/dsl/password_reset_key_mailer.rbi @@ -0,0 +1,22 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `PasswordResetKeyMailer`. +# Please instead update this file by running `bin/tapioca dsl PasswordResetKeyMailer`. + + +class PasswordResetKeyMailer + include GeneratedUrlHelpersModule + include GeneratedMountedHelpers + + class << self + sig do + params( + user: ::User, + key: ::ActionToken, + origin: T.nilable(::String) + ).returns(::ActionMailer::MessageDelivery) + end + def reset_link_email(user, key, origin = T.unsafe(nil)); end + end +end diff --git a/sorbet/rbi/dsl/pg_hero/engine/generated_path_helpers_module.rbi b/sorbet/rbi/dsl/pg_hero/engine/generated_path_helpers_module.rbi new file mode 100644 index 000000000..ba315818f --- /dev/null +++ b/sorbet/rbi/dsl/pg_hero/engine/generated_path_helpers_module.rbi @@ -0,0 +1,83 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `PgHero::Engine::GeneratedPathHelpersModule`. +# Please instead update this file by running `bin/tapioca dsl PgHero::Engine::GeneratedPathHelpersModule`. + + +module PgHero::Engine::GeneratedPathHelpersModule + include ::ActionDispatch::Routing::UrlFor + include ::ActionDispatch::Routing::PolymorphicRoutes + + sig { params(args: T.untyped).returns(String) } + def connection_stats_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def connections_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def cpu_usage_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def enable_query_stats_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def explain_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def free_space_stats_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def index_bloat_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def kill_all_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def kill_long_running_queries_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def kill_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def live_queries_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def load_stats_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def maintenance_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def queries_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def query_stats_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def relation_space_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def replication_lag_stats_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def reset_query_stats_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def root_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def show_query_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def space_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def system_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def system_stats_path(*args); end + + sig { params(args: T.untyped).returns(String) } + def tune_path(*args); end +end diff --git a/sorbet/rbi/dsl/pg_hero/engine/generated_url_helpers_module.rbi b/sorbet/rbi/dsl/pg_hero/engine/generated_url_helpers_module.rbi new file mode 100644 index 000000000..1f8dc7f04 --- /dev/null +++ b/sorbet/rbi/dsl/pg_hero/engine/generated_url_helpers_module.rbi @@ -0,0 +1,83 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `PgHero::Engine::GeneratedUrlHelpersModule`. +# Please instead update this file by running `bin/tapioca dsl PgHero::Engine::GeneratedUrlHelpersModule`. + + +module PgHero::Engine::GeneratedUrlHelpersModule + include ::ActionDispatch::Routing::UrlFor + include ::ActionDispatch::Routing::PolymorphicRoutes + + sig { params(args: T.untyped).returns(String) } + def connection_stats_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def connections_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def cpu_usage_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def enable_query_stats_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def explain_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def free_space_stats_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def index_bloat_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def kill_all_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def kill_long_running_queries_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def kill_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def live_queries_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def load_stats_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def maintenance_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def queries_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def query_stats_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def relation_space_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def replication_lag_stats_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def reset_query_stats_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def root_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def show_query_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def space_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def system_stats_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def system_url(*args); end + + sig { params(args: T.untyped).returns(String) } + def tune_url(*args); end +end diff --git a/sorbet/rbi/dsl/pg_hero/home_controller.rbi b/sorbet/rbi/dsl/pg_hero/home_controller.rbi new file mode 100644 index 000000000..e7aa6ae2d --- /dev/null +++ b/sorbet/rbi/dsl/pg_hero/home_controller.rbi @@ -0,0 +1,26 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `PgHero::HomeController`. +# Please instead update this file by running `bin/tapioca dsl PgHero::HomeController`. + + +class PgHero::HomeController + include GeneratedMountedHelpers + include PgHero::Engine::GeneratedUrlHelpersModule + include PgHero::Engine::GeneratedPathHelpersModule + + sig { returns(HelperProxy) } + def helpers; end + + module HelperMethods + include ::ActionText::ContentHelper + include ::ActionText::TagHelper + include ::ActionController::Base::HelperMethods + include ::PgHero::HomeHelper + 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 000000000..962f53ad4 --- /dev/null +++ b/sorbet/rbi/dsl/rails/conductor/base_controller.rbi @@ -0,0 +1,42 @@ +# 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 + include GeneratedMountedHelpers + + sig { returns(HelperProxy) } + def helpers; end + + module HelperMethods + include ::ActionText::ContentHelper + include ::ActionText::TagHelper + include ::ActionController::Base::HelperMethods + include ::ApplicationHelper + include ::AuthorizeCollectionHelper + include ::BadUtf8Helper + include ::BootstrapFlashHelper + include ::CourseTimingsHelper + include ::CoursesHelper + include ::ExercisesHelper + include ::ExtraFieldHelper + include ::FeedbackAnswersHelper + include ::FlashBlockHelper + include ::PasteHelper + include ::PointsHelper + include ::SessionsHelper + include ::SubmissionsHelper + include ::TwitterBreadcrumbsHelper + include ::FontAwesome::Rails::IconHelper + include ::Doorkeeper::DashboardHelper + end + + class HelperProxy < ::ActionView::Base + include HelperMethods + end +end diff --git a/sorbet/rbi/dsl/recently_changed_user_detail.rbi b/sorbet/rbi/dsl/recently_changed_user_detail.rbi new file mode 100644 index 000000000..4ff73d7a5 --- /dev/null +++ b/sorbet/rbi/dsl/recently_changed_user_detail.rbi @@ -0,0 +1,1550 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `RecentlyChangedUserDetail`. +# Please instead update this file by running `bin/tapioca dsl RecentlyChangedUserDetail`. + + +class RecentlyChangedUserDetail + include GeneratedAttributeMethods + include EnumMethodsModule + extend CommonRelationMethods + extend GeneratedRelationMethods + + private + + sig { returns(NilClass) } + def to_ary; end + + class << self + sig { returns(T::Hash[T.any(String, Symbol), Integer]) } + def change_types; end + + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(::RecentlyChangedUserDetail) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::RecentlyChangedUserDetail).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: ::RecentlyChangedUserDetail).void) + ).returns(::RecentlyChangedUserDetail) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(T::Array[::RecentlyChangedUserDetail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(::RecentlyChangedUserDetail) + 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: ::RecentlyChangedUserDetail).void + ).returns(Integer) + end + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(::RecentlyChangedUserDetail) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(T::Array[::RecentlyChangedUserDetail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(::RecentlyChangedUserDetail) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(::RecentlyChangedUserDetail) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(T::Array[::RecentlyChangedUserDetail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(::RecentlyChangedUserDetail) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(T::Array[::RecentlyChangedUserDetail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(::RecentlyChangedUserDetail) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(T::Array[::RecentlyChangedUserDetail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(::RecentlyChangedUserDetail) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::RecentlyChangedUserDetail]) } + def destroy_all; end + + sig { returns(T::Array[::RecentlyChangedUserDetail]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::RecentlyChangedUserDetail]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::RecentlyChangedUserDetail)) } + def fifth; end + + sig { returns(::RecentlyChangedUserDetail) } + 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(::RecentlyChangedUserDetail) + 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[::RecentlyChangedUserDetail]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::RecentlyChangedUserDetail).void + ).returns(T.nilable(::RecentlyChangedUserDetail)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::RecentlyChangedUserDetail)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::RecentlyChangedUserDetail) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::RecentlyChangedUserDetail).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::RecentlyChangedUserDetail]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::RecentlyChangedUserDetail]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::RecentlyChangedUserDetail]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(T::Array[::RecentlyChangedUserDetail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(::RecentlyChangedUserDetail) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(T::Array[::RecentlyChangedUserDetail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(::RecentlyChangedUserDetail) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(T::Array[::RecentlyChangedUserDetail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(::RecentlyChangedUserDetail) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::RecentlyChangedUserDetail)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::RecentlyChangedUserDetail) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::RecentlyChangedUserDetail) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::RecentlyChangedUserDetail)) } + sig { params(limit: Integer).returns(T::Array[::RecentlyChangedUserDetail]) } + def first(limit = nil); end + + sig { returns(::RecentlyChangedUserDetail) } + def first!; end + + sig { returns(T.nilable(::RecentlyChangedUserDetail)) } + def forty_two; end + + sig { returns(::RecentlyChangedUserDetail) } + def forty_two!; end + + sig { returns(T.nilable(::RecentlyChangedUserDetail)) } + def fourth; end + + sig { returns(::RecentlyChangedUserDetail) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::RecentlyChangedUserDetail)) } + sig { params(limit: Integer).returns(T::Array[::RecentlyChangedUserDetail]) } + def last(limit = nil); end + + sig { returns(::RecentlyChangedUserDetail) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::RecentlyChangedUserDetail).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: ::RecentlyChangedUserDetail).void) + ).returns(::RecentlyChangedUserDetail) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(T::Array[::RecentlyChangedUserDetail]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::RecentlyChangedUserDetail).void) + ).returns(::RecentlyChangedUserDetail) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::RecentlyChangedUserDetail).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::RecentlyChangedUserDetail).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(::RecentlyChangedUserDetail)) } + def second; end + + sig { returns(::RecentlyChangedUserDetail) } + def second!; end + + sig { returns(T.nilable(::RecentlyChangedUserDetail)) } + def second_to_last; end + + sig { returns(::RecentlyChangedUserDetail) } + def second_to_last!; end + + sig { returns(::RecentlyChangedUserDetail) } + 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: ::RecentlyChangedUserDetail).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::RecentlyChangedUserDetail)) } + sig { params(limit: Integer).returns(T::Array[::RecentlyChangedUserDetail]) } + def take(limit = nil); end + + sig { returns(::RecentlyChangedUserDetail) } + def take!; end + + sig { returns(T.nilable(::RecentlyChangedUserDetail)) } + def third; end + + sig { returns(::RecentlyChangedUserDetail) } + def third!; end + + sig { returns(T.nilable(::RecentlyChangedUserDetail)) } + def third_to_last; end + + sig { returns(::RecentlyChangedUserDetail) } + def third_to_last!; end + end + + module EnumMethodsModule + sig { void } + def deleted!; end + + sig { returns(T::Boolean) } + def deleted?; end + + sig { void } + def email_changed!; end + + sig { returns(T::Boolean) } + def email_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 create_with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def deleted(*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 email_changed(*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_deleted(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_email_changed(*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: ::RecentlyChangedUserDetail).returns(BasicObject) + ).returns(T::Array[::RecentlyChangedUserDetail]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::String) } + def change_type; end + + sig { params(value: T.any(::String, ::Symbol, ::Integer)).returns(T.any(::String, ::Symbol, ::Integer)) } + def change_type=(value); end + + sig { returns(T::Boolean) } + def change_type?; end + + sig { returns(T.nilable(::String)) } + def change_type_before_last_save; end + + sig { returns(T.untyped) } + def change_type_before_type_cast; end + + sig { returns(T::Boolean) } + def change_type_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def change_type_change; end + + sig { returns(T.nilable([::String, ::String])) } + def change_type_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def change_type_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def change_type_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def change_type_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def change_type_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def change_type_previously_was; end + + sig { returns(T.nilable(::String)) } + def change_type_was; end + + sig { void } + def change_type_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 email; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def email=(value); end + + sig { returns(T::Boolean) } + def email?; end + + sig { returns(T.nilable(::String)) } + def email_before_last_save; end + + sig { returns(T.untyped) } + def email_before_type_cast; end + + sig { returns(T::Boolean) } + def email_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def email_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def email_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def email_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def email_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def email_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def email_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def email_previously_was; end + + sig { returns(T.nilable(::String)) } + def email_was; end + + sig { void } + def email_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 new_value; end + + sig { params(value: ::String).returns(::String) } + def new_value=(value); end + + sig { returns(T::Boolean) } + def new_value?; end + + sig { returns(T.nilable(::String)) } + def new_value_before_last_save; end + + sig { returns(T.untyped) } + def new_value_before_type_cast; end + + sig { returns(T::Boolean) } + def new_value_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def new_value_change; end + + sig { returns(T.nilable([::String, ::String])) } + def new_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def new_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def new_value_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def new_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def new_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def new_value_previously_was; end + + sig { returns(T.nilable(::String)) } + def new_value_was; end + + sig { void } + def new_value_will_change!; end + + sig { returns(T.nilable(::String)) } + def old_value; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def old_value=(value); end + + sig { returns(T::Boolean) } + def old_value?; end + + sig { returns(T.nilable(::String)) } + def old_value_before_last_save; end + + sig { returns(T.untyped) } + def old_value_before_type_cast; end + + sig { returns(T::Boolean) } + def old_value_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def old_value_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def old_value_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def old_value_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def old_value_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def old_value_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def old_value_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def old_value_previously_was; end + + sig { returns(T.nilable(::String)) } + def old_value_was; end + + sig { void } + def old_value_will_change!; end + + sig { void } + def restore_change_type!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_email!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_new_value!; end + + sig { void } + def restore_old_value!; end + + sig { void } + def restore_updated_at!; end + + sig { void } + def restore_user_id!; end + + sig { void } + def restore_username!; end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_change_type; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_change_type?(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_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_email; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_email?(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_new_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_new_value?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_old_value; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_old_value?(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_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([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(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 { 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_change_type?(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_email?(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_new_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_old_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_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 + + 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 create_with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def deleted(*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 email_changed(*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_deleted(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_email_changed(*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: ::RecentlyChangedUserDetail).returns(BasicObject) + ).returns(T::Array[::RecentlyChangedUserDetail]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::RecentlyChangedUserDetail } } + + sig { returns(T::Array[::RecentlyChangedUserDetail]) } + def to_a; end + + sig { returns(T::Array[::RecentlyChangedUserDetail]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::RecentlyChangedUserDetail } } + + 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: ::RecentlyChangedUserDetail } } + + 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: ::RecentlyChangedUserDetail } } + + sig do + params( + records: T.any(::RecentlyChangedUserDetail, T::Enumerable[T.any(::RecentlyChangedUserDetail, T::Enumerable[::RecentlyChangedUserDetail])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::RecentlyChangedUserDetail, T::Enumerable[T.any(::RecentlyChangedUserDetail, T::Enumerable[::RecentlyChangedUserDetail])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::RecentlyChangedUserDetail, T::Enumerable[T.any(::RecentlyChangedUserDetail, T::Enumerable[::RecentlyChangedUserDetail])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::RecentlyChangedUserDetail, Integer, String, T::Enumerable[T.any(::RecentlyChangedUserDetail, Integer, String, T::Enumerable[::RecentlyChangedUserDetail])]) + ).returns(T::Array[::RecentlyChangedUserDetail]) + end + def delete(*records); end + + sig do + params( + records: T.any(::RecentlyChangedUserDetail, Integer, String, T::Enumerable[T.any(::RecentlyChangedUserDetail, Integer, String, T::Enumerable[::RecentlyChangedUserDetail])]) + ).returns(T::Array[::RecentlyChangedUserDetail]) + end + def destroy(*records); end + + sig { returns(T::Array[::RecentlyChangedUserDetail]) } + def load_target; end + + sig do + params( + records: T.any(::RecentlyChangedUserDetail, T::Enumerable[T.any(::RecentlyChangedUserDetail, T::Enumerable[::RecentlyChangedUserDetail])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::RecentlyChangedUserDetail, T::Enumerable[T.any(::RecentlyChangedUserDetail, T::Enumerable[::RecentlyChangedUserDetail])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::RecentlyChangedUserDetail, T::Enumerable[T.any(::RecentlyChangedUserDetail, T::Enumerable[::RecentlyChangedUserDetail])]) + ).returns(T::Array[::RecentlyChangedUserDetail]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::RecentlyChangedUserDetail]) } + def target; end + + sig { returns(T::Array[::RecentlyChangedUserDetail]) } + def to_a; end + + sig { returns(T::Array[::RecentlyChangedUserDetail]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::RecentlyChangedUserDetail } } + + sig { returns(T::Array[::RecentlyChangedUserDetail]) } + def to_a; end + + sig { returns(T::Array[::RecentlyChangedUserDetail]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::RecentlyChangedUserDetail } } + + 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: ::RecentlyChangedUserDetail } } + + 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/reply_to_feedback_answer.rbi b/sorbet/rbi/dsl/reply_to_feedback_answer.rbi new file mode 100644 index 000000000..d584fd76a --- /dev/null +++ b/sorbet/rbi/dsl/reply_to_feedback_answer.rbi @@ -0,0 +1,1362 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ReplyToFeedbackAnswer`. +# Please instead update this file by running `bin/tapioca dsl ReplyToFeedbackAnswer`. + + +class ReplyToFeedbackAnswer + 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: ::ReplyToFeedbackAnswer).void) + ).returns(::ReplyToFeedbackAnswer) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig do + params( + block: T.nilable(T.proc.params(record: ::ReplyToFeedbackAnswer).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: ::ReplyToFeedbackAnswer).void) + ).returns(::ReplyToFeedbackAnswer) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(T::Array[::ReplyToFeedbackAnswer]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(::ReplyToFeedbackAnswer) + 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: ::ReplyToFeedbackAnswer).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(::ReplyToFeedbackAnswer) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(T::Array[::ReplyToFeedbackAnswer]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(::ReplyToFeedbackAnswer) + end + def create(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(::ReplyToFeedbackAnswer) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(T::Array[::ReplyToFeedbackAnswer]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(::ReplyToFeedbackAnswer) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(T::Array[::ReplyToFeedbackAnswer]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(::ReplyToFeedbackAnswer) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(T::Array[::ReplyToFeedbackAnswer]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(::ReplyToFeedbackAnswer) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::ReplyToFeedbackAnswer]) } + def destroy_all; end + + sig { returns(T::Array[::ReplyToFeedbackAnswer]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::ReplyToFeedbackAnswer]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::ReplyToFeedbackAnswer)) } + def fifth; end + + sig { returns(::ReplyToFeedbackAnswer) } + 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(::ReplyToFeedbackAnswer) + 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[::ReplyToFeedbackAnswer]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::ReplyToFeedbackAnswer).void + ).returns(T.nilable(::ReplyToFeedbackAnswer)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::ReplyToFeedbackAnswer)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::ReplyToFeedbackAnswer) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::ReplyToFeedbackAnswer).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::ReplyToFeedbackAnswer]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::ReplyToFeedbackAnswer]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::ReplyToFeedbackAnswer]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(T::Array[::ReplyToFeedbackAnswer]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(::ReplyToFeedbackAnswer) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(T::Array[::ReplyToFeedbackAnswer]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(::ReplyToFeedbackAnswer) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(T::Array[::ReplyToFeedbackAnswer]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(::ReplyToFeedbackAnswer) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::ReplyToFeedbackAnswer)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::ReplyToFeedbackAnswer) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::ReplyToFeedbackAnswer) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::ReplyToFeedbackAnswer)) } + sig { params(limit: Integer).returns(T::Array[::ReplyToFeedbackAnswer]) } + def first(limit = nil); end + + sig { returns(::ReplyToFeedbackAnswer) } + def first!; end + + sig { returns(T.nilable(::ReplyToFeedbackAnswer)) } + def forty_two; end + + sig { returns(::ReplyToFeedbackAnswer) } + def forty_two!; end + + sig { returns(T.nilable(::ReplyToFeedbackAnswer)) } + def fourth; end + + sig { returns(::ReplyToFeedbackAnswer) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::ReplyToFeedbackAnswer)) } + sig { params(limit: Integer).returns(T::Array[::ReplyToFeedbackAnswer]) } + def last(limit = nil); end + + sig { returns(::ReplyToFeedbackAnswer) } + def last!; end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ReplyToFeedbackAnswer).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: ::ReplyToFeedbackAnswer).void) + ).returns(::ReplyToFeedbackAnswer) + end + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(T::Array[::ReplyToFeedbackAnswer]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::ReplyToFeedbackAnswer).void) + ).returns(::ReplyToFeedbackAnswer) + end + def new(attributes = nil, &block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ReplyToFeedbackAnswer).returns(T.untyped)) + ).returns(T::Boolean) + end + def none?(&block); end + + sig do + params( + block: T.nilable(T.proc.params(record: ::ReplyToFeedbackAnswer).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(::ReplyToFeedbackAnswer)) } + def second; end + + sig { returns(::ReplyToFeedbackAnswer) } + def second!; end + + sig { returns(T.nilable(::ReplyToFeedbackAnswer)) } + def second_to_last; end + + sig { returns(::ReplyToFeedbackAnswer) } + def second_to_last!; end + + sig { returns(::ReplyToFeedbackAnswer) } + 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: ::ReplyToFeedbackAnswer).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::ReplyToFeedbackAnswer)) } + sig { params(limit: Integer).returns(T::Array[::ReplyToFeedbackAnswer]) } + def take(limit = nil); end + + sig { returns(::ReplyToFeedbackAnswer) } + def take!; end + + sig { returns(T.nilable(::ReplyToFeedbackAnswer)) } + def third; end + + sig { returns(::ReplyToFeedbackAnswer) } + def third!; end + + sig { returns(T.nilable(::ReplyToFeedbackAnswer)) } + def third_to_last; end + + sig { returns(::ReplyToFeedbackAnswer) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::FeedbackAnswer) } + def build_feedback_answer(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::FeedbackAnswer) } + def create_feedback_answer(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::FeedbackAnswer) } + def create_feedback_answer!(*args, &blk); end + + sig { returns(T.nilable(::FeedbackAnswer)) } + def feedback_answer; end + + sig { params(value: T.nilable(::FeedbackAnswer)).void } + def feedback_answer=(value); end + + sig { returns(T::Boolean) } + def feedback_answer_changed?; end + + sig { returns(T::Boolean) } + def feedback_answer_previously_changed?; end + + sig { returns(T.nilable(::FeedbackAnswer)) } + def reload_feedback_answer; end + + sig { void } + def reset_feedback_answer; 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 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: ::ReplyToFeedbackAnswer).returns(BasicObject) + ).returns(T::Array[::ReplyToFeedbackAnswer]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.nilable(::String)) } + def body; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def body=(value); end + + sig { returns(T::Boolean) } + def body?; end + + sig { returns(T.nilable(::String)) } + def body_before_last_save; end + + sig { returns(T.untyped) } + def body_before_type_cast; end + + sig { returns(T::Boolean) } + def body_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def body_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def body_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def body_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def body_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def body_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def body_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def body_previously_was; end + + sig { returns(T.nilable(::String)) } + def body_was; end + + sig { void } + def body_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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(::Integer)) } + def feedback_answer_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def feedback_answer_id=(value); end + + sig { returns(T::Boolean) } + def feedback_answer_id?; end + + sig { returns(T.nilable(::Integer)) } + def feedback_answer_id_before_last_save; end + + sig { returns(T.untyped) } + def feedback_answer_id_before_type_cast; end + + sig { returns(T::Boolean) } + def feedback_answer_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def feedback_answer_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def feedback_answer_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def feedback_answer_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def feedback_answer_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def feedback_answer_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def feedback_answer_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def feedback_answer_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def feedback_answer_id_was; end + + sig { void } + def feedback_answer_id_will_change!; end + + sig { returns(T.nilable(::String)) } + def from; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def from=(value); end + + sig { returns(T::Boolean) } + def from?; end + + sig { returns(T.nilable(::String)) } + def from_before_last_save; end + + sig { returns(T.untyped) } + def from_before_type_cast; end + + sig { returns(T::Boolean) } + def from_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def from_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def from_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def from_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def from_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def from_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def from_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def from_previously_was; end + + sig { returns(T.nilable(::String)) } + def from_was; end + + sig { void } + def from_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 { void } + def restore_body!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_feedback_answer_id!; end + + sig { void } + def restore_from!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_updated_at!; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_body; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_body?(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_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(::Integer), T.nilable(::Integer)])) } + def saved_change_to_feedback_answer_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_feedback_answer_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_from; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_from?(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(::ActiveSupport::TimeWithZone), T.nilable(::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 updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_body?(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_feedback_answer_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_from?(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_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 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: ::ReplyToFeedbackAnswer).returns(BasicObject) + ).returns(T::Array[::ReplyToFeedbackAnswer]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::ReplyToFeedbackAnswer } } + + sig { returns(T::Array[::ReplyToFeedbackAnswer]) } + def to_a; end + + sig { returns(T::Array[::ReplyToFeedbackAnswer]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::ReplyToFeedbackAnswer } } + + 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: ::ReplyToFeedbackAnswer } } + + 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: ::ReplyToFeedbackAnswer } } + + sig do + params( + records: T.any(::ReplyToFeedbackAnswer, T::Enumerable[T.any(::ReplyToFeedbackAnswer, T::Enumerable[::ReplyToFeedbackAnswer])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::ReplyToFeedbackAnswer, T::Enumerable[T.any(::ReplyToFeedbackAnswer, T::Enumerable[::ReplyToFeedbackAnswer])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::ReplyToFeedbackAnswer, T::Enumerable[T.any(::ReplyToFeedbackAnswer, T::Enumerable[::ReplyToFeedbackAnswer])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::ReplyToFeedbackAnswer, Integer, String, T::Enumerable[T.any(::ReplyToFeedbackAnswer, Integer, String, T::Enumerable[::ReplyToFeedbackAnswer])]) + ).returns(T::Array[::ReplyToFeedbackAnswer]) + end + def delete(*records); end + + sig do + params( + records: T.any(::ReplyToFeedbackAnswer, Integer, String, T::Enumerable[T.any(::ReplyToFeedbackAnswer, Integer, String, T::Enumerable[::ReplyToFeedbackAnswer])]) + ).returns(T::Array[::ReplyToFeedbackAnswer]) + end + def destroy(*records); end + + sig { returns(T::Array[::ReplyToFeedbackAnswer]) } + def load_target; end + + sig do + params( + records: T.any(::ReplyToFeedbackAnswer, T::Enumerable[T.any(::ReplyToFeedbackAnswer, T::Enumerable[::ReplyToFeedbackAnswer])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::ReplyToFeedbackAnswer, T::Enumerable[T.any(::ReplyToFeedbackAnswer, T::Enumerable[::ReplyToFeedbackAnswer])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::ReplyToFeedbackAnswer, T::Enumerable[T.any(::ReplyToFeedbackAnswer, T::Enumerable[::ReplyToFeedbackAnswer])]) + ).returns(T::Array[::ReplyToFeedbackAnswer]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::ReplyToFeedbackAnswer]) } + def target; end + + sig { returns(T::Array[::ReplyToFeedbackAnswer]) } + def to_a; end + + sig { returns(T::Array[::ReplyToFeedbackAnswer]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::ReplyToFeedbackAnswer } } + + sig { returns(T::Array[::ReplyToFeedbackAnswer]) } + def to_a; end + + sig { returns(T::Array[::ReplyToFeedbackAnswer]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::ReplyToFeedbackAnswer } } + + 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: ::ReplyToFeedbackAnswer } } + + 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/review.rbi b/sorbet/rbi/dsl/review.rbi new file mode 100644 index 000000000..34f56704e --- /dev/null +++ b/sorbet/rbi/dsl/review.rbi @@ -0,0 +1,1408 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Review`. +# Please instead update this file by running `bin/tapioca dsl Review`. + + +class Review + 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: ::Review).void)).returns(::Review) } + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::Review).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: ::Review).void)).returns(::Review) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Review).void) + ).returns(T::Array[::Review]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Review).void)).returns(::Review) } + 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: ::Review).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Review).void)).returns(::Review) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Review).void) + ).returns(T::Array[::Review]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Review).void)).returns(::Review) } + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Review).void)).returns(::Review) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Review).void) + ).returns(T::Array[::Review]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Review).void)).returns(::Review) } + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Review).void) + ).returns(T::Array[::Review]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Review).void)).returns(::Review) } + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Review).void) + ).returns(T::Array[::Review]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Review).void)).returns(::Review) } + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::Review]) } + def destroy_all; end + + sig { returns(T::Array[::Review]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Review]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Review)) } + def fifth; end + + sig { returns(::Review) } + 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(::Review) + 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[::Review]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::Review).void).returns(T.nilable(::Review)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Review)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Review) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::Review).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::Review]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::Review]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::Review]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Review).void) + ).returns(T::Array[::Review]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Review).void)).returns(::Review) } + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Review).void) + ).returns(T::Array[::Review]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Review).void)).returns(::Review) } + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Review).void) + ).returns(T::Array[::Review]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Review).void)).returns(::Review) } + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Review)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Review) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Review) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Review)) } + sig { params(limit: Integer).returns(T::Array[::Review]) } + def first(limit = nil); end + + sig { returns(::Review) } + def first!; end + + sig { returns(T.nilable(::Review)) } + def forty_two; end + + sig { returns(::Review) } + def forty_two!; end + + sig { returns(T.nilable(::Review)) } + def fourth; end + + sig { returns(::Review) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::Review)) } + sig { params(limit: Integer).returns(T::Array[::Review]) } + def last(limit = nil); end + + sig { returns(::Review) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::Review).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: ::Review).void)).returns(::Review) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Review).void) + ).returns(T::Array[::Review]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Review).void)).returns(::Review) } + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Review).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Review).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(::Review)) } + def second; end + + sig { returns(::Review) } + def second!; end + + sig { returns(T.nilable(::Review)) } + def second_to_last; end + + sig { returns(::Review) } + def second_to_last!; end + + sig { returns(::Review) } + 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: ::Review).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Review)) } + sig { params(limit: Integer).returns(T::Array[::Review]) } + def take(limit = nil); end + + sig { returns(::Review) } + def take!; end + + sig { returns(T.nilable(::Review)) } + def third; end + + sig { returns(::Review) } + def third!; end + + sig { returns(T.nilable(::Review)) } + def third_to_last; end + + sig { returns(::Review) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def build_reviewer(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Submission) } + def build_submission(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def create_reviewer(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def create_reviewer!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Submission) } + def create_submission(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Submission) } + def create_submission!(*args, &blk); end + + sig { returns(T.nilable(::User)) } + def reload_reviewer; end + + sig { returns(T.nilable(::Submission)) } + def reload_submission; end + + sig { void } + def reset_reviewer; end + + sig { void } + def reset_submission; end + + sig { returns(T.nilable(::User)) } + def reviewer; end + + sig { params(value: T.nilable(::User)).void } + def reviewer=(value); end + + sig { returns(T::Boolean) } + def reviewer_changed?; end + + sig { returns(T::Boolean) } + def reviewer_previously_changed?; end + + sig { returns(T.nilable(::Submission)) } + def submission; end + + sig { params(value: T.nilable(::Submission)).void } + def submission=(value); end + + sig { returns(T::Boolean) } + def submission_changed?; end + + sig { returns(T::Boolean) } + def submission_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 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: ::Review).returns(BasicObject)).returns(T::Array[::Review]) } + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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::Boolean) } + def marked_as_read; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def marked_as_read=(value); end + + sig { returns(T::Boolean) } + def marked_as_read?; end + + sig { returns(T.nilable(T::Boolean)) } + def marked_as_read_before_last_save; end + + sig { returns(T.untyped) } + def marked_as_read_before_type_cast; end + + sig { returns(T::Boolean) } + def marked_as_read_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def marked_as_read_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def marked_as_read_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def marked_as_read_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def marked_as_read_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def marked_as_read_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def marked_as_read_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def marked_as_read_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def marked_as_read_was; end + + sig { void } + def marked_as_read_will_change!; end + + sig { returns(T.nilable(::String)) } + def points; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def points=(value); end + + sig { returns(T::Boolean) } + def points?; end + + sig { returns(T.nilable(::String)) } + def points_before_last_save; end + + sig { returns(T.untyped) } + def points_before_type_cast; end + + sig { returns(T::Boolean) } + def points_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def points_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def points_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def points_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def points_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def points_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def points_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def points_previously_was; end + + sig { returns(T.nilable(::String)) } + def points_was; end + + sig { void } + def points_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_marked_as_read!; end + + sig { void } + def restore_points!; end + + sig { void } + def restore_review_body!; end + + sig { void } + def restore_reviewer_id!; end + + sig { void } + def restore_submission_id!; end + + sig { void } + def restore_updated_at!; end + + sig { returns(::String) } + def review_body; end + + sig { params(value: ::String).returns(::String) } + def review_body=(value); end + + sig { returns(T::Boolean) } + def review_body?; end + + sig { returns(T.nilable(::String)) } + def review_body_before_last_save; end + + sig { returns(T.untyped) } + def review_body_before_type_cast; end + + sig { returns(T::Boolean) } + def review_body_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def review_body_change; end + + sig { returns(T.nilable([::String, ::String])) } + def review_body_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def review_body_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def review_body_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def review_body_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def review_body_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def review_body_previously_was; end + + sig { returns(T.nilable(::String)) } + def review_body_was; end + + sig { void } + def review_body_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def reviewer_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def reviewer_id=(value); end + + sig { returns(T::Boolean) } + def reviewer_id?; end + + sig { returns(T.nilable(::Integer)) } + def reviewer_id_before_last_save; end + + sig { returns(T.untyped) } + def reviewer_id_before_type_cast; end + + sig { returns(T::Boolean) } + def reviewer_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def reviewer_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def reviewer_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def reviewer_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def reviewer_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def reviewer_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def reviewer_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def reviewer_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def reviewer_id_was; end + + sig { void } + def reviewer_id_will_change!; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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::Boolean, T::Boolean])) } + def saved_change_to_marked_as_read; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_marked_as_read?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_points; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_points?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_review_body; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_review_body?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_reviewer_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_reviewer_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_submission_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_submission_id?(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_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(::Integer) } + def submission_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def submission_id=(value); end + + sig { returns(T::Boolean) } + def submission_id?; end + + sig { returns(T.nilable(::Integer)) } + def submission_id_before_last_save; end + + sig { returns(T.untyped) } + def submission_id_before_type_cast; end + + sig { returns(T::Boolean) } + def submission_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def submission_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def submission_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def submission_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def submission_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def submission_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def submission_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def submission_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def submission_id_was; end + + sig { void } + def submission_id_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_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_marked_as_read?(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_points?(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_review_body?(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_reviewer_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_submission_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 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: ::Review).returns(BasicObject)).returns(T::Array[::Review]) } + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Review } } + + sig { returns(T::Array[::Review]) } + def to_a; end + + sig { returns(T::Array[::Review]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Review } } + + 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: ::Review } } + + 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: ::Review } } + + sig do + params( + records: T.any(::Review, T::Enumerable[T.any(::Review, T::Enumerable[::Review])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Review, T::Enumerable[T.any(::Review, T::Enumerable[::Review])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Review, T::Enumerable[T.any(::Review, T::Enumerable[::Review])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::Review, Integer, String, T::Enumerable[T.any(::Review, Integer, String, T::Enumerable[::Review])]) + ).returns(T::Array[::Review]) + end + def delete(*records); end + + sig do + params( + records: T.any(::Review, Integer, String, T::Enumerable[T.any(::Review, Integer, String, T::Enumerable[::Review])]) + ).returns(T::Array[::Review]) + end + def destroy(*records); end + + sig { returns(T::Array[::Review]) } + def load_target; end + + sig do + params( + records: T.any(::Review, T::Enumerable[T.any(::Review, T::Enumerable[::Review])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Review, T::Enumerable[T.any(::Review, T::Enumerable[::Review])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Review, T::Enumerable[T.any(::Review, T::Enumerable[::Review])]) + ).returns(T::Array[::Review]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Review]) } + def target; end + + sig { returns(T::Array[::Review]) } + def to_a; end + + sig { returns(T::Array[::Review]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Review } } + + sig { returns(T::Array[::Review]) } + def to_a; end + + sig { returns(T::Array[::Review]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Review } } + + 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: ::Review } } + + 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/review_mailer.rbi b/sorbet/rbi/dsl/review_mailer.rbi new file mode 100644 index 000000000..db83cb2ba --- /dev/null +++ b/sorbet/rbi/dsl/review_mailer.rbi @@ -0,0 +1,16 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `ReviewMailer`. +# Please instead update this file by running `bin/tapioca dsl ReviewMailer`. + + +class ReviewMailer + include GeneratedUrlHelpersModule + include GeneratedMountedHelpers + + class << self + sig { params(review: ::Review).returns(::ActionMailer::MessageDelivery) } + def review_email(review); end + end +end diff --git a/sorbet/rbi/dsl/session.rbi b/sorbet/rbi/dsl/session.rbi new file mode 100644 index 000000000..149763b67 --- /dev/null +++ b/sorbet/rbi/dsl/session.rbi @@ -0,0 +1,1180 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Session`. +# Please instead update this file by running `bin/tapioca dsl Session`. + + +class Session + 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: ::Session).void)).returns(::Session) } + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::Session).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: ::Session).void)).returns(::Session) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Session).void) + ).returns(T::Array[::Session]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Session).void)).returns(::Session) } + 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: ::Session).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Session).void)).returns(::Session) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Session).void) + ).returns(T::Array[::Session]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Session).void)).returns(::Session) } + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Session).void)).returns(::Session) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Session).void) + ).returns(T::Array[::Session]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Session).void)).returns(::Session) } + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Session).void) + ).returns(T::Array[::Session]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Session).void)).returns(::Session) } + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Session).void) + ).returns(T::Array[::Session]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Session).void)).returns(::Session) } + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::Session]) } + def destroy_all; end + + sig { returns(T::Array[::Session]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Session]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Session)) } + def fifth; end + + sig { returns(::Session) } + 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(::Session) + 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[::Session]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::Session).void).returns(T.nilable(::Session)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Session)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Session) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::Session).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::Session]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::Session]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::Session]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Session).void) + ).returns(T::Array[::Session]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Session).void)).returns(::Session) } + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Session).void) + ).returns(T::Array[::Session]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Session).void)).returns(::Session) } + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Session).void) + ).returns(T::Array[::Session]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Session).void)).returns(::Session) } + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Session)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Session) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Session) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Session)) } + sig { params(limit: Integer).returns(T::Array[::Session]) } + def first(limit = nil); end + + sig { returns(::Session) } + def first!; end + + sig { returns(T.nilable(::Session)) } + def forty_two; end + + sig { returns(::Session) } + def forty_two!; end + + sig { returns(T.nilable(::Session)) } + def fourth; end + + sig { returns(::Session) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::Session)) } + sig { params(limit: Integer).returns(T::Array[::Session]) } + def last(limit = nil); end + + sig { returns(::Session) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::Session).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: ::Session).void)).returns(::Session) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Session).void) + ).returns(T::Array[::Session]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Session).void)).returns(::Session) } + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Session).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Session).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(::Session)) } + def second; end + + sig { returns(::Session) } + def second!; end + + sig { returns(T.nilable(::Session)) } + def second_to_last; end + + sig { returns(::Session) } + def second_to_last!; end + + sig { returns(::Session) } + 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: ::Session).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Session)) } + sig { params(limit: Integer).returns(T::Array[::Session]) } + def take(limit = nil); end + + sig { returns(::Session) } + def take!; end + + sig { returns(T.nilable(::Session)) } + def third; end + + sig { returns(::Session) } + def third!; end + + sig { returns(T.nilable(::Session)) } + def third_to_last; end + + sig { returns(::Session) } + def third_to_last!; 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 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: ::Session).returns(BasicObject)).returns(T::Array[::Session]) } + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 data; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def data=(value); end + + sig { returns(T::Boolean) } + def data?; end + + sig { returns(T.nilable(::String)) } + def data_before_last_save; end + + sig { returns(T.untyped) } + def data_before_type_cast; end + + sig { returns(T::Boolean) } + def data_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def data_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def data_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def data_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def data_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def data_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def data_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def data_previously_was; end + + sig { returns(T.nilable(::String)) } + def data_was; end + + sig { void } + def data_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 { void } + def restore_created_at!; end + + sig { void } + def restore_data!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_session_id!; end + + sig { void } + def restore_updated_at!; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_data; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_data?(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_session_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_session_id?(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_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 session_id; end + + sig { params(value: ::String).returns(::String) } + def session_id=(value); end + + sig { returns(T::Boolean) } + def session_id?; end + + sig { returns(T.nilable(::String)) } + def session_id_before_last_save; end + + sig { returns(T.untyped) } + def session_id_before_type_cast; end + + sig { returns(T::Boolean) } + def session_id_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def session_id_change; end + + sig { returns(T.nilable([::String, ::String])) } + def session_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def session_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def session_id_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def session_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def session_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def session_id_previously_was; end + + sig { returns(T.nilable(::String)) } + def session_id_was; end + + sig { void } + def session_id_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_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_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_session_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 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: ::Session).returns(BasicObject)).returns(T::Array[::Session]) } + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Session } } + + sig { returns(T::Array[::Session]) } + def to_a; end + + sig { returns(T::Array[::Session]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Session } } + + 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: ::Session } } + + 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: ::Session } } + + sig do + params( + records: T.any(::Session, T::Enumerable[T.any(::Session, T::Enumerable[::Session])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Session, T::Enumerable[T.any(::Session, T::Enumerable[::Session])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Session, T::Enumerable[T.any(::Session, T::Enumerable[::Session])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::Session, Integer, String, T::Enumerable[T.any(::Session, Integer, String, T::Enumerable[::Session])]) + ).returns(T::Array[::Session]) + end + def delete(*records); end + + sig do + params( + records: T.any(::Session, Integer, String, T::Enumerable[T.any(::Session, Integer, String, T::Enumerable[::Session])]) + ).returns(T::Array[::Session]) + end + def destroy(*records); end + + sig { returns(T::Array[::Session]) } + def load_target; end + + sig do + params( + records: T.any(::Session, T::Enumerable[T.any(::Session, T::Enumerable[::Session])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Session, T::Enumerable[T.any(::Session, T::Enumerable[::Session])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Session, T::Enumerable[T.any(::Session, T::Enumerable[::Session])]) + ).returns(T::Array[::Session]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Session]) } + def target; end + + sig { returns(T::Array[::Session]) } + def to_a; end + + sig { returns(T::Array[::Session]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Session } } + + sig { returns(T::Array[::Session]) } + def to_a; end + + sig { returns(T::Array[::Session]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Session } } + + 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: ::Session } } + + 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/sprockets/rails/context.rbi b/sorbet/rbi/dsl/sprockets/rails/context.rbi new file mode 100644 index 000000000..c1d739f55 --- /dev/null +++ b/sorbet/rbi/dsl/sprockets/rails/context.rbi @@ -0,0 +1,36 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Sprockets::Rails::Context`. +# Please instead update this file by running `bin/tapioca dsl Sprockets::Rails::Context`. + + +module Sprockets::Rails::Context + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def assets_prefix; end + def assets_prefix=(value); end + def assets_prefix?; end + def config; end + def config=(value); end + def config?; end + def digest_assets; end + def digest_assets=(value); end + def digest_assets?; end + end + + module GeneratedInstanceMethods + def assets_prefix; end + def assets_prefix=(value); end + def assets_prefix?; end + def config; end + def config=(value); end + def config?; end + def digest_assets; end + def digest_assets=(value); end + def digest_assets?; end + end +end diff --git a/sorbet/rbi/dsl/sprockets/rails/helper.rbi b/sorbet/rbi/dsl/sprockets/rails/helper.rbi new file mode 100644 index 000000000..347cd4e2d --- /dev/null +++ b/sorbet/rbi/dsl/sprockets/rails/helper.rbi @@ -0,0 +1,78 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Sprockets::Rails::Helper`. +# Please instead update this file by running `bin/tapioca dsl Sprockets::Rails::Helper`. + + +module Sprockets::Rails::Helper + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + module GeneratedClassMethods + def assets_environment; end + def assets_environment=(value); end + def assets_environment?; end + def assets_manifest; end + def assets_manifest=(value); end + def assets_manifest?; end + def assets_precompile; end + def assets_precompile=(value); end + def assets_precompile?; end + def assets_prefix; end + def assets_prefix=(value); end + def assets_prefix?; end + def check_precompiled_asset; end + def check_precompiled_asset=(value); end + def check_precompiled_asset?; end + def debug_assets; end + def debug_assets=(value); end + def debug_assets?; end + def digest_assets; end + def digest_assets=(value); end + def digest_assets?; end + def precompiled_asset_checker; end + def precompiled_asset_checker=(value); end + def precompiled_asset_checker?; end + def resolve_assets_with; end + def resolve_assets_with=(value); end + def resolve_assets_with?; end + def unknown_asset_fallback; end + def unknown_asset_fallback=(value); end + def unknown_asset_fallback?; end + end + + module GeneratedInstanceMethods + def assets_environment; end + def assets_environment=(value); end + def assets_environment?; end + def assets_manifest; end + def assets_manifest=(value); end + def assets_manifest?; end + def assets_precompile; end + def assets_precompile=(value); end + def assets_precompile?; end + def assets_prefix; end + def assets_prefix=(value); end + def assets_prefix?; end + def check_precompiled_asset; end + def check_precompiled_asset=(value); end + def check_precompiled_asset?; end + def debug_assets; end + def debug_assets=(value); end + def debug_assets?; end + def digest_assets; end + def digest_assets=(value); end + def digest_assets?; end + def precompiled_asset_checker; end + def precompiled_asset_checker=(value); end + def precompiled_asset_checker?; end + def resolve_assets_with; end + def resolve_assets_with=(value); end + def resolve_assets_with?; end + def unknown_asset_fallback; end + def unknown_asset_fallback=(value); end + def unknown_asset_fallback?; end + end +end diff --git a/sorbet/rbi/dsl/submission.rbi b/sorbet/rbi/dsl/submission.rbi new file mode 100644 index 000000000..1d1613103 --- /dev/null +++ b/sorbet/rbi/dsl/submission.rbi @@ -0,0 +1,2873 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Submission`. +# Please instead update this file by running `bin/tapioca dsl Submission`. + + +class Submission + 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: ::Submission).void) + ).returns(::Submission) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::Submission).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: ::Submission).void)).returns(::Submission) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Submission).void) + ).returns(T::Array[::Submission]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Submission).void) + ).returns(::Submission) + 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: ::Submission).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Submission).void)).returns(::Submission) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Submission).void) + ).returns(T::Array[::Submission]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Submission).void) + ).returns(::Submission) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Submission).void)).returns(::Submission) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Submission).void) + ).returns(T::Array[::Submission]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Submission).void) + ).returns(::Submission) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Submission).void) + ).returns(T::Array[::Submission]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Submission).void) + ).returns(::Submission) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Submission).void) + ).returns(T::Array[::Submission]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Submission).void) + ).returns(::Submission) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::Submission]) } + def destroy_all; end + + sig { returns(T::Array[::Submission]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Submission]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Submission)) } + def fifth; end + + sig { returns(::Submission) } + 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(::Submission) + 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[::Submission]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::Submission).void).returns(T.nilable(::Submission)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Submission)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Submission) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::Submission).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::Submission]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::Submission]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::Submission]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Submission).void) + ).returns(T::Array[::Submission]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Submission).void) + ).returns(::Submission) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Submission).void) + ).returns(T::Array[::Submission]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Submission).void) + ).returns(::Submission) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Submission).void) + ).returns(T::Array[::Submission]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Submission).void) + ).returns(::Submission) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Submission)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Submission) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Submission) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Submission)) } + sig { params(limit: Integer).returns(T::Array[::Submission]) } + def first(limit = nil); end + + sig { returns(::Submission) } + def first!; end + + sig { returns(T.nilable(::Submission)) } + def forty_two; end + + sig { returns(::Submission) } + def forty_two!; end + + sig { returns(T.nilable(::Submission)) } + def fourth; end + + sig { returns(::Submission) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::Submission)) } + sig { params(limit: Integer).returns(T::Array[::Submission]) } + def last(limit = nil); end + + sig { returns(::Submission) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::Submission).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: ::Submission).void)).returns(::Submission) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Submission).void) + ).returns(T::Array[::Submission]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Submission).void) + ).returns(::Submission) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Submission).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Submission).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(::Submission)) } + def second; end + + sig { returns(::Submission) } + def second!; end + + sig { returns(T.nilable(::Submission)) } + def second_to_last; end + + sig { returns(::Submission) } + def second_to_last!; end + + sig { returns(::Submission) } + 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: ::Submission).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Submission)) } + sig { params(limit: Integer).returns(T::Array[::Submission]) } + def take(limit = nil); end + + sig { returns(::Submission) } + def take!; end + + sig { returns(T.nilable(::Submission)) } + def third; end + + sig { returns(::Submission) } + def third!; end + + sig { returns(T.nilable(::Submission)) } + def third_to_last; end + + sig { returns(::Submission) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { returns(T::Array[T.untyped]) } + def awarded_point_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def awarded_point_ids=(ids); end + + # This method is created by ActiveRecord on the `Submission` class because it declared `has_many :awarded_points`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::AwardedPoint::PrivateCollectionProxy) } + def awarded_points; end + + sig { params(value: T::Enumerable[::AwardedPoint]).void } + def awarded_points=(value); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def build_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Exercise) } + def build_exercise(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SubmissionData) } + def build_submission_data(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def build_user(*args, &blk); end + + sig { returns(T.nilable(::Course)) } + def course; end + + sig { params(value: T.nilable(::Course)).void } + def course=(value); end + + sig { returns(T::Boolean) } + def course_changed?; end + + sig { returns(T::Boolean) } + def course_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Exercise) } + def create_exercise(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Exercise) } + def create_exercise!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SubmissionData) } + def create_submission_data(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::SubmissionData) } + def create_submission_data!(*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(::Exercise)) } + def exercise; end + + sig { params(value: T.nilable(::Exercise)).void } + def exercise=(value); end + + sig { returns(T::Boolean) } + def exercise_changed?; end + + sig { returns(T::Boolean) } + def exercise_previously_changed?; end + + sig { returns(T::Array[T.untyped]) } + def feedback_answer_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def feedback_answer_ids=(ids); end + + # This method is created by ActiveRecord on the `Submission` class because it declared `has_many :feedback_answers`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::FeedbackAnswer::PrivateCollectionProxy) } + def feedback_answers; end + + sig { params(value: T::Enumerable[::FeedbackAnswer]).void } + def feedback_answers=(value); end + + sig { returns(T.nilable(::Course)) } + def reload_course; end + + sig { returns(T.nilable(::Exercise)) } + def reload_exercise; end + + sig { returns(T.nilable(::SubmissionData)) } + def reload_submission_data; end + + sig { returns(T.nilable(::User)) } + def reload_user; end + + sig { void } + def reset_course; end + + sig { void } + def reset_exercise; end + + sig { void } + def reset_submission_data; end + + sig { void } + def reset_user; end + + sig { returns(T::Array[T.untyped]) } + def review_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def review_ids=(ids); end + + # This method is created by ActiveRecord on the `Submission` class because it declared `has_many :reviews`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Review::PrivateCollectionProxy) } + def reviews; end + + sig { params(value: T::Enumerable[::Review]).void } + def reviews=(value); end + + sig { returns(T.nilable(::SubmissionData)) } + def submission_data; end + + sig { params(value: T.nilable(::SubmissionData)).void } + def submission_data=(value); end + + sig { returns(T::Array[T.untyped]) } + def test_case_run_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def test_case_run_ids=(ids); end + + # This method is created by ActiveRecord on the `Submission` class because it declared `has_many :test_case_runs`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::TestCaseRun::PrivateCollectionProxy) } + def test_case_runs; end + + sig { params(value: T::Enumerable[::TestCaseRun]).void } + def test_case_runs=(value); 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 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: ::Submission).returns(BasicObject)).returns(T::Array[::Submission]) } + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T::Boolean) } + def all_tests_passed; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def all_tests_passed=(value); end + + sig { returns(T::Boolean) } + def all_tests_passed?; end + + sig { returns(T.nilable(T::Boolean)) } + def all_tests_passed_before_last_save; end + + sig { returns(T.untyped) } + def all_tests_passed_before_type_cast; end + + sig { returns(T::Boolean) } + def all_tests_passed_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def all_tests_passed_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def all_tests_passed_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def all_tests_passed_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def all_tests_passed_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def all_tests_passed_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def all_tests_passed_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def all_tests_passed_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def all_tests_passed_was; end + + sig { void } + def all_tests_passed_will_change!; end + + sig { returns(T.nilable(::String)) } + def client_ip; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def client_ip=(value); end + + sig { returns(T::Boolean) } + def client_ip?; end + + sig { returns(T.nilable(::String)) } + def client_ip_before_last_save; end + + sig { returns(T.untyped) } + def client_ip_before_type_cast; end + + sig { returns(T::Boolean) } + def client_ip_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def client_ip_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def client_ip_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def client_ip_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def client_ip_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def client_ip_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def client_ip_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def client_ip_previously_was; end + + sig { returns(T.nilable(::String)) } + def client_ip_was; end + + sig { void } + def client_ip_will_change!; end + + sig { returns(T.nilable(::Integer)) } + def client_nanotime; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def client_nanotime=(value); end + + sig { returns(T::Boolean) } + def client_nanotime?; end + + sig { returns(T.nilable(::Integer)) } + def client_nanotime_before_last_save; end + + sig { returns(T.untyped) } + def client_nanotime_before_type_cast; end + + sig { returns(T::Boolean) } + def client_nanotime_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def client_nanotime_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def client_nanotime_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def client_nanotime_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def client_nanotime_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def client_nanotime_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def client_nanotime_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def client_nanotime_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def client_nanotime_was; end + + sig { void } + def client_nanotime_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def client_time; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def client_time=(value); end + + sig { returns(T::Boolean) } + def client_time?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def client_time_before_last_save; end + + sig { returns(T.untyped) } + def client_time_before_type_cast; end + + sig { returns(T::Boolean) } + def client_time_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def client_time_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def client_time_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def client_time_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def client_time_in_database; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def client_time_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def client_time_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def client_time_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def client_time_was; end + + sig { void } + def client_time_will_change!; end + + sig { returns(::Integer) } + def course_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def course_id=(value); end + + sig { returns(T::Boolean) } + def course_id?; end + + sig { returns(T.nilable(::Integer)) } + def course_id_before_last_save; end + + sig { returns(T.untyped) } + def course_id_before_type_cast; end + + sig { returns(T::Boolean) } + def course_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def course_id_was; end + + sig { void } + def course_id_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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(::String) } + def exercise_name; end + + sig { params(value: ::String).returns(::String) } + def exercise_name=(value); end + + sig { returns(T::Boolean) } + def exercise_name?; end + + sig { returns(T.nilable(::String)) } + def exercise_name_before_last_save; end + + sig { returns(T.untyped) } + def exercise_name_before_type_cast; end + + sig { returns(T::Boolean) } + def exercise_name_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def exercise_name_change; end + + sig { returns(T.nilable([::String, ::String])) } + def exercise_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def exercise_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def exercise_name_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def exercise_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def exercise_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def exercise_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def exercise_name_was; end + + sig { void } + def exercise_name_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 message_for_paste; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def message_for_paste=(value); end + + sig { returns(T::Boolean) } + def message_for_paste?; end + + sig { returns(T.nilable(::String)) } + def message_for_paste_before_last_save; end + + sig { returns(T.untyped) } + def message_for_paste_before_type_cast; end + + sig { returns(T::Boolean) } + def message_for_paste_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def message_for_paste_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def message_for_paste_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def message_for_paste_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def message_for_paste_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def message_for_paste_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def message_for_paste_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def message_for_paste_previously_was; end + + sig { returns(T.nilable(::String)) } + def message_for_paste_was; end + + sig { void } + def message_for_paste_will_change!; end + + sig { returns(::String) } + def message_for_reviewer; end + + sig { params(value: ::String).returns(::String) } + def message_for_reviewer=(value); end + + sig { returns(T::Boolean) } + def message_for_reviewer?; end + + sig { returns(T.nilable(::String)) } + def message_for_reviewer_before_last_save; end + + sig { returns(T.untyped) } + def message_for_reviewer_before_type_cast; end + + sig { returns(T::Boolean) } + def message_for_reviewer_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def message_for_reviewer_change; end + + sig { returns(T.nilable([::String, ::String])) } + def message_for_reviewer_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def message_for_reviewer_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def message_for_reviewer_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def message_for_reviewer_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def message_for_reviewer_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def message_for_reviewer_previously_was; end + + sig { returns(T.nilable(::String)) } + def message_for_reviewer_was; end + + sig { void } + def message_for_reviewer_will_change!; end + + sig { returns(T::Boolean) } + def newer_submission_reviewed; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def newer_submission_reviewed=(value); end + + sig { returns(T::Boolean) } + def newer_submission_reviewed?; end + + sig { returns(T.nilable(T::Boolean)) } + def newer_submission_reviewed_before_last_save; end + + sig { returns(T.untyped) } + def newer_submission_reviewed_before_type_cast; end + + sig { returns(T::Boolean) } + def newer_submission_reviewed_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def newer_submission_reviewed_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def newer_submission_reviewed_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def newer_submission_reviewed_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def newer_submission_reviewed_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def newer_submission_reviewed_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def newer_submission_reviewed_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def newer_submission_reviewed_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def newer_submission_reviewed_was; end + + sig { void } + def newer_submission_reviewed_will_change!; end + + sig { returns(T.nilable(::String)) } + def params_json; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def params_json=(value); end + + sig { returns(T::Boolean) } + def params_json?; end + + sig { returns(T.nilable(::String)) } + def params_json_before_last_save; end + + sig { returns(T.untyped) } + def params_json_before_type_cast; end + + sig { returns(T::Boolean) } + def params_json_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def params_json_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def params_json_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def params_json_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def params_json_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def params_json_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def params_json_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def params_json_previously_was; end + + sig { returns(T.nilable(::String)) } + def params_json_was; end + + sig { void } + def params_json_will_change!; end + + sig { returns(T::Boolean) } + def paste_available; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def paste_available=(value); end + + sig { returns(T::Boolean) } + def paste_available?; end + + sig { returns(T.nilable(T::Boolean)) } + def paste_available_before_last_save; end + + sig { returns(T.untyped) } + def paste_available_before_type_cast; end + + sig { returns(T::Boolean) } + def paste_available_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def paste_available_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def paste_available_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def paste_available_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def paste_available_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def paste_available_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def paste_available_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def paste_available_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def paste_available_was; end + + sig { void } + def paste_available_will_change!; end + + sig { returns(T.nilable(::String)) } + def paste_key; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def paste_key=(value); end + + sig { returns(T::Boolean) } + def paste_key?; end + + sig { returns(T.nilable(::String)) } + def paste_key_before_last_save; end + + sig { returns(T.untyped) } + def paste_key_before_type_cast; end + + sig { returns(T::Boolean) } + def paste_key_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def paste_key_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def paste_key_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def paste_key_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def paste_key_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def paste_key_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def paste_key_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def paste_key_previously_was; end + + sig { returns(T.nilable(::String)) } + def paste_key_was; end + + sig { void } + def paste_key_will_change!; end + + sig { returns(T.nilable(::String)) } + def points; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def points=(value); end + + sig { returns(T::Boolean) } + def points?; end + + sig { returns(T.nilable(::String)) } + def points_before_last_save; end + + sig { returns(T.untyped) } + def points_before_type_cast; end + + sig { returns(T::Boolean) } + def points_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def points_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def points_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def points_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def points_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def points_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def points_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def points_previously_was; end + + sig { returns(T.nilable(::String)) } + def points_was; end + + sig { void } + def points_will_change!; end + + sig { returns(T.nilable(::String)) } + def pretest_error; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def pretest_error=(value); end + + sig { returns(T::Boolean) } + def pretest_error?; end + + sig { returns(T.nilable(::String)) } + def pretest_error_before_last_save; end + + sig { returns(T.untyped) } + def pretest_error_before_type_cast; end + + sig { returns(T::Boolean) } + def pretest_error_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def pretest_error_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def pretest_error_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def pretest_error_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def pretest_error_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def pretest_error_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def pretest_error_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def pretest_error_previously_was; end + + sig { returns(T.nilable(::String)) } + def pretest_error_was; end + + sig { void } + def pretest_error_will_change!; end + + sig { returns(T::Boolean) } + def processed; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def processed=(value); end + + sig { returns(T::Boolean) } + def processed?; end + + sig { returns(T.nilable(T::Boolean)) } + def processed_before_last_save; end + + sig { returns(T.untyped) } + def processed_before_type_cast; end + + sig { returns(T::Boolean) } + def processed_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def processed_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def processed_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def processed_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def processed_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def processed_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def processed_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def processed_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def processed_was; end + + sig { void } + def processed_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_attempts_started_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_attempts_started_at=(value); end + + sig { returns(T::Boolean) } + def processing_attempts_started_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_attempts_started_at_before_last_save; end + + sig { returns(T.untyped) } + def processing_attempts_started_at_before_type_cast; end + + sig { returns(T::Boolean) } + def processing_attempts_started_at_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def processing_attempts_started_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def processing_attempts_started_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def processing_attempts_started_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_attempts_started_at_in_database; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def processing_attempts_started_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def processing_attempts_started_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_attempts_started_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_attempts_started_at_was; end + + sig { void } + def processing_attempts_started_at_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_began_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_began_at=(value); end + + sig { returns(T::Boolean) } + def processing_began_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_began_at_before_last_save; end + + sig { returns(T.untyped) } + def processing_began_at_before_type_cast; end + + sig { returns(T::Boolean) } + def processing_began_at_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def processing_began_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def processing_began_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def processing_began_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_began_at_in_database; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def processing_began_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def processing_began_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_began_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_began_at_was; end + + sig { void } + def processing_began_at_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_completed_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_completed_at=(value); end + + sig { returns(T::Boolean) } + def processing_completed_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_completed_at_before_last_save; end + + sig { returns(T.untyped) } + def processing_completed_at_before_type_cast; end + + sig { returns(T::Boolean) } + def processing_completed_at_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def processing_completed_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def processing_completed_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def processing_completed_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_completed_at_in_database; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def processing_completed_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def processing_completed_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_completed_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_completed_at_was; end + + sig { void } + def processing_completed_at_will_change!; end + + sig { returns(::Integer) } + def processing_priority; end + + sig { params(value: ::Integer).returns(::Integer) } + def processing_priority=(value); end + + sig { returns(T::Boolean) } + def processing_priority?; end + + sig { returns(T.nilable(::Integer)) } + def processing_priority_before_last_save; end + + sig { returns(T.untyped) } + def processing_priority_before_type_cast; end + + sig { returns(T::Boolean) } + def processing_priority_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def processing_priority_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def processing_priority_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def processing_priority_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def processing_priority_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def processing_priority_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def processing_priority_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def processing_priority_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def processing_priority_was; end + + sig { void } + def processing_priority_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_tried_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_tried_at=(value); end + + sig { returns(T::Boolean) } + def processing_tried_at?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_tried_at_before_last_save; end + + sig { returns(T.untyped) } + def processing_tried_at_before_type_cast; end + + sig { returns(T::Boolean) } + def processing_tried_at_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def processing_tried_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def processing_tried_at_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def processing_tried_at_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_tried_at_in_database; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def processing_tried_at_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def processing_tried_at_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_tried_at_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def processing_tried_at_was; end + + sig { void } + def processing_tried_at_will_change!; end + + sig { returns(T::Boolean) } + def requests_review; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def requests_review=(value); end + + sig { returns(T::Boolean) } + def requests_review?; end + + sig { returns(T.nilable(T::Boolean)) } + def requests_review_before_last_save; end + + sig { returns(T.untyped) } + def requests_review_before_type_cast; end + + sig { returns(T::Boolean) } + def requests_review_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def requests_review_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def requests_review_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def requests_review_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def requests_review_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def requests_review_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def requests_review_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def requests_review_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def requests_review_was; end + + sig { void } + def requests_review_will_change!; end + + sig { returns(T::Boolean) } + def requires_review; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def requires_review=(value); end + + sig { returns(T::Boolean) } + def requires_review?; end + + sig { returns(T.nilable(T::Boolean)) } + def requires_review_before_last_save; end + + sig { returns(T.untyped) } + def requires_review_before_type_cast; end + + sig { returns(T::Boolean) } + def requires_review_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def requires_review_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def requires_review_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def requires_review_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def requires_review_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def requires_review_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def requires_review_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def requires_review_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def requires_review_was; end + + sig { void } + def requires_review_will_change!; end + + sig { void } + def restore_all_tests_passed!; end + + sig { void } + def restore_client_ip!; end + + sig { void } + def restore_client_nanotime!; end + + sig { void } + def restore_client_time!; end + + sig { void } + def restore_course_id!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_exercise_name!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_message_for_paste!; end + + sig { void } + def restore_message_for_reviewer!; end + + sig { void } + def restore_newer_submission_reviewed!; end + + sig { void } + def restore_params_json!; end + + sig { void } + def restore_paste_available!; end + + sig { void } + def restore_paste_key!; end + + sig { void } + def restore_points!; end + + sig { void } + def restore_pretest_error!; end + + sig { void } + def restore_processed!; end + + sig { void } + def restore_processing_attempts_started_at!; end + + sig { void } + def restore_processing_began_at!; end + + sig { void } + def restore_processing_completed_at!; end + + sig { void } + def restore_processing_priority!; end + + sig { void } + def restore_processing_tried_at!; end + + sig { void } + def restore_requests_review!; end + + sig { void } + def restore_requires_review!; end + + sig { void } + def restore_review_dismissed!; end + + sig { void } + def restore_reviewed!; end + + sig { void } + def restore_sandbox!; end + + sig { void } + def restore_secret_token!; end + + sig { void } + def restore_times_sent_to_sandbox!; end + + sig { void } + def restore_updated_at!; end + + sig { void } + def restore_user_id!; end + + sig { returns(T::Boolean) } + def review_dismissed; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def review_dismissed=(value); end + + sig { returns(T::Boolean) } + def review_dismissed?; end + + sig { returns(T.nilable(T::Boolean)) } + def review_dismissed_before_last_save; end + + sig { returns(T.untyped) } + def review_dismissed_before_type_cast; end + + sig { returns(T::Boolean) } + def review_dismissed_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def review_dismissed_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def review_dismissed_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def review_dismissed_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def review_dismissed_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def review_dismissed_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def review_dismissed_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def review_dismissed_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def review_dismissed_was; end + + sig { void } + def review_dismissed_will_change!; end + + sig { returns(T::Boolean) } + def reviewed; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def reviewed=(value); end + + sig { returns(T::Boolean) } + def reviewed?; end + + sig { returns(T.nilable(T::Boolean)) } + def reviewed_before_last_save; end + + sig { returns(T.untyped) } + def reviewed_before_type_cast; end + + sig { returns(T::Boolean) } + def reviewed_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def reviewed_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def reviewed_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def reviewed_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def reviewed_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def reviewed_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def reviewed_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def reviewed_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def reviewed_was; end + + sig { void } + def reviewed_will_change!; end + + sig { returns(T.nilable(::String)) } + def sandbox; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def sandbox=(value); end + + sig { returns(T::Boolean) } + def sandbox?; end + + sig { returns(T.nilable(::String)) } + def sandbox_before_last_save; end + + sig { returns(T.untyped) } + def sandbox_before_type_cast; end + + sig { returns(T::Boolean) } + def sandbox_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def sandbox_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def sandbox_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def sandbox_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def sandbox_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def sandbox_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def sandbox_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def sandbox_previously_was; end + + sig { returns(T.nilable(::String)) } + def sandbox_was; end + + sig { void } + def sandbox_will_change!; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_all_tests_passed; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_all_tests_passed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_client_ip; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_client_ip?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_client_nanotime; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_client_nanotime?(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_client_time; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_client_time?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_course_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_course_id?(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_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([::String, ::String])) } + def saved_change_to_exercise_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_exercise_name?(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_message_for_paste; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_message_for_paste?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_message_for_reviewer; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_message_for_reviewer?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_newer_submission_reviewed; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_newer_submission_reviewed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_params_json; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_params_json?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_paste_available; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_paste_available?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_paste_key; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_paste_key?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_points; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_points?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_pretest_error; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_pretest_error?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_processed; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_processed?(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_processing_attempts_started_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_processing_attempts_started_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_processing_began_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_processing_began_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_processing_completed_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_processing_completed_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_processing_priority; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_processing_priority?(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_processing_tried_at; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_processing_tried_at?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_requests_review; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_requests_review?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_requires_review; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_requires_review?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_review_dismissed; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_review_dismissed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_reviewed; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_reviewed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_sandbox; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_sandbox?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_secret_token; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_secret_token?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_times_sent_to_sandbox; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_times_sent_to_sandbox?(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_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(::String)) } + def secret_token; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def secret_token=(value); end + + sig { returns(T::Boolean) } + def secret_token?; end + + sig { returns(T.nilable(::String)) } + def secret_token_before_last_save; end + + sig { returns(T.untyped) } + def secret_token_before_type_cast; end + + sig { returns(T::Boolean) } + def secret_token_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def secret_token_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def secret_token_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def secret_token_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def secret_token_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def secret_token_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def secret_token_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def secret_token_previously_was; end + + sig { returns(T.nilable(::String)) } + def secret_token_was; end + + sig { void } + def secret_token_will_change!; end + + sig { returns(::Integer) } + def times_sent_to_sandbox; end + + sig { params(value: ::Integer).returns(::Integer) } + def times_sent_to_sandbox=(value); end + + sig { returns(T::Boolean) } + def times_sent_to_sandbox?; end + + sig { returns(T.nilable(::Integer)) } + def times_sent_to_sandbox_before_last_save; end + + sig { returns(T.untyped) } + def times_sent_to_sandbox_before_type_cast; end + + sig { returns(T::Boolean) } + def times_sent_to_sandbox_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def times_sent_to_sandbox_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def times_sent_to_sandbox_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def times_sent_to_sandbox_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def times_sent_to_sandbox_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def times_sent_to_sandbox_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def times_sent_to_sandbox_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def times_sent_to_sandbox_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def times_sent_to_sandbox_was; end + + sig { void } + def times_sent_to_sandbox_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_all_tests_passed?(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_client_ip?(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_client_nanotime?(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_client_time?(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_course_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_exercise_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_message_for_paste?(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_message_for_reviewer?(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_newer_submission_reviewed?(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_params_json?(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_paste_available?(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_paste_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_points?(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_pretest_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_processed?(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_processing_attempts_started_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_processing_began_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_processing_completed_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_processing_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_processing_tried_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_requests_review?(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_requires_review?(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_review_dismissed?(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_reviewed?(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_sandbox?(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_secret_token?(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_times_sent_to_sandbox?(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 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: ::Submission).returns(BasicObject)).returns(T::Array[::Submission]) } + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Submission } } + + sig { returns(T::Array[::Submission]) } + def to_a; end + + sig { returns(T::Array[::Submission]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Submission } } + + 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: ::Submission } } + + 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: ::Submission } } + + sig do + params( + records: T.any(::Submission, T::Enumerable[T.any(::Submission, T::Enumerable[::Submission])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Submission, T::Enumerable[T.any(::Submission, T::Enumerable[::Submission])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Submission, T::Enumerable[T.any(::Submission, T::Enumerable[::Submission])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::Submission, Integer, String, T::Enumerable[T.any(::Submission, Integer, String, T::Enumerable[::Submission])]) + ).returns(T::Array[::Submission]) + end + def delete(*records); end + + sig do + params( + records: T.any(::Submission, Integer, String, T::Enumerable[T.any(::Submission, Integer, String, T::Enumerable[::Submission])]) + ).returns(T::Array[::Submission]) + end + def destroy(*records); end + + sig { returns(T::Array[::Submission]) } + def load_target; end + + sig do + params( + records: T.any(::Submission, T::Enumerable[T.any(::Submission, T::Enumerable[::Submission])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Submission, T::Enumerable[T.any(::Submission, T::Enumerable[::Submission])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Submission, T::Enumerable[T.any(::Submission, T::Enumerable[::Submission])]) + ).returns(T::Array[::Submission]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Submission]) } + def target; end + + sig { returns(T::Array[::Submission]) } + def to_a; end + + sig { returns(T::Array[::Submission]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Submission } } + + sig { returns(T::Array[::Submission]) } + def to_a; end + + sig { returns(T::Array[::Submission]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Submission } } + + 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: ::Submission } } + + 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/submission_data.rbi b/sorbet/rbi/dsl/submission_data.rbi new file mode 100644 index 000000000..2ba569e6e --- /dev/null +++ b/sorbet/rbi/dsl/submission_data.rbi @@ -0,0 +1,1387 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `SubmissionData`. +# Please instead update this file by running `bin/tapioca dsl SubmissionData`. + + +class SubmissionData + 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: ::SubmissionData).void) + ).returns(::SubmissionData) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::SubmissionData).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: ::SubmissionData).void)).returns(::SubmissionData) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SubmissionData).void) + ).returns(T::Array[::SubmissionData]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SubmissionData).void) + ).returns(::SubmissionData) + 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: ::SubmissionData).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::SubmissionData).void)).returns(::SubmissionData) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SubmissionData).void) + ).returns(T::Array[::SubmissionData]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SubmissionData).void) + ).returns(::SubmissionData) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::SubmissionData).void)).returns(::SubmissionData) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SubmissionData).void) + ).returns(T::Array[::SubmissionData]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SubmissionData).void) + ).returns(::SubmissionData) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SubmissionData).void) + ).returns(T::Array[::SubmissionData]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SubmissionData).void) + ).returns(::SubmissionData) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SubmissionData).void) + ).returns(T::Array[::SubmissionData]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SubmissionData).void) + ).returns(::SubmissionData) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::SubmissionData]) } + def destroy_all; end + + sig { returns(T::Array[::SubmissionData]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::SubmissionData]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::SubmissionData)) } + def fifth; end + + sig { returns(::SubmissionData) } + 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(::SubmissionData) + 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[::SubmissionData]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::SubmissionData).void + ).returns(T.nilable(::SubmissionData)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::SubmissionData)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::SubmissionData) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::SubmissionData).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::SubmissionData]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::SubmissionData]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::SubmissionData]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SubmissionData).void) + ).returns(T::Array[::SubmissionData]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SubmissionData).void) + ).returns(::SubmissionData) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SubmissionData).void) + ).returns(T::Array[::SubmissionData]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SubmissionData).void) + ).returns(::SubmissionData) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SubmissionData).void) + ).returns(T::Array[::SubmissionData]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SubmissionData).void) + ).returns(::SubmissionData) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::SubmissionData)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::SubmissionData) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::SubmissionData) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::SubmissionData)) } + sig { params(limit: Integer).returns(T::Array[::SubmissionData]) } + def first(limit = nil); end + + sig { returns(::SubmissionData) } + def first!; end + + sig { returns(T.nilable(::SubmissionData)) } + def forty_two; end + + sig { returns(::SubmissionData) } + def forty_two!; end + + sig { returns(T.nilable(::SubmissionData)) } + def fourth; end + + sig { returns(::SubmissionData) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::SubmissionData)) } + sig { params(limit: Integer).returns(T::Array[::SubmissionData]) } + def last(limit = nil); end + + sig { returns(::SubmissionData) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::SubmissionData).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: ::SubmissionData).void)).returns(::SubmissionData) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::SubmissionData).void) + ).returns(T::Array[::SubmissionData]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::SubmissionData).void) + ).returns(::SubmissionData) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::SubmissionData).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::SubmissionData).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(::SubmissionData)) } + def second; end + + sig { returns(::SubmissionData) } + def second!; end + + sig { returns(T.nilable(::SubmissionData)) } + def second_to_last; end + + sig { returns(::SubmissionData) } + def second_to_last!; end + + sig { returns(::SubmissionData) } + 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: ::SubmissionData).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::SubmissionData)) } + sig { params(limit: Integer).returns(T::Array[::SubmissionData]) } + def take(limit = nil); end + + sig { returns(::SubmissionData) } + def take!; end + + sig { returns(T.nilable(::SubmissionData)) } + def third; end + + sig { returns(::SubmissionData) } + def third!; end + + sig { returns(T.nilable(::SubmissionData)) } + def third_to_last; end + + sig { returns(::SubmissionData) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Submission) } + def build_submission(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Submission) } + def create_submission(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Submission) } + def create_submission!(*args, &blk); end + + sig { returns(T.nilable(::Submission)) } + def reload_submission; end + + sig { void } + def reset_submission; end + + sig { returns(T.nilable(::Submission)) } + def submission; end + + sig { params(value: T.nilable(::Submission)).void } + def submission=(value); end + + sig { returns(T::Boolean) } + def submission_changed?; end + + sig { returns(T::Boolean) } + def submission_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 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: ::SubmissionData).returns(BasicObject) + ).returns(T::Array[::SubmissionData]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 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(T.nilable(::Integer)) } + def id_was; end + + sig { void } + def id_will_change!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_return_file!; end + + sig { void } + def restore_stderr_compressed!; end + + sig { void } + def restore_stdout_compressed!; end + + sig { void } + def restore_submission_id!; end + + sig { void } + def restore_valgrind_compressed!; end + + sig { void } + def restore_validations_compressed!; end + + sig { void } + def restore_vm_log_compressed!; end + + sig { returns(T.nilable(::String)) } + def return_file; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def return_file=(value); end + + sig { returns(T::Boolean) } + def return_file?; end + + sig { returns(T.nilable(::String)) } + def return_file_before_last_save; end + + sig { returns(T.untyped) } + def return_file_before_type_cast; end + + sig { returns(T::Boolean) } + def return_file_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def return_file_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def return_file_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def return_file_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def return_file_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def return_file_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def return_file_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def return_file_previously_was; end + + sig { returns(T.nilable(::String)) } + def return_file_was; end + + sig { void } + def return_file_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([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_return_file; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_return_file?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_stderr_compressed; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_stderr_compressed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_stdout_compressed; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_stdout_compressed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_submission_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_submission_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_valgrind_compressed; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_valgrind_compressed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_validations_compressed; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_validations_compressed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_vm_log_compressed; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_vm_log_compressed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def stderr_compressed; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def stderr_compressed=(value); end + + sig { returns(T::Boolean) } + def stderr_compressed?; end + + sig { returns(T.nilable(::String)) } + def stderr_compressed_before_last_save; end + + sig { returns(T.untyped) } + def stderr_compressed_before_type_cast; end + + sig { returns(T::Boolean) } + def stderr_compressed_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def stderr_compressed_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def stderr_compressed_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def stderr_compressed_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def stderr_compressed_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def stderr_compressed_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def stderr_compressed_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def stderr_compressed_previously_was; end + + sig { returns(T.nilable(::String)) } + def stderr_compressed_was; end + + sig { void } + def stderr_compressed_will_change!; end + + sig { returns(T.nilable(::String)) } + def stdout_compressed; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def stdout_compressed=(value); end + + sig { returns(T::Boolean) } + def stdout_compressed?; end + + sig { returns(T.nilable(::String)) } + def stdout_compressed_before_last_save; end + + sig { returns(T.untyped) } + def stdout_compressed_before_type_cast; end + + sig { returns(T::Boolean) } + def stdout_compressed_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def stdout_compressed_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def stdout_compressed_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def stdout_compressed_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def stdout_compressed_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def stdout_compressed_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def stdout_compressed_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def stdout_compressed_previously_was; end + + sig { returns(T.nilable(::String)) } + def stdout_compressed_was; end + + sig { void } + def stdout_compressed_will_change!; end + + sig { returns(::Integer) } + def submission_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def submission_id=(value); end + + sig { returns(T::Boolean) } + def submission_id?; end + + sig { returns(T.nilable(::Integer)) } + def submission_id_before_last_save; end + + sig { returns(T.untyped) } + def submission_id_before_type_cast; end + + sig { returns(T::Boolean) } + def submission_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def submission_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def submission_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def submission_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def submission_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def submission_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def submission_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def submission_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def submission_id_was; end + + sig { void } + def submission_id_will_change!; end + + sig { returns(T.nilable(::String)) } + def valgrind_compressed; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def valgrind_compressed=(value); end + + sig { returns(T::Boolean) } + def valgrind_compressed?; end + + sig { returns(T.nilable(::String)) } + def valgrind_compressed_before_last_save; end + + sig { returns(T.untyped) } + def valgrind_compressed_before_type_cast; end + + sig { returns(T::Boolean) } + def valgrind_compressed_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def valgrind_compressed_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def valgrind_compressed_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def valgrind_compressed_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def valgrind_compressed_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def valgrind_compressed_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def valgrind_compressed_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def valgrind_compressed_previously_was; end + + sig { returns(T.nilable(::String)) } + def valgrind_compressed_was; end + + sig { void } + def valgrind_compressed_will_change!; end + + sig { returns(T.nilable(::String)) } + def validations_compressed; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def validations_compressed=(value); end + + sig { returns(T::Boolean) } + def validations_compressed?; end + + sig { returns(T.nilable(::String)) } + def validations_compressed_before_last_save; end + + sig { returns(T.untyped) } + def validations_compressed_before_type_cast; end + + sig { returns(T::Boolean) } + def validations_compressed_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def validations_compressed_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def validations_compressed_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def validations_compressed_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def validations_compressed_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def validations_compressed_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def validations_compressed_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def validations_compressed_previously_was; end + + sig { returns(T.nilable(::String)) } + def validations_compressed_was; end + + sig { void } + def validations_compressed_will_change!; end + + sig { returns(T.nilable(::String)) } + def vm_log_compressed; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def vm_log_compressed=(value); end + + sig { returns(T::Boolean) } + def vm_log_compressed?; end + + sig { returns(T.nilable(::String)) } + def vm_log_compressed_before_last_save; end + + sig { returns(T.untyped) } + def vm_log_compressed_before_type_cast; end + + sig { returns(T::Boolean) } + def vm_log_compressed_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def vm_log_compressed_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def vm_log_compressed_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def vm_log_compressed_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def vm_log_compressed_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def vm_log_compressed_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def vm_log_compressed_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def vm_log_compressed_previously_was; end + + sig { returns(T.nilable(::String)) } + def vm_log_compressed_was; end + + sig { void } + def vm_log_compressed_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_return_file?(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_stderr_compressed?(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_stdout_compressed?(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_submission_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_valgrind_compressed?(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_validations_compressed?(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_vm_log_compressed?(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 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: ::SubmissionData).returns(BasicObject) + ).returns(T::Array[::SubmissionData]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::SubmissionData } } + + sig { returns(T::Array[::SubmissionData]) } + def to_a; end + + sig { returns(T::Array[::SubmissionData]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::SubmissionData } } + + 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: ::SubmissionData } } + + 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: ::SubmissionData } } + + sig do + params( + records: T.any(::SubmissionData, T::Enumerable[T.any(::SubmissionData, T::Enumerable[::SubmissionData])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::SubmissionData, T::Enumerable[T.any(::SubmissionData, T::Enumerable[::SubmissionData])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::SubmissionData, T::Enumerable[T.any(::SubmissionData, T::Enumerable[::SubmissionData])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::SubmissionData, Integer, String, T::Enumerable[T.any(::SubmissionData, Integer, String, T::Enumerable[::SubmissionData])]) + ).returns(T::Array[::SubmissionData]) + end + def delete(*records); end + + sig do + params( + records: T.any(::SubmissionData, Integer, String, T::Enumerable[T.any(::SubmissionData, Integer, String, T::Enumerable[::SubmissionData])]) + ).returns(T::Array[::SubmissionData]) + end + def destroy(*records); end + + sig { returns(T::Array[::SubmissionData]) } + def load_target; end + + sig do + params( + records: T.any(::SubmissionData, T::Enumerable[T.any(::SubmissionData, T::Enumerable[::SubmissionData])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::SubmissionData, T::Enumerable[T.any(::SubmissionData, T::Enumerable[::SubmissionData])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::SubmissionData, T::Enumerable[T.any(::SubmissionData, T::Enumerable[::SubmissionData])]) + ).returns(T::Array[::SubmissionData]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::SubmissionData]) } + def target; end + + sig { returns(T::Array[::SubmissionData]) } + def to_a; end + + sig { returns(T::Array[::SubmissionData]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::SubmissionData } } + + sig { returns(T::Array[::SubmissionData]) } + def to_a; end + + sig { returns(T::Array[::SubmissionData]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::SubmissionData } } + + 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: ::SubmissionData } } + + 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/teachership.rbi b/sorbet/rbi/dsl/teachership.rbi new file mode 100644 index 000000000..13c5a8695 --- /dev/null +++ b/sorbet/rbi/dsl/teachership.rbi @@ -0,0 +1,1287 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Teachership`. +# Please instead update this file by running `bin/tapioca dsl Teachership`. + + +class Teachership + 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: ::Teachership).void) + ).returns(::Teachership) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::Teachership).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: ::Teachership).void)).returns(::Teachership) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Teachership).void) + ).returns(T::Array[::Teachership]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Teachership).void) + ).returns(::Teachership) + 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: ::Teachership).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Teachership).void)).returns(::Teachership) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Teachership).void) + ).returns(T::Array[::Teachership]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Teachership).void) + ).returns(::Teachership) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Teachership).void)).returns(::Teachership) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Teachership).void) + ).returns(T::Array[::Teachership]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Teachership).void) + ).returns(::Teachership) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Teachership).void) + ).returns(T::Array[::Teachership]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Teachership).void) + ).returns(::Teachership) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Teachership).void) + ).returns(T::Array[::Teachership]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Teachership).void) + ).returns(::Teachership) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::Teachership]) } + def destroy_all; end + + sig { returns(T::Array[::Teachership]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Teachership]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Teachership)) } + def fifth; end + + sig { returns(::Teachership) } + 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(::Teachership) + 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[::Teachership]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::Teachership).void).returns(T.nilable(::Teachership)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Teachership)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Teachership) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::Teachership).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::Teachership]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::Teachership]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::Teachership]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Teachership).void) + ).returns(T::Array[::Teachership]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Teachership).void) + ).returns(::Teachership) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Teachership).void) + ).returns(T::Array[::Teachership]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Teachership).void) + ).returns(::Teachership) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Teachership).void) + ).returns(T::Array[::Teachership]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Teachership).void) + ).returns(::Teachership) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Teachership)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Teachership) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Teachership) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Teachership)) } + sig { params(limit: Integer).returns(T::Array[::Teachership]) } + def first(limit = nil); end + + sig { returns(::Teachership) } + def first!; end + + sig { returns(T.nilable(::Teachership)) } + def forty_two; end + + sig { returns(::Teachership) } + def forty_two!; end + + sig { returns(T.nilable(::Teachership)) } + def fourth; end + + sig { returns(::Teachership) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::Teachership)) } + sig { params(limit: Integer).returns(T::Array[::Teachership]) } + def last(limit = nil); end + + sig { returns(::Teachership) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::Teachership).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: ::Teachership).void)).returns(::Teachership) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Teachership).void) + ).returns(T::Array[::Teachership]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::Teachership).void) + ).returns(::Teachership) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Teachership).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Teachership).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(::Teachership)) } + def second; end + + sig { returns(::Teachership) } + def second!; end + + sig { returns(T.nilable(::Teachership)) } + def second_to_last; end + + sig { returns(::Teachership) } + def second_to_last!; end + + sig { returns(::Teachership) } + 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: ::Teachership).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Teachership)) } + sig { params(limit: Integer).returns(T::Array[::Teachership]) } + def take(limit = nil); end + + sig { returns(::Teachership) } + def take!; end + + sig { returns(T.nilable(::Teachership)) } + def third; end + + sig { returns(::Teachership) } + def third!; end + + sig { returns(T.nilable(::Teachership)) } + def third_to_last; end + + sig { returns(::Teachership) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Organization) } + def build_organization(*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(::Organization) } + def create_organization(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Organization) } + def create_organization!(*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(::Organization)) } + def organization; end + + sig { params(value: T.nilable(::Organization)).void } + def organization=(value); end + + sig { returns(T::Boolean) } + def organization_changed?; end + + sig { returns(T::Boolean) } + def organization_previously_changed?; end + + sig { returns(T.nilable(::Organization)) } + def reload_organization; end + + sig { returns(T.nilable(::User)) } + def reload_user; end + + sig { void } + def reset_organization; 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 { 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 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: ::Teachership).returns(BasicObject)).returns(T::Array[::Teachership]) } + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 organization_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def organization_id=(value); end + + sig { returns(T::Boolean) } + def organization_id?; end + + sig { returns(T.nilable(::Integer)) } + def organization_id_before_last_save; end + + sig { returns(T.untyped) } + def organization_id_before_type_cast; end + + sig { returns(T::Boolean) } + def organization_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def organization_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def organization_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def organization_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def organization_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def organization_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def organization_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def organization_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def organization_id_was; end + + sig { void } + def organization_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_organization_id!; end + + sig { void } + def restore_updated_at!; end + + sig { void } + def restore_user_id!; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_organization_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_organization_id?(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_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(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_organization_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 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: ::Teachership).returns(BasicObject)).returns(T::Array[::Teachership]) } + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Teachership } } + + sig { returns(T::Array[::Teachership]) } + def to_a; end + + sig { returns(T::Array[::Teachership]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Teachership } } + + 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: ::Teachership } } + + 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: ::Teachership } } + + sig do + params( + records: T.any(::Teachership, T::Enumerable[T.any(::Teachership, T::Enumerable[::Teachership])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Teachership, T::Enumerable[T.any(::Teachership, T::Enumerable[::Teachership])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Teachership, T::Enumerable[T.any(::Teachership, T::Enumerable[::Teachership])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::Teachership, Integer, String, T::Enumerable[T.any(::Teachership, Integer, String, T::Enumerable[::Teachership])]) + ).returns(T::Array[::Teachership]) + end + def delete(*records); end + + sig do + params( + records: T.any(::Teachership, Integer, String, T::Enumerable[T.any(::Teachership, Integer, String, T::Enumerable[::Teachership])]) + ).returns(T::Array[::Teachership]) + end + def destroy(*records); end + + sig { returns(T::Array[::Teachership]) } + def load_target; end + + sig do + params( + records: T.any(::Teachership, T::Enumerable[T.any(::Teachership, T::Enumerable[::Teachership])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Teachership, T::Enumerable[T.any(::Teachership, T::Enumerable[::Teachership])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Teachership, T::Enumerable[T.any(::Teachership, T::Enumerable[::Teachership])]) + ).returns(T::Array[::Teachership]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Teachership]) } + def target; end + + sig { returns(T::Array[::Teachership]) } + def to_a; end + + sig { returns(T::Array[::Teachership]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Teachership } } + + sig { returns(T::Array[::Teachership]) } + def to_a; end + + sig { returns(T::Array[::Teachership]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Teachership } } + + 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: ::Teachership } } + + 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/test_case_run.rbi b/sorbet/rbi/dsl/test_case_run.rbi new file mode 100644 index 000000000..18c592a16 --- /dev/null +++ b/sorbet/rbi/dsl/test_case_run.rbi @@ -0,0 +1,1488 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `TestCaseRun`. +# Please instead update this file by running `bin/tapioca dsl TestCaseRun`. + + +class TestCaseRun + 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: ::TestCaseRun).void) + ).returns(::TestCaseRun) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::TestCaseRun).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: ::TestCaseRun).void)).returns(::TestCaseRun) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::TestCaseRun).void) + ).returns(T::Array[::TestCaseRun]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::TestCaseRun).void) + ).returns(::TestCaseRun) + 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: ::TestCaseRun).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::TestCaseRun).void)).returns(::TestCaseRun) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::TestCaseRun).void) + ).returns(T::Array[::TestCaseRun]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::TestCaseRun).void) + ).returns(::TestCaseRun) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::TestCaseRun).void)).returns(::TestCaseRun) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::TestCaseRun).void) + ).returns(T::Array[::TestCaseRun]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::TestCaseRun).void) + ).returns(::TestCaseRun) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::TestCaseRun).void) + ).returns(T::Array[::TestCaseRun]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::TestCaseRun).void) + ).returns(::TestCaseRun) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::TestCaseRun).void) + ).returns(T::Array[::TestCaseRun]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::TestCaseRun).void) + ).returns(::TestCaseRun) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::TestCaseRun]) } + def destroy_all; end + + sig { returns(T::Array[::TestCaseRun]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::TestCaseRun]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::TestCaseRun)) } + def fifth; end + + sig { returns(::TestCaseRun) } + 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(::TestCaseRun) + 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[::TestCaseRun]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::TestCaseRun).void).returns(T.nilable(::TestCaseRun)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::TestCaseRun)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::TestCaseRun) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::TestCaseRun).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::TestCaseRun]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::TestCaseRun]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::TestCaseRun]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::TestCaseRun).void) + ).returns(T::Array[::TestCaseRun]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::TestCaseRun).void) + ).returns(::TestCaseRun) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::TestCaseRun).void) + ).returns(T::Array[::TestCaseRun]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::TestCaseRun).void) + ).returns(::TestCaseRun) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::TestCaseRun).void) + ).returns(T::Array[::TestCaseRun]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::TestCaseRun).void) + ).returns(::TestCaseRun) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::TestCaseRun)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::TestCaseRun) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::TestCaseRun) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::TestCaseRun)) } + sig { params(limit: Integer).returns(T::Array[::TestCaseRun]) } + def first(limit = nil); end + + sig { returns(::TestCaseRun) } + def first!; end + + sig { returns(T.nilable(::TestCaseRun)) } + def forty_two; end + + sig { returns(::TestCaseRun) } + def forty_two!; end + + sig { returns(T.nilable(::TestCaseRun)) } + def fourth; end + + sig { returns(::TestCaseRun) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::TestCaseRun)) } + sig { params(limit: Integer).returns(T::Array[::TestCaseRun]) } + def last(limit = nil); end + + sig { returns(::TestCaseRun) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::TestCaseRun).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: ::TestCaseRun).void)).returns(::TestCaseRun) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::TestCaseRun).void) + ).returns(T::Array[::TestCaseRun]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::TestCaseRun).void) + ).returns(::TestCaseRun) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::TestCaseRun).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::TestCaseRun).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(::TestCaseRun)) } + def second; end + + sig { returns(::TestCaseRun) } + def second!; end + + sig { returns(T.nilable(::TestCaseRun)) } + def second_to_last; end + + sig { returns(::TestCaseRun) } + def second_to_last!; end + + sig { returns(::TestCaseRun) } + 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: ::TestCaseRun).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::TestCaseRun)) } + sig { params(limit: Integer).returns(T::Array[::TestCaseRun]) } + def take(limit = nil); end + + sig { returns(::TestCaseRun) } + def take!; end + + sig { returns(T.nilable(::TestCaseRun)) } + def third; end + + sig { returns(::TestCaseRun) } + def third!; end + + sig { returns(T.nilable(::TestCaseRun)) } + def third_to_last; end + + sig { returns(::TestCaseRun) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Submission) } + def build_submission(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Submission) } + def create_submission(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Submission) } + def create_submission!(*args, &blk); end + + sig { returns(T.nilable(::Submission)) } + def reload_submission; end + + sig { void } + def reset_submission; end + + sig { returns(T.nilable(::Submission)) } + def submission; end + + sig { params(value: T.nilable(::Submission)).void } + def submission=(value); end + + sig { returns(T::Boolean) } + def submission_changed?; end + + sig { returns(T::Boolean) } + def submission_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 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: ::TestCaseRun).returns(BasicObject)).returns(T::Array[::TestCaseRun]) } + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 detailed_message; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def detailed_message=(value); end + + sig { returns(T::Boolean) } + def detailed_message?; end + + sig { returns(T.nilable(::String)) } + def detailed_message_before_last_save; end + + sig { returns(T.untyped) } + def detailed_message_before_type_cast; end + + sig { returns(T::Boolean) } + def detailed_message_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def detailed_message_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def detailed_message_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def detailed_message_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def detailed_message_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def detailed_message_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def detailed_message_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def detailed_message_previously_was; end + + sig { returns(T.nilable(::String)) } + def detailed_message_was; end + + sig { void } + def detailed_message_will_change!; end + + sig { returns(T.nilable(::String)) } + def exception; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def exception=(value); end + + sig { returns(T::Boolean) } + def exception?; end + + sig { returns(T.nilable(::String)) } + def exception_before_last_save; end + + sig { returns(T.untyped) } + def exception_before_type_cast; end + + sig { returns(T::Boolean) } + def exception_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def exception_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def exception_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def exception_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def exception_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def exception_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def exception_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def exception_previously_was; end + + sig { returns(T.nilable(::String)) } + def exception_was; end + + sig { void } + def exception_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 message; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def message=(value); end + + sig { returns(T::Boolean) } + def message?; end + + sig { returns(T.nilable(::String)) } + def message_before_last_save; end + + sig { returns(T.untyped) } + def message_before_type_cast; end + + sig { returns(T::Boolean) } + def message_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def message_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def message_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def message_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def message_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def message_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def message_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def message_previously_was; end + + sig { returns(T.nilable(::String)) } + def message_was; end + + sig { void } + def message_will_change!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_detailed_message!; end + + sig { void } + def restore_exception!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_message!; end + + sig { void } + def restore_submission_id!; end + + sig { void } + def restore_successful!; end + + sig { void } + def restore_test_case_name!; end + + sig { void } + def restore_updated_at!; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_detailed_message; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_detailed_message?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_exception; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_exception?(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_message; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_message?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def saved_change_to_submission_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_submission_id?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def saved_change_to_successful; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_successful?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_test_case_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_test_case_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_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)) } + def submission_id; end + + sig { params(value: T.nilable(::Integer)).returns(T.nilable(::Integer)) } + def submission_id=(value); end + + sig { returns(T::Boolean) } + def submission_id?; end + + sig { returns(T.nilable(::Integer)) } + def submission_id_before_last_save; end + + sig { returns(T.untyped) } + def submission_id_before_type_cast; end + + sig { returns(T::Boolean) } + def submission_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def submission_id_change; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def submission_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def submission_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def submission_id_in_database; end + + sig { returns(T.nilable([T.nilable(::Integer), T.nilable(::Integer)])) } + def submission_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def submission_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def submission_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def submission_id_was; end + + sig { void } + def submission_id_will_change!; end + + sig { returns(T.nilable(T::Boolean)) } + def successful; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def successful=(value); end + + sig { returns(T::Boolean) } + def successful?; end + + sig { returns(T.nilable(T::Boolean)) } + def successful_before_last_save; end + + sig { returns(T.untyped) } + def successful_before_type_cast; end + + sig { returns(T::Boolean) } + def successful_came_from_user?; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def successful_change; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def successful_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def successful_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def successful_in_database; end + + sig { returns(T.nilable([T.nilable(T::Boolean), T.nilable(T::Boolean)])) } + def successful_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def successful_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def successful_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def successful_was; end + + sig { void } + def successful_will_change!; end + + sig { returns(T.nilable(::String)) } + def test_case_name; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def test_case_name=(value); end + + sig { returns(T::Boolean) } + def test_case_name?; end + + sig { returns(T.nilable(::String)) } + def test_case_name_before_last_save; end + + sig { returns(T.untyped) } + def test_case_name_before_type_cast; end + + sig { returns(T::Boolean) } + def test_case_name_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def test_case_name_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def test_case_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def test_case_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def test_case_name_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def test_case_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def test_case_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def test_case_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def test_case_name_was; end + + sig { void } + def test_case_name_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_detailed_message?(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_exception?(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_message?(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_submission_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_successful?(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_test_case_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 { 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 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: ::TestCaseRun).returns(BasicObject)).returns(T::Array[::TestCaseRun]) } + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::TestCaseRun } } + + sig { returns(T::Array[::TestCaseRun]) } + def to_a; end + + sig { returns(T::Array[::TestCaseRun]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::TestCaseRun } } + + 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: ::TestCaseRun } } + + 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: ::TestCaseRun } } + + sig do + params( + records: T.any(::TestCaseRun, T::Enumerable[T.any(::TestCaseRun, T::Enumerable[::TestCaseRun])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::TestCaseRun, T::Enumerable[T.any(::TestCaseRun, T::Enumerable[::TestCaseRun])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::TestCaseRun, T::Enumerable[T.any(::TestCaseRun, T::Enumerable[::TestCaseRun])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::TestCaseRun, Integer, String, T::Enumerable[T.any(::TestCaseRun, Integer, String, T::Enumerable[::TestCaseRun])]) + ).returns(T::Array[::TestCaseRun]) + end + def delete(*records); end + + sig do + params( + records: T.any(::TestCaseRun, Integer, String, T::Enumerable[T.any(::TestCaseRun, Integer, String, T::Enumerable[::TestCaseRun])]) + ).returns(T::Array[::TestCaseRun]) + end + def destroy(*records); end + + sig { returns(T::Array[::TestCaseRun]) } + def load_target; end + + sig do + params( + records: T.any(::TestCaseRun, T::Enumerable[T.any(::TestCaseRun, T::Enumerable[::TestCaseRun])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::TestCaseRun, T::Enumerable[T.any(::TestCaseRun, T::Enumerable[::TestCaseRun])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::TestCaseRun, T::Enumerable[T.any(::TestCaseRun, T::Enumerable[::TestCaseRun])]) + ).returns(T::Array[::TestCaseRun]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::TestCaseRun]) } + def target; end + + sig { returns(T::Array[::TestCaseRun]) } + def to_a; end + + sig { returns(T::Array[::TestCaseRun]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::TestCaseRun } } + + sig { returns(T::Array[::TestCaseRun]) } + def to_a; end + + sig { returns(T::Array[::TestCaseRun]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::TestCaseRun } } + + 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: ::TestCaseRun } } + + 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 000000000..8b24b5752 --- /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/uncomputed_unlock.rbi b/sorbet/rbi/dsl/uncomputed_unlock.rbi new file mode 100644 index 000000000..615e9f9e0 --- /dev/null +++ b/sorbet/rbi/dsl/uncomputed_unlock.rbi @@ -0,0 +1,1300 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `UncomputedUnlock`. +# Please instead update this file by running `bin/tapioca dsl UncomputedUnlock`. + + +class UncomputedUnlock + 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: ::UncomputedUnlock).void) + ).returns(::UncomputedUnlock) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::UncomputedUnlock).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: ::UncomputedUnlock).void)).returns(::UncomputedUnlock) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void) + ).returns(T::Array[::UncomputedUnlock]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void) + ).returns(::UncomputedUnlock) + 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: ::UncomputedUnlock).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void)).returns(::UncomputedUnlock) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void) + ).returns(T::Array[::UncomputedUnlock]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void) + ).returns(::UncomputedUnlock) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void)).returns(::UncomputedUnlock) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void) + ).returns(T::Array[::UncomputedUnlock]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void) + ).returns(::UncomputedUnlock) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void) + ).returns(T::Array[::UncomputedUnlock]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void) + ).returns(::UncomputedUnlock) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void) + ).returns(T::Array[::UncomputedUnlock]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void) + ).returns(::UncomputedUnlock) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::UncomputedUnlock]) } + def destroy_all; end + + sig { returns(T::Array[::UncomputedUnlock]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::UncomputedUnlock]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::UncomputedUnlock)) } + def fifth; end + + sig { returns(::UncomputedUnlock) } + 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(::UncomputedUnlock) + 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[::UncomputedUnlock]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::UncomputedUnlock).void + ).returns(T.nilable(::UncomputedUnlock)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::UncomputedUnlock)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::UncomputedUnlock) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::UncomputedUnlock).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::UncomputedUnlock]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::UncomputedUnlock]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::UncomputedUnlock]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void) + ).returns(T::Array[::UncomputedUnlock]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void) + ).returns(::UncomputedUnlock) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void) + ).returns(T::Array[::UncomputedUnlock]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void) + ).returns(::UncomputedUnlock) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void) + ).returns(T::Array[::UncomputedUnlock]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void) + ).returns(::UncomputedUnlock) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::UncomputedUnlock)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::UncomputedUnlock) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::UncomputedUnlock) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::UncomputedUnlock)) } + sig { params(limit: Integer).returns(T::Array[::UncomputedUnlock]) } + def first(limit = nil); end + + sig { returns(::UncomputedUnlock) } + def first!; end + + sig { returns(T.nilable(::UncomputedUnlock)) } + def forty_two; end + + sig { returns(::UncomputedUnlock) } + def forty_two!; end + + sig { returns(T.nilable(::UncomputedUnlock)) } + def fourth; end + + sig { returns(::UncomputedUnlock) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::UncomputedUnlock)) } + sig { params(limit: Integer).returns(T::Array[::UncomputedUnlock]) } + def last(limit = nil); end + + sig { returns(::UncomputedUnlock) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::UncomputedUnlock).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: ::UncomputedUnlock).void)).returns(::UncomputedUnlock) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void) + ).returns(T::Array[::UncomputedUnlock]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UncomputedUnlock).void) + ).returns(::UncomputedUnlock) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::UncomputedUnlock).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::UncomputedUnlock).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(::UncomputedUnlock)) } + def second; end + + sig { returns(::UncomputedUnlock) } + def second!; end + + sig { returns(T.nilable(::UncomputedUnlock)) } + def second_to_last; end + + sig { returns(::UncomputedUnlock) } + def second_to_last!; end + + sig { returns(::UncomputedUnlock) } + 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: ::UncomputedUnlock).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::UncomputedUnlock)) } + sig { params(limit: Integer).returns(T::Array[::UncomputedUnlock]) } + def take(limit = nil); end + + sig { returns(::UncomputedUnlock) } + def take!; end + + sig { returns(T.nilable(::UncomputedUnlock)) } + def third; end + + sig { returns(::UncomputedUnlock) } + def third!; end + + sig { returns(T.nilable(::UncomputedUnlock)) } + def third_to_last; end + + sig { returns(::UncomputedUnlock) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def build_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def build_user(*args, &blk); end + + sig { returns(T.nilable(::Course)) } + def course; end + + sig { params(value: T.nilable(::Course)).void } + def course=(value); end + + sig { returns(T::Boolean) } + def course_changed?; end + + sig { returns(T::Boolean) } + def course_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course!(*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(::Course)) } + def reload_course; end + + sig { returns(T.nilable(::User)) } + def reload_user; end + + sig { void } + def reset_course; 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 { 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 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: ::UncomputedUnlock).returns(BasicObject) + ).returns(T::Array[::UncomputedUnlock]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::Integer) } + def course_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def course_id=(value); end + + sig { returns(T::Boolean) } + def course_id?; end + + sig { returns(T.nilable(::Integer)) } + def course_id_before_last_save; end + + sig { returns(T.untyped) } + def course_id_before_type_cast; end + + sig { returns(T::Boolean) } + def course_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def course_id_was; end + + sig { void } + def course_id_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 { void } + def restore_course_id!; 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_updated_at!; end + + sig { void } + def restore_user_id!; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_course_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_course_id?(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_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(::ActiveSupport::TimeWithZone), T.nilable(::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_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(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 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_course_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_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 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: ::UncomputedUnlock).returns(BasicObject) + ).returns(T::Array[::UncomputedUnlock]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::UncomputedUnlock } } + + sig { returns(T::Array[::UncomputedUnlock]) } + def to_a; end + + sig { returns(T::Array[::UncomputedUnlock]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::UncomputedUnlock } } + + 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: ::UncomputedUnlock } } + + 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: ::UncomputedUnlock } } + + sig do + params( + records: T.any(::UncomputedUnlock, T::Enumerable[T.any(::UncomputedUnlock, T::Enumerable[::UncomputedUnlock])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::UncomputedUnlock, T::Enumerable[T.any(::UncomputedUnlock, T::Enumerable[::UncomputedUnlock])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::UncomputedUnlock, T::Enumerable[T.any(::UncomputedUnlock, T::Enumerable[::UncomputedUnlock])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::UncomputedUnlock, Integer, String, T::Enumerable[T.any(::UncomputedUnlock, Integer, String, T::Enumerable[::UncomputedUnlock])]) + ).returns(T::Array[::UncomputedUnlock]) + end + def delete(*records); end + + sig do + params( + records: T.any(::UncomputedUnlock, Integer, String, T::Enumerable[T.any(::UncomputedUnlock, Integer, String, T::Enumerable[::UncomputedUnlock])]) + ).returns(T::Array[::UncomputedUnlock]) + end + def destroy(*records); end + + sig { returns(T::Array[::UncomputedUnlock]) } + def load_target; end + + sig do + params( + records: T.any(::UncomputedUnlock, T::Enumerable[T.any(::UncomputedUnlock, T::Enumerable[::UncomputedUnlock])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::UncomputedUnlock, T::Enumerable[T.any(::UncomputedUnlock, T::Enumerable[::UncomputedUnlock])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::UncomputedUnlock, T::Enumerable[T.any(::UncomputedUnlock, T::Enumerable[::UncomputedUnlock])]) + ).returns(T::Array[::UncomputedUnlock]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::UncomputedUnlock]) } + def target; end + + sig { returns(T::Array[::UncomputedUnlock]) } + def to_a; end + + sig { returns(T::Array[::UncomputedUnlock]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::UncomputedUnlock } } + + sig { returns(T::Array[::UncomputedUnlock]) } + def to_a; end + + sig { returns(T::Array[::UncomputedUnlock]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::UncomputedUnlock } } + + 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: ::UncomputedUnlock } } + + 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/unlock.rbi b/sorbet/rbi/dsl/unlock.rbi new file mode 100644 index 000000000..b7ae61a62 --- /dev/null +++ b/sorbet/rbi/dsl/unlock.rbi @@ -0,0 +1,1321 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `Unlock`. +# Please instead update this file by running `bin/tapioca dsl Unlock`. + + +class Unlock + 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: ::Unlock).void)).returns(::Unlock) } + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::Unlock).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: ::Unlock).void)).returns(::Unlock) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Unlock).void) + ).returns(T::Array[::Unlock]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Unlock).void)).returns(::Unlock) } + 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: ::Unlock).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Unlock).void)).returns(::Unlock) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Unlock).void) + ).returns(T::Array[::Unlock]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Unlock).void)).returns(::Unlock) } + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::Unlock).void)).returns(::Unlock) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Unlock).void) + ).returns(T::Array[::Unlock]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Unlock).void)).returns(::Unlock) } + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Unlock).void) + ).returns(T::Array[::Unlock]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Unlock).void)).returns(::Unlock) } + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Unlock).void) + ).returns(T::Array[::Unlock]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Unlock).void)).returns(::Unlock) } + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::Unlock]) } + def destroy_all; end + + sig { returns(T::Array[::Unlock]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::Unlock]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::Unlock)) } + def fifth; end + + sig { returns(::Unlock) } + 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(::Unlock) + 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[::Unlock]) + end + sig { params(args: NilClass, block: T.proc.params(object: ::Unlock).void).returns(T.nilable(::Unlock)) } + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::Unlock)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::Unlock) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::Unlock).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::Unlock]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::Unlock]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::Unlock]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Unlock).void) + ).returns(T::Array[::Unlock]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Unlock).void)).returns(::Unlock) } + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Unlock).void) + ).returns(T::Array[::Unlock]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Unlock).void)).returns(::Unlock) } + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Unlock).void) + ).returns(T::Array[::Unlock]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Unlock).void)).returns(::Unlock) } + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::Unlock)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::Unlock) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::Unlock) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::Unlock)) } + sig { params(limit: Integer).returns(T::Array[::Unlock]) } + def first(limit = nil); end + + sig { returns(::Unlock) } + def first!; end + + sig { returns(T.nilable(::Unlock)) } + def forty_two; end + + sig { returns(::Unlock) } + def forty_two!; end + + sig { returns(T.nilable(::Unlock)) } + def fourth; end + + sig { returns(::Unlock) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::Unlock)) } + sig { params(limit: Integer).returns(T::Array[::Unlock]) } + def last(limit = nil); end + + sig { returns(::Unlock) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::Unlock).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: ::Unlock).void)).returns(::Unlock) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::Unlock).void) + ).returns(T::Array[::Unlock]) + end + sig { params(attributes: T.untyped, block: T.nilable(T.proc.params(object: ::Unlock).void)).returns(::Unlock) } + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Unlock).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::Unlock).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(::Unlock)) } + def second; end + + sig { returns(::Unlock) } + def second!; end + + sig { returns(T.nilable(::Unlock)) } + def second_to_last; end + + sig { returns(::Unlock) } + def second_to_last!; end + + sig { returns(::Unlock) } + 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: ::Unlock).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::Unlock)) } + sig { params(limit: Integer).returns(T::Array[::Unlock]) } + def take(limit = nil); end + + sig { returns(::Unlock) } + def take!; end + + sig { returns(T.nilable(::Unlock)) } + def third; end + + sig { returns(::Unlock) } + def third!; end + + sig { returns(T.nilable(::Unlock)) } + def third_to_last; end + + sig { returns(::Unlock) } + def third_to_last!; end + end + + module GeneratedAssociationMethods + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def build_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Exercise) } + def build_exercise(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::User) } + def build_user(*args, &blk); end + + sig { returns(T.nilable(::Course)) } + def course; end + + sig { params(value: T.nilable(::Course)).void } + def course=(value); end + + sig { returns(T::Boolean) } + def course_changed?; end + + sig { returns(T::Boolean) } + def course_previously_changed?; end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Course) } + def create_course!(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Exercise) } + def create_exercise(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(::Exercise) } + def create_exercise!(*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(::Exercise)) } + def exercise; end + + sig { params(value: T.nilable(::Exercise)).void } + def exercise=(value); end + + sig { returns(T::Boolean) } + def exercise_changed?; end + + sig { returns(T::Boolean) } + def exercise_previously_changed?; end + + sig { returns(T.nilable(::Course)) } + def reload_course; end + + sig { returns(T.nilable(::Exercise)) } + def reload_exercise; end + + sig { returns(T.nilable(::User)) } + def reload_user; end + + sig { void } + def reset_course; end + + sig { void } + def reset_exercise; 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 { 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 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: ::Unlock).returns(BasicObject)).returns(T::Array[::Unlock]) } + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(::Integer) } + def course_id; end + + sig { params(value: ::Integer).returns(::Integer) } + def course_id=(value); end + + sig { returns(T::Boolean) } + def course_id?; end + + sig { returns(T.nilable(::Integer)) } + def course_id_before_last_save; end + + sig { returns(T.untyped) } + def course_id_before_type_cast; end + + sig { returns(T::Boolean) } + def course_id_came_from_user?; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_change; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_in_database; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def course_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def course_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::Integer)) } + def course_id_previously_was; end + + sig { returns(T.nilable(::Integer)) } + def course_id_was; end + + sig { void } + def course_id_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(::String) } + def exercise_name; end + + sig { params(value: ::String).returns(::String) } + def exercise_name=(value); end + + sig { returns(T::Boolean) } + def exercise_name?; end + + sig { returns(T.nilable(::String)) } + def exercise_name_before_last_save; end + + sig { returns(T.untyped) } + def exercise_name_before_type_cast; end + + sig { returns(T::Boolean) } + def exercise_name_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def exercise_name_change; end + + sig { returns(T.nilable([::String, ::String])) } + def exercise_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def exercise_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def exercise_name_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def exercise_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def exercise_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def exercise_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def exercise_name_was; end + + sig { void } + def exercise_name_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 { void } + def restore_course_id!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_exercise_name!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_user_id!; end + + sig { void } + def restore_valid_after!; end + + sig { returns(T.nilable([::Integer, ::Integer])) } + def saved_change_to_course_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_course_id?(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([::String, ::String])) } + def saved_change_to_exercise_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_exercise_name?(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_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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def saved_change_to_valid_after; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_valid_after?(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 { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def valid_after; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def valid_after=(value); end + + sig { returns(T::Boolean) } + def valid_after?; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def valid_after_before_last_save; end + + sig { returns(T.untyped) } + def valid_after_before_type_cast; end + + sig { returns(T::Boolean) } + def valid_after_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def valid_after_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def valid_after_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def valid_after_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def valid_after_in_database; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def valid_after_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def valid_after_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def valid_after_previously_was; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def valid_after_was; end + + sig { void } + def valid_after_will_change!; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def will_save_change_to_course_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_exercise_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_user_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_valid_after?(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 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: ::Unlock).returns(BasicObject)).returns(T::Array[::Unlock]) } + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::Unlock } } + + sig { returns(T::Array[::Unlock]) } + def to_a; end + + sig { returns(T::Array[::Unlock]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::Unlock } } + + 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: ::Unlock } } + + 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: ::Unlock } } + + sig do + params( + records: T.any(::Unlock, T::Enumerable[T.any(::Unlock, T::Enumerable[::Unlock])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::Unlock, T::Enumerable[T.any(::Unlock, T::Enumerable[::Unlock])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::Unlock, T::Enumerable[T.any(::Unlock, T::Enumerable[::Unlock])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::Unlock, Integer, String, T::Enumerable[T.any(::Unlock, Integer, String, T::Enumerable[::Unlock])]) + ).returns(T::Array[::Unlock]) + end + def delete(*records); end + + sig do + params( + records: T.any(::Unlock, Integer, String, T::Enumerable[T.any(::Unlock, Integer, String, T::Enumerable[::Unlock])]) + ).returns(T::Array[::Unlock]) + end + def destroy(*records); end + + sig { returns(T::Array[::Unlock]) } + def load_target; end + + sig do + params( + records: T.any(::Unlock, T::Enumerable[T.any(::Unlock, T::Enumerable[::Unlock])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::Unlock, T::Enumerable[T.any(::Unlock, T::Enumerable[::Unlock])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::Unlock, T::Enumerable[T.any(::Unlock, T::Enumerable[::Unlock])]) + ).returns(T::Array[::Unlock]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::Unlock]) } + def target; end + + sig { returns(T::Array[::Unlock]) } + def to_a; end + + sig { returns(T::Array[::Unlock]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::Unlock } } + + sig { returns(T::Array[::Unlock]) } + def to_a; end + + sig { returns(T::Array[::Unlock]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::Unlock } } + + 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: ::Unlock } } + + 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.rbi b/sorbet/rbi/dsl/user.rbi new file mode 100644 index 000000000..2cc67c6ae --- /dev/null +++ b/sorbet/rbi/dsl/user.rbi @@ -0,0 +1,1917 @@ +# 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 + + 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 { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::User]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::User]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); 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 + end + + module GeneratedAssociationMethods + sig { returns(T::Array[T.untyped]) } + def action_token_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def action_token_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :action_tokens`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::ActionToken::PrivateCollectionProxy) } + def action_tokens; end + + sig { params(value: T::Enumerable[::ActionToken]).void } + def action_tokens=(value); end + + sig { returns(T::Array[T.untyped]) } + def assistantship_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def assistantship_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :assistantships`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Assistantship::PrivateCollectionProxy) } + def assistantships; end + + sig { params(value: T::Enumerable[::Assistantship]).void } + def assistantships=(value); end + + sig { returns(T::Array[T.untyped]) } + def assisted_course_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def assisted_course_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :assisted_courses, through: :assistantships`. + # 🔗 [Rails guide for `has_many_through` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-through-association) + sig { returns(::Course::PrivateCollectionProxy) } + def assisted_courses; end + + sig { params(value: T::Enumerable[::Course]).void } + def assisted_courses=(value); end + + sig { returns(T::Array[T.untyped]) } + def awarded_point_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def awarded_point_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :awarded_points`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::AwardedPoint::PrivateCollectionProxy) } + def awarded_points; end + + sig { params(value: T::Enumerable[::AwardedPoint]).void } + def awarded_points=(value); end + + sig { returns(T::Array[T.untyped]) } + def certificate_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def certificate_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :certificates`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Certificate::PrivateCollectionProxy) } + def certificates; end + + sig { params(value: T::Enumerable[::Certificate]).void } + def certificates=(value); end + + sig { returns(T::Array[T.untyped]) } + def course_notification_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def course_notification_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :course_notifications`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::CourseNotification::PrivateCollectionProxy) } + def course_notifications; end + + sig { params(value: T::Enumerable[::CourseNotification]).void } + def course_notifications=(value); end + + sig { returns(T::Array[T.untyped]) } + def course_template_refresh_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def course_template_refresh_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :course_template_refreshes`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::CourseTemplateRefresh::PrivateCollectionProxy) } + def course_template_refreshes; end + + sig { params(value: T::Enumerable[::CourseTemplateRefresh]).void } + def course_template_refreshes=(value); end + + sig { returns(T::Array[T.untyped]) } + def membership_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def membership_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :memberships, through: :organization_memberships`. + # 🔗 [Rails guide for `has_many_through` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-through-association) + sig { returns(::Organization::PrivateCollectionProxy) } + def memberships; end + + sig { params(value: T::Enumerable[::Organization]).void } + def memberships=(value); end + + sig { returns(T::Array[T.untyped]) } + def model_solution_token_used_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def model_solution_token_used_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :model_solution_token_useds`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::ModelSolutionTokenUsed::PrivateCollectionProxy) } + def model_solution_token_useds; end + + sig { params(value: T::Enumerable[::ModelSolutionTokenUsed]).void } + def model_solution_token_useds=(value); end + + sig { returns(T::Array[T.untyped]) } + def organization_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def organization_ids=(ids); end + + sig { returns(T::Array[T.untyped]) } + def organization_membership_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def organization_membership_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :organization_memberships`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::OrganizationMembership::PrivateCollectionProxy) } + def organization_memberships; end + + sig { params(value: T::Enumerable[::OrganizationMembership]).void } + def organization_memberships=(value); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :organizations, through: :teacherships`. + # 🔗 [Rails guide for `has_many_through` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-through-association) + sig { returns(::Organization::PrivateCollectionProxy) } + def organizations; end + + sig { params(value: T::Enumerable[::Organization]).void } + def organizations=(value); end + + sig { returns(T::Array[T.untyped]) } + def review_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def review_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :reviews`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Review::PrivateCollectionProxy) } + def reviews; end + + sig { params(value: T::Enumerable[::Review]).void } + def reviews=(value); end + + sig { returns(T::Array[T.untyped]) } + def submission_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def submission_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :submissions`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Submission::PrivateCollectionProxy) } + def submissions; end + + sig { params(value: T::Enumerable[::Submission]).void } + def submissions=(value); end + + sig { returns(T::Array[T.untyped]) } + def teachership_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def teachership_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :teacherships`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Teachership::PrivateCollectionProxy) } + def teacherships; end + + sig { params(value: T::Enumerable[::Teachership]).void } + def teacherships=(value); end + + sig { returns(T::Array[T.untyped]) } + def uncomputed_unlock_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def uncomputed_unlock_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :uncomputed_unlocks`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::UncomputedUnlock::PrivateCollectionProxy) } + def uncomputed_unlocks; end + + sig { params(value: T::Enumerable[::UncomputedUnlock]).void } + def uncomputed_unlocks=(value); end + + sig { returns(T::Array[T.untyped]) } + def unlock_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def unlock_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :unlocks`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::Unlock::PrivateCollectionProxy) } + def unlocks; end + + sig { params(value: T::Enumerable[::Unlock]).void } + def unlocks=(value); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :user_app_data`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::UserAppDatum::PrivateCollectionProxy) } + def user_app_data; end + + sig { params(value: T::Enumerable[::UserAppDatum]).void } + def user_app_data=(value); end + + sig { returns(T::Array[T.untyped]) } + def user_app_datum_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def user_app_datum_ids=(ids); end + + sig { returns(T::Array[T.untyped]) } + def user_field_value_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def user_field_value_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :user_field_values`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::UserFieldValue::PrivateCollectionProxy) } + def user_field_values; end + + sig { params(value: T::Enumerable[::UserFieldValue]).void } + def user_field_values=(value); end + + sig { returns(T::Array[T.untyped]) } + def verification_token_ids; end + + sig { params(ids: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def verification_token_ids=(ids); end + + # This method is created by ActiveRecord on the `User` class because it declared `has_many :verification_tokens`. + # 🔗 [Rails guide for `has_many` association](https://guides.rubyonrails.org/association_basics.html#the-has-many-association) + sig { returns(::VerificationToken::PrivateCollectionProxy) } + def verification_tokens; end + + sig { params(value: T::Enumerable[::VerificationToken]).void } + def verification_tokens=(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 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 legitimate_students(*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 non_legitimate_students(*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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T::Boolean) } + def administrator; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def administrator=(value); end + + sig { returns(T::Boolean) } + def administrator?; end + + sig { returns(T.nilable(T::Boolean)) } + def administrator_before_last_save; end + + sig { returns(T.untyped) } + def administrator_before_type_cast; end + + sig { returns(T::Boolean) } + def administrator_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def administrator_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def administrator_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def administrator_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def administrator_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def administrator_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def administrator_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def administrator_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def administrator_was; end + + sig { void } + def administrator_will_change!; end + + sig { returns(T.nilable(::String)) } + def argon_hash; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def argon_hash=(value); end + + sig { returns(T::Boolean) } + def argon_hash?; end + + sig { returns(T.nilable(::String)) } + def argon_hash_before_last_save; end + + sig { returns(T.untyped) } + def argon_hash_before_type_cast; end + + sig { returns(T::Boolean) } + def argon_hash_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def argon_hash_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def argon_hash_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def argon_hash_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def argon_hash_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def argon_hash_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def argon_hash_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def argon_hash_previously_was; end + + sig { returns(T.nilable(::String)) } + def argon_hash_was; end + + sig { void } + def argon_hash_will_change!; end + + sig { returns(T.nilable(::String)) } + def courses_mooc_fi_user_id; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def courses_mooc_fi_user_id=(value); end + + sig { returns(T::Boolean) } + def courses_mooc_fi_user_id?; end + + sig { returns(T.nilable(::String)) } + def courses_mooc_fi_user_id_before_last_save; end + + sig { returns(T.untyped) } + def courses_mooc_fi_user_id_before_type_cast; end + + sig { returns(T::Boolean) } + def courses_mooc_fi_user_id_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def courses_mooc_fi_user_id_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def courses_mooc_fi_user_id_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def courses_mooc_fi_user_id_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def courses_mooc_fi_user_id_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def courses_mooc_fi_user_id_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def courses_mooc_fi_user_id_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def courses_mooc_fi_user_id_previously_was; end + + sig { returns(T.nilable(::String)) } + def courses_mooc_fi_user_id_was; end + + sig { void } + def courses_mooc_fi_user_id_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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(::String) } + def email; end + + sig { params(value: ::String).returns(::String) } + def email=(value); end + + sig { returns(T::Boolean) } + def email?; end + + sig { returns(T.nilable(::String)) } + def email_before_last_save; end + + sig { returns(T.untyped) } + def email_before_type_cast; end + + sig { returns(T::Boolean) } + def email_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def email_change; end + + sig { returns(T.nilable([::String, ::String])) } + def email_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def email_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def email_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def email_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def email_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def email_previously_was; end + + sig { returns(T::Boolean) } + def email_verified; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def email_verified=(value); end + + sig { returns(T::Boolean) } + def email_verified?; end + + sig { returns(T.nilable(T::Boolean)) } + def email_verified_before_last_save; end + + sig { returns(T.untyped) } + def email_verified_before_type_cast; end + + sig { returns(T::Boolean) } + def email_verified_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def email_verified_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def email_verified_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def email_verified_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def email_verified_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def email_verified_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def email_verified_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def email_verified_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def email_verified_was; end + + sig { void } + def email_verified_will_change!; end + + sig { returns(T.nilable(::String)) } + def email_was; end + + sig { void } + def email_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::Boolean) } + def legitimate_student; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def legitimate_student=(value); end + + sig { returns(T::Boolean) } + def legitimate_student?; end + + sig { returns(T.nilable(T::Boolean)) } + def legitimate_student_before_last_save; end + + sig { returns(T.untyped) } + def legitimate_student_before_type_cast; end + + sig { returns(T::Boolean) } + def legitimate_student_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def legitimate_student_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def legitimate_student_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def legitimate_student_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def legitimate_student_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def legitimate_student_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def legitimate_student_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def legitimate_student_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def legitimate_student_was; end + + sig { void } + def legitimate_student_will_change!; end + + sig { returns(::String) } + def login; end + + sig { params(value: ::String).returns(::String) } + def login=(value); end + + sig { returns(T::Boolean) } + def login?; end + + sig { returns(T.nilable(::String)) } + def login_before_last_save; end + + sig { returns(T.untyped) } + def login_before_type_cast; end + + sig { returns(T::Boolean) } + def login_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def login_change; end + + sig { returns(T.nilable([::String, ::String])) } + def login_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def login_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def login_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def login_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def login_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def login_previously_was; end + + sig { returns(T.nilable(::String)) } + def login_was; end + + sig { void } + def login_will_change!; end + + sig { returns(T.nilable(::String)) } + def password_hash; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def password_hash=(value); end + + sig { returns(T::Boolean) } + def password_hash?; end + + sig { returns(T.nilable(::String)) } + def password_hash_before_last_save; end + + sig { returns(T.untyped) } + def password_hash_before_type_cast; end + + sig { returns(T::Boolean) } + def password_hash_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def password_hash_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def password_hash_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def password_hash_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def password_hash_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def password_hash_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def password_hash_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def password_hash_previously_was; end + + sig { returns(T.nilable(::String)) } + def password_hash_was; end + + sig { void } + def password_hash_will_change!; end + + sig { returns(T::Boolean) } + def password_managed_by_courses_mooc_fi; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def password_managed_by_courses_mooc_fi=(value); end + + sig { returns(T::Boolean) } + def password_managed_by_courses_mooc_fi?; end + + sig { returns(T.nilable(T::Boolean)) } + def password_managed_by_courses_mooc_fi_before_last_save; end + + sig { returns(T.untyped) } + def password_managed_by_courses_mooc_fi_before_type_cast; end + + sig { returns(T::Boolean) } + def password_managed_by_courses_mooc_fi_came_from_user?; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def password_managed_by_courses_mooc_fi_change; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def password_managed_by_courses_mooc_fi_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def password_managed_by_courses_mooc_fi_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def password_managed_by_courses_mooc_fi_in_database; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def password_managed_by_courses_mooc_fi_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def password_managed_by_courses_mooc_fi_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(T::Boolean)) } + def password_managed_by_courses_mooc_fi_previously_was; end + + sig { returns(T.nilable(T::Boolean)) } + def password_managed_by_courses_mooc_fi_was; end + + sig { void } + def password_managed_by_courses_mooc_fi_will_change!; end + + sig { void } + def restore_administrator!; end + + sig { void } + def restore_argon_hash!; end + + sig { void } + def restore_courses_mooc_fi_user_id!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_email!; end + + sig { void } + def restore_email_verified!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_legitimate_student!; end + + sig { void } + def restore_login!; end + + sig { void } + def restore_password_hash!; end + + sig { void } + def restore_password_managed_by_courses_mooc_fi!; end + + sig { void } + def restore_salt!; end + + sig { void } + def restore_updated_at!; end + + sig { returns(T.nilable(::String)) } + def salt; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def salt=(value); end + + sig { returns(T::Boolean) } + def salt?; end + + sig { returns(T.nilable(::String)) } + def salt_before_last_save; end + + sig { returns(T.untyped) } + def salt_before_type_cast; end + + sig { returns(T::Boolean) } + def salt_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def salt_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def salt_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def salt_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def salt_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def salt_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def salt_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def salt_previously_was; end + + sig { returns(T.nilable(::String)) } + def salt_was; end + + sig { void } + def salt_will_change!; end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_administrator; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_administrator?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_argon_hash; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_argon_hash?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_courses_mooc_fi_user_id; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_courses_mooc_fi_user_id?(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_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([::String, ::String])) } + def saved_change_to_email; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_email?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_email_verified; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_email_verified?(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::Boolean, T::Boolean])) } + def saved_change_to_legitimate_student; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_legitimate_student?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_login; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_login?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_password_hash; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_password_hash?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T::Boolean, T::Boolean])) } + def saved_change_to_password_managed_by_courses_mooc_fi; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_password_managed_by_courses_mooc_fi?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def saved_change_to_salt; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_salt?(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_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 updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_administrator?(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_argon_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_courses_mooc_fi_user_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_email?(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_email_verified?(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_legitimate_student?(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_login?(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_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_password_managed_by_courses_mooc_fi?(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_salt?(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 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 legitimate_students(*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 non_legitimate_students(*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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 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 do + params( + records: T.any(::User, Integer, String, T::Enumerable[T.any(::User, Integer, String, T::Enumerable[::User])]) + ).returns(T::Array[::User]) + end + def delete(*records); 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 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_app_datum.rbi b/sorbet/rbi/dsl/user_app_datum.rbi new file mode 100644 index 000000000..d7b0b4bb4 --- /dev/null +++ b/sorbet/rbi/dsl/user_app_datum.rbi @@ -0,0 +1,1379 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `UserAppDatum`. +# Please instead update this file by running `bin/tapioca dsl UserAppDatum`. + + +class UserAppDatum + 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: ::UserAppDatum).void) + ).returns(::UserAppDatum) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::UserAppDatum).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: ::UserAppDatum).void)).returns(::UserAppDatum) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserAppDatum).void) + ).returns(T::Array[::UserAppDatum]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UserAppDatum).void) + ).returns(::UserAppDatum) + 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: ::UserAppDatum).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::UserAppDatum).void)).returns(::UserAppDatum) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserAppDatum).void) + ).returns(T::Array[::UserAppDatum]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UserAppDatum).void) + ).returns(::UserAppDatum) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::UserAppDatum).void)).returns(::UserAppDatum) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserAppDatum).void) + ).returns(T::Array[::UserAppDatum]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UserAppDatum).void) + ).returns(::UserAppDatum) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserAppDatum).void) + ).returns(T::Array[::UserAppDatum]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UserAppDatum).void) + ).returns(::UserAppDatum) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserAppDatum).void) + ).returns(T::Array[::UserAppDatum]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UserAppDatum).void) + ).returns(::UserAppDatum) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::UserAppDatum]) } + def destroy_all; end + + sig { returns(T::Array[::UserAppDatum]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::UserAppDatum]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::UserAppDatum)) } + def fifth; end + + sig { returns(::UserAppDatum) } + 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(::UserAppDatum) + 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[::UserAppDatum]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::UserAppDatum).void + ).returns(T.nilable(::UserAppDatum)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::UserAppDatum)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::UserAppDatum) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::UserAppDatum).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::UserAppDatum]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::UserAppDatum]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::UserAppDatum]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserAppDatum).void) + ).returns(T::Array[::UserAppDatum]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UserAppDatum).void) + ).returns(::UserAppDatum) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserAppDatum).void) + ).returns(T::Array[::UserAppDatum]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UserAppDatum).void) + ).returns(::UserAppDatum) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserAppDatum).void) + ).returns(T::Array[::UserAppDatum]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UserAppDatum).void) + ).returns(::UserAppDatum) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::UserAppDatum)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::UserAppDatum) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::UserAppDatum) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::UserAppDatum)) } + sig { params(limit: Integer).returns(T::Array[::UserAppDatum]) } + def first(limit = nil); end + + sig { returns(::UserAppDatum) } + def first!; end + + sig { returns(T.nilable(::UserAppDatum)) } + def forty_two; end + + sig { returns(::UserAppDatum) } + def forty_two!; end + + sig { returns(T.nilable(::UserAppDatum)) } + def fourth; end + + sig { returns(::UserAppDatum) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::UserAppDatum)) } + sig { params(limit: Integer).returns(T::Array[::UserAppDatum]) } + def last(limit = nil); end + + sig { returns(::UserAppDatum) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::UserAppDatum).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: ::UserAppDatum).void)).returns(::UserAppDatum) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserAppDatum).void) + ).returns(T::Array[::UserAppDatum]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UserAppDatum).void) + ).returns(::UserAppDatum) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::UserAppDatum).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::UserAppDatum).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(::UserAppDatum)) } + def second; end + + sig { returns(::UserAppDatum) } + def second!; end + + sig { returns(T.nilable(::UserAppDatum)) } + def second_to_last; end + + sig { returns(::UserAppDatum) } + def second_to_last!; end + + sig { returns(::UserAppDatum) } + 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: ::UserAppDatum).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::UserAppDatum)) } + sig { params(limit: Integer).returns(T::Array[::UserAppDatum]) } + def take(limit = nil); end + + sig { returns(::UserAppDatum) } + def take!; end + + sig { returns(T.nilable(::UserAppDatum)) } + def third; end + + sig { returns(::UserAppDatum) } + def third!; end + + sig { returns(T.nilable(::UserAppDatum)) } + def third_to_last; end + + sig { returns(::UserAppDatum) } + def third_to_last!; 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 { 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 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: ::UserAppDatum).returns(BasicObject)).returns(T::Array[::UserAppDatum]) } + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 field_name; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def field_name=(value); end + + sig { returns(T::Boolean) } + def field_name?; end + + sig { returns(T.nilable(::String)) } + def field_name_before_last_save; end + + sig { returns(T.untyped) } + def field_name_before_type_cast; end + + sig { returns(T::Boolean) } + def field_name_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def field_name_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def field_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def field_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def field_name_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def field_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def field_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def field_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def field_name_was; end + + sig { void } + def field_name_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 namespace; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::String)) } + def namespace=(value); end + + sig { returns(T::Boolean) } + def namespace?; end + + sig { returns(T.nilable(::String)) } + def namespace_before_last_save; end + + sig { returns(T.untyped) } + def namespace_before_type_cast; end + + sig { returns(T::Boolean) } + def namespace_came_from_user?; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def namespace_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def namespace_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def namespace_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def namespace_in_database; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::String)])) } + def namespace_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def namespace_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def namespace_previously_was; end + + sig { returns(T.nilable(::String)) } + def namespace_was; end + + sig { void } + def namespace_will_change!; end + + sig { void } + def restore_created_at!; end + + sig { void } + def restore_field_name!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_namespace!; end + + sig { void } + def restore_updated_at!; end + + sig { void } + def restore_user_id!; end + + sig { void } + def restore_value!; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_field_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_field_name?(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_namespace; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_namespace?(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_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([T.nilable(::String), T.nilable(::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(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 { returns(T.nilable(::String)) } + def value; end + + sig { params(value: T.nilable(::String)).returns(T.nilable(::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([T.nilable(::String), T.nilable(::String)])) } + def value_change; end + + sig { returns(T.nilable([T.nilable(::String), T.nilable(::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([T.nilable(::String), T.nilable(::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_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_field_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_namespace?(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 + + 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 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: ::UserAppDatum).returns(BasicObject)).returns(T::Array[::UserAppDatum]) } + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::UserAppDatum } } + + sig { returns(T::Array[::UserAppDatum]) } + def to_a; end + + sig { returns(T::Array[::UserAppDatum]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::UserAppDatum } } + + 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: ::UserAppDatum } } + + 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: ::UserAppDatum } } + + sig do + params( + records: T.any(::UserAppDatum, T::Enumerable[T.any(::UserAppDatum, T::Enumerable[::UserAppDatum])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::UserAppDatum, T::Enumerable[T.any(::UserAppDatum, T::Enumerable[::UserAppDatum])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::UserAppDatum, T::Enumerable[T.any(::UserAppDatum, T::Enumerable[::UserAppDatum])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::UserAppDatum, Integer, String, T::Enumerable[T.any(::UserAppDatum, Integer, String, T::Enumerable[::UserAppDatum])]) + ).returns(T::Array[::UserAppDatum]) + end + def delete(*records); end + + sig do + params( + records: T.any(::UserAppDatum, Integer, String, T::Enumerable[T.any(::UserAppDatum, Integer, String, T::Enumerable[::UserAppDatum])]) + ).returns(T::Array[::UserAppDatum]) + end + def destroy(*records); end + + sig { returns(T::Array[::UserAppDatum]) } + def load_target; end + + sig do + params( + records: T.any(::UserAppDatum, T::Enumerable[T.any(::UserAppDatum, T::Enumerable[::UserAppDatum])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::UserAppDatum, T::Enumerable[T.any(::UserAppDatum, T::Enumerable[::UserAppDatum])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::UserAppDatum, T::Enumerable[T.any(::UserAppDatum, T::Enumerable[::UserAppDatum])]) + ).returns(T::Array[::UserAppDatum]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::UserAppDatum]) } + def target; end + + sig { returns(T::Array[::UserAppDatum]) } + def to_a; end + + sig { returns(T::Array[::UserAppDatum]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::UserAppDatum } } + + sig { returns(T::Array[::UserAppDatum]) } + def to_a; end + + sig { returns(T::Array[::UserAppDatum]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::UserAppDatum } } + + 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: ::UserAppDatum } } + + 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_field_value.rbi b/sorbet/rbi/dsl/user_field_value.rbi new file mode 100644 index 000000000..5d4f86d43 --- /dev/null +++ b/sorbet/rbi/dsl/user_field_value.rbi @@ -0,0 +1,1330 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `UserFieldValue`. +# Please instead update this file by running `bin/tapioca dsl UserFieldValue`. + + +class UserFieldValue + 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: ::UserFieldValue).void) + ).returns(::UserFieldValue) + end + def new(attributes = nil, &block); end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::UserFieldValue).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: ::UserFieldValue).void)).returns(::UserFieldValue) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserFieldValue).void) + ).returns(T::Array[::UserFieldValue]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UserFieldValue).void) + ).returns(::UserFieldValue) + 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: ::UserFieldValue).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::UserFieldValue).void)).returns(::UserFieldValue) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserFieldValue).void) + ).returns(T::Array[::UserFieldValue]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UserFieldValue).void) + ).returns(::UserFieldValue) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::UserFieldValue).void)).returns(::UserFieldValue) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserFieldValue).void) + ).returns(T::Array[::UserFieldValue]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UserFieldValue).void) + ).returns(::UserFieldValue) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserFieldValue).void) + ).returns(T::Array[::UserFieldValue]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UserFieldValue).void) + ).returns(::UserFieldValue) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserFieldValue).void) + ).returns(T::Array[::UserFieldValue]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UserFieldValue).void) + ).returns(::UserFieldValue) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::UserFieldValue]) } + def destroy_all; end + + sig { returns(T::Array[::UserFieldValue]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::UserFieldValue]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::UserFieldValue)) } + def fifth; end + + sig { returns(::UserFieldValue) } + 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(::UserFieldValue) + 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[::UserFieldValue]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::UserFieldValue).void + ).returns(T.nilable(::UserFieldValue)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::UserFieldValue)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::UserFieldValue) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::UserFieldValue).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::UserFieldValue]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::UserFieldValue]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::UserFieldValue]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserFieldValue).void) + ).returns(T::Array[::UserFieldValue]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UserFieldValue).void) + ).returns(::UserFieldValue) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserFieldValue).void) + ).returns(T::Array[::UserFieldValue]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UserFieldValue).void) + ).returns(::UserFieldValue) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserFieldValue).void) + ).returns(T::Array[::UserFieldValue]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UserFieldValue).void) + ).returns(::UserFieldValue) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::UserFieldValue)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::UserFieldValue) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::UserFieldValue) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::UserFieldValue)) } + sig { params(limit: Integer).returns(T::Array[::UserFieldValue]) } + def first(limit = nil); end + + sig { returns(::UserFieldValue) } + def first!; end + + sig { returns(T.nilable(::UserFieldValue)) } + def forty_two; end + + sig { returns(::UserFieldValue) } + def forty_two!; end + + sig { returns(T.nilable(::UserFieldValue)) } + def fourth; end + + sig { returns(::UserFieldValue) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::UserFieldValue)) } + sig { params(limit: Integer).returns(T::Array[::UserFieldValue]) } + def last(limit = nil); end + + sig { returns(::UserFieldValue) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::UserFieldValue).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: ::UserFieldValue).void)).returns(::UserFieldValue) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::UserFieldValue).void) + ).returns(T::Array[::UserFieldValue]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::UserFieldValue).void) + ).returns(::UserFieldValue) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::UserFieldValue).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::UserFieldValue).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(::UserFieldValue)) } + def second; end + + sig { returns(::UserFieldValue) } + def second!; end + + sig { returns(T.nilable(::UserFieldValue)) } + def second_to_last; end + + sig { returns(::UserFieldValue) } + def second_to_last!; end + + sig { returns(::UserFieldValue) } + 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: ::UserFieldValue).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::UserFieldValue)) } + sig { params(limit: Integer).returns(T::Array[::UserFieldValue]) } + def take(limit = nil); end + + sig { returns(::UserFieldValue) } + def take!; end + + sig { returns(T.nilable(::UserFieldValue)) } + def third; end + + sig { returns(::UserFieldValue) } + def third!; end + + sig { returns(T.nilable(::UserFieldValue)) } + def third_to_last; end + + sig { returns(::UserFieldValue) } + def third_to_last!; 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 { 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 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: ::UserFieldValue).returns(BasicObject) + ).returns(T::Array[::UserFieldValue]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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(::String) } + def field_name; end + + sig { params(value: ::String).returns(::String) } + def field_name=(value); end + + sig { returns(T::Boolean) } + def field_name?; end + + sig { returns(T.nilable(::String)) } + def field_name_before_last_save; end + + sig { returns(T.untyped) } + def field_name_before_type_cast; end + + sig { returns(T::Boolean) } + def field_name_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def field_name_change; end + + sig { returns(T.nilable([::String, ::String])) } + def field_name_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def field_name_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def field_name_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def field_name_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def field_name_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def field_name_previously_was; end + + sig { returns(T.nilable(::String)) } + def field_name_was; end + + sig { void } + def field_name_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 { void } + def restore_created_at!; end + + sig { void } + def restore_field_name!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_updated_at!; end + + sig { void } + def restore_user_id!; end + + sig { void } + def restore_value!; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([::String, ::String])) } + def saved_change_to_field_name; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_field_name?(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(::ActiveSupport::TimeWithZone), T.nilable(::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_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([::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(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 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 { 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_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_field_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_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 + + 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 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: ::UserFieldValue).returns(BasicObject) + ).returns(T::Array[::UserFieldValue]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::UserFieldValue } } + + sig { returns(T::Array[::UserFieldValue]) } + def to_a; end + + sig { returns(T::Array[::UserFieldValue]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::UserFieldValue } } + + 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: ::UserFieldValue } } + + 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: ::UserFieldValue } } + + sig do + params( + records: T.any(::UserFieldValue, T::Enumerable[T.any(::UserFieldValue, T::Enumerable[::UserFieldValue])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::UserFieldValue, T::Enumerable[T.any(::UserFieldValue, T::Enumerable[::UserFieldValue])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::UserFieldValue, T::Enumerable[T.any(::UserFieldValue, T::Enumerable[::UserFieldValue])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::UserFieldValue, Integer, String, T::Enumerable[T.any(::UserFieldValue, Integer, String, T::Enumerable[::UserFieldValue])]) + ).returns(T::Array[::UserFieldValue]) + end + def delete(*records); end + + sig do + params( + records: T.any(::UserFieldValue, Integer, String, T::Enumerable[T.any(::UserFieldValue, Integer, String, T::Enumerable[::UserFieldValue])]) + ).returns(T::Array[::UserFieldValue]) + end + def destroy(*records); end + + sig { returns(T::Array[::UserFieldValue]) } + def load_target; end + + sig do + params( + records: T.any(::UserFieldValue, T::Enumerable[T.any(::UserFieldValue, T::Enumerable[::UserFieldValue])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::UserFieldValue, T::Enumerable[T.any(::UserFieldValue, T::Enumerable[::UserFieldValue])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::UserFieldValue, T::Enumerable[T.any(::UserFieldValue, T::Enumerable[::UserFieldValue])]) + ).returns(T::Array[::UserFieldValue]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::UserFieldValue]) } + def target; end + + sig { returns(T::Array[::UserFieldValue]) } + def to_a; end + + sig { returns(T::Array[::UserFieldValue]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::UserFieldValue } } + + sig { returns(T::Array[::UserFieldValue]) } + def to_a; end + + sig { returns(T::Array[::UserFieldValue]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::UserFieldValue } } + + 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: ::UserFieldValue } } + + 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_mailer.rbi b/sorbet/rbi/dsl/user_mailer.rbi new file mode 100644 index 000000000..a4e2256af --- /dev/null +++ b/sorbet/rbi/dsl/user_mailer.rbi @@ -0,0 +1,25 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `UserMailer`. +# Please instead update this file by running `bin/tapioca dsl UserMailer`. + + +class UserMailer + include GeneratedUrlHelpersModule + include GeneratedMountedHelpers + + class << self + sig { params(user: ::User).returns(::ActionMailer::MessageDelivery) } + def destroy_confirmation(user); end + + sig do + params( + user: ::User, + origin: T.nilable(::String), + language: T.nilable(::String) + ).returns(::ActionMailer::MessageDelivery) + end + def email_confirmation(user, origin = T.unsafe(nil), language = T.unsafe(nil)); end + end +end diff --git a/sorbet/rbi/dsl/verification_token.rbi b/sorbet/rbi/dsl/verification_token.rbi new file mode 100644 index 000000000..34b8bc016 --- /dev/null +++ b/sorbet/rbi/dsl/verification_token.rbi @@ -0,0 +1,1372 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for dynamic methods in `VerificationToken`. +# Please instead update this file by running `bin/tapioca dsl VerificationToken`. + + +class VerificationToken + include GeneratedAssociationMethods + include GeneratedAttributeMethods + include EnumMethodsModule + 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: ::VerificationToken).void) + ).returns(::VerificationToken) + end + def new(attributes = nil, &block); end + + sig { returns(T::Hash[T.any(String, Symbol), Integer]) } + def types; end + end + + module CommonRelationMethods + sig { params(block: T.nilable(T.proc.params(record: ::VerificationToken).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: ::VerificationToken).void)).returns(::VerificationToken) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::VerificationToken).void) + ).returns(T::Array[::VerificationToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::VerificationToken).void) + ).returns(::VerificationToken) + 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: ::VerificationToken).void).returns(Integer) } + def count(column_name = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::VerificationToken).void)).returns(::VerificationToken) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::VerificationToken).void) + ).returns(T::Array[::VerificationToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::VerificationToken).void) + ).returns(::VerificationToken) + end + def create(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(object: ::VerificationToken).void)).returns(::VerificationToken) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::VerificationToken).void) + ).returns(T::Array[::VerificationToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::VerificationToken).void) + ).returns(::VerificationToken) + end + def create!(attributes = nil, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::VerificationToken).void) + ).returns(T::Array[::VerificationToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::VerificationToken).void) + ).returns(::VerificationToken) + end + def create_or_find_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::VerificationToken).void) + ).returns(T::Array[::VerificationToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::VerificationToken).void) + ).returns(::VerificationToken) + end + def create_or_find_by!(attributes, &block); end + + sig { returns(Integer) } + def delete_all; end + + sig { params(args: T.untyped).returns(Integer) } + def delete_by(*args); end + + sig { returns(T::Array[::VerificationToken]) } + def destroy_all; end + + sig { returns(T::Array[::VerificationToken]) } + def destroy_all; end + + sig { params(args: T.untyped).returns(T::Array[::VerificationToken]) } + def destroy_by(*args); end + + sig { params(conditions: T.untyped).returns(T::Boolean) } + def exists?(conditions = :none); end + + sig { returns(T.nilable(::VerificationToken)) } + def fifth; end + + sig { returns(::VerificationToken) } + 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(::VerificationToken) + 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[::VerificationToken]) + end + sig do + params( + args: NilClass, + block: T.proc.params(object: ::VerificationToken).void + ).returns(T.nilable(::VerificationToken)) + end + def find(args = nil, &block); end + + sig { params(args: T.untyped).returns(T.nilable(::VerificationToken)) } + def find_by(*args); end + + sig { params(args: T.untyped).returns(::VerificationToken) } + def find_by!(*args); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: ::VerificationToken).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[::VerificationToken]) + end + def find_each(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]), + block: T.proc.params(object: T::Array[::VerificationToken]).void + ).void + end + sig do + params( + start: T.untyped, + finish: T.untyped, + batch_size: Integer, + error_on_ignore: T.untyped, + order: T.any(Symbol, T::Array[Symbol]) + ).returns(T::Enumerator[T::Array[::VerificationToken]]) + end + def find_in_batches(start: nil, finish: nil, batch_size: 1000, error_on_ignore: nil, order: :asc, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::VerificationToken).void) + ).returns(T::Array[::VerificationToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::VerificationToken).void) + ).returns(::VerificationToken) + end + def find_or_create_by(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::VerificationToken).void) + ).returns(T::Array[::VerificationToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::VerificationToken).void) + ).returns(::VerificationToken) + end + def find_or_create_by!(attributes, &block); end + + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::VerificationToken).void) + ).returns(T::Array[::VerificationToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::VerificationToken).void) + ).returns(::VerificationToken) + end + def find_or_initialize_by(attributes, &block); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(T.nilable(::VerificationToken)) } + def find_signed(signed_id, purpose: nil); end + + sig { params(signed_id: T.untyped, purpose: T.untyped).returns(::VerificationToken) } + def find_signed!(signed_id, purpose: nil); end + + sig { params(arg: T.untyped, args: T.untyped).returns(::VerificationToken) } + def find_sole_by(arg, *args); end + + sig { returns(T.nilable(::VerificationToken)) } + sig { params(limit: Integer).returns(T::Array[::VerificationToken]) } + def first(limit = nil); end + + sig { returns(::VerificationToken) } + def first!; end + + sig { returns(T.nilable(::VerificationToken)) } + def forty_two; end + + sig { returns(::VerificationToken) } + def forty_two!; end + + sig { returns(T.nilable(::VerificationToken)) } + def fourth; end + + sig { returns(::VerificationToken) } + 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, + order: T.any(Symbol, T::Array[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, + order: T.any(Symbol, T::Array[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, order: :asc, use_ranges: nil, &block); end + + sig { params(record: T.untyped).returns(T::Boolean) } + def include?(record); end + + sig { returns(T.nilable(::VerificationToken)) } + sig { params(limit: Integer).returns(T::Array[::VerificationToken]) } + def last(limit = nil); end + + sig { returns(::VerificationToken) } + def last!; end + + sig { params(block: T.nilable(T.proc.params(record: ::VerificationToken).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: ::VerificationToken).void)).returns(::VerificationToken) } + sig do + params( + attributes: T::Array[T.untyped], + block: T.nilable(T.proc.params(object: ::VerificationToken).void) + ).returns(T::Array[::VerificationToken]) + end + sig do + params( + attributes: T.untyped, + block: T.nilable(T.proc.params(object: ::VerificationToken).void) + ).returns(::VerificationToken) + end + def new(attributes = nil, &block); end + + sig { params(block: T.nilable(T.proc.params(record: ::VerificationToken).returns(T.untyped))).returns(T::Boolean) } + def none?(&block); end + + sig { params(block: T.nilable(T.proc.params(record: ::VerificationToken).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(::VerificationToken)) } + def second; end + + sig { returns(::VerificationToken) } + def second!; end + + sig { returns(T.nilable(::VerificationToken)) } + def second_to_last; end + + sig { returns(::VerificationToken) } + def second_to_last!; end + + sig { returns(::VerificationToken) } + 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: ::VerificationToken).returns(T.type_parameter(:U)) + ).returns(T.type_parameter(:U)) + end + def sum(initial_value_or_column = nil, &block); end + + sig { returns(T.nilable(::VerificationToken)) } + sig { params(limit: Integer).returns(T::Array[::VerificationToken]) } + def take(limit = nil); end + + sig { returns(::VerificationToken) } + def take!; end + + sig { returns(T.nilable(::VerificationToken)) } + def third; end + + sig { returns(::VerificationToken) } + def third!; end + + sig { returns(T.nilable(::VerificationToken)) } + def third_to_last; end + + sig { returns(::VerificationToken) } + def third_to_last!; end + end + + module EnumMethodsModule + sig { void } + def delete_user!; end + + sig { returns(T::Boolean) } + def delete_user?; end + + sig { void } + def email!; end + + sig { returns(T::Boolean) } + def email?; 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 { 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 create_with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def delete_user(*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 email(*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_delete_user(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateAssociationRelation) } + def not_email(*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: ::VerificationToken).returns(BasicObject) + ).returns(T::Array[::VerificationToken]) + 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(PrivateAssociationRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + module GeneratedAttributeMethods + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def created_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def created_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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 { void } + def restore_created_at!; end + + sig { void } + def restore_id!; end + + sig { void } + def restore_id_value!; end + + sig { void } + def restore_token!; end + + sig { void } + def restore_type!; end + + sig { void } + def restore_updated_at!; end + + sig { void } + def restore_user_id!; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_token; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_token?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable([::String, ::String])) } + def saved_change_to_type; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def saved_change_to_type?(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_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(::String) } + def token; end + + sig { params(value: ::String).returns(::String) } + def token=(value); end + + sig { returns(T::Boolean) } + def token?; end + + sig { returns(T.nilable(::String)) } + def token_before_last_save; end + + sig { returns(T.untyped) } + def token_before_type_cast; end + + sig { returns(T::Boolean) } + def token_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def token_change; end + + sig { returns(T.nilable([::String, ::String])) } + def token_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def token_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def token_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def token_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def token_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def token_previously_was; end + + sig { returns(T.nilable(::String)) } + def token_was; end + + sig { void } + def token_will_change!; end + + sig { returns(::String) } + def type; end + + sig { params(value: T.any(::String, ::Symbol, ::Integer)).returns(T.any(::String, ::Symbol, ::Integer)) } + def type=(value); end + + sig { returns(T::Boolean) } + def type?; end + + sig { returns(T.nilable(::String)) } + def type_before_last_save; end + + sig { returns(T.untyped) } + def type_before_type_cast; end + + sig { returns(T::Boolean) } + def type_came_from_user?; end + + sig { returns(T.nilable([::String, ::String])) } + def type_change; end + + sig { returns(T.nilable([::String, ::String])) } + def type_change_to_be_saved; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def type_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def type_in_database; end + + sig { returns(T.nilable([::String, ::String])) } + def type_previous_change; end + + sig { params(from: T.untyped, to: T.untyped).returns(T::Boolean) } + def type_previously_changed?(from: T.unsafe(nil), to: T.unsafe(nil)); end + + sig { returns(T.nilable(::String)) } + def type_previously_was; end + + sig { returns(T.nilable(::String)) } + def type_was; end + + sig { void } + def type_will_change!; end + + sig { returns(T.nilable(::ActiveSupport::TimeWithZone)) } + def updated_at; end + + sig { params(value: T.nilable(::ActiveSupport::TimeWithZone)).returns(T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::ActiveSupport::TimeWithZone)])) } + def updated_at_change; end + + sig { returns(T.nilable([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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([T.nilable(::ActiveSupport::TimeWithZone), T.nilable(::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_token?(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_type?(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 create_with(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def delete_user(*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 email(*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_delete_user(*args, &blk); end + + sig { params(args: T.untyped, blk: T.untyped).returns(PrivateRelation) } + def not_email(*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: ::VerificationToken).returns(BasicObject) + ).returns(T::Array[::VerificationToken]) + 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(PrivateRelation) } + sig { type_parameters(:U).params(block: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } + def unscoped(&block); 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 without(*args, &blk); end + end + + class PrivateAssociationRelation < ::ActiveRecord::AssociationRelation + include CommonRelationMethods + include GeneratedAssociationRelationMethods + + Elem = type_member { { fixed: ::VerificationToken } } + + sig { returns(T::Array[::VerificationToken]) } + def to_a; end + + sig { returns(T::Array[::VerificationToken]) } + def to_ary; end + end + + class PrivateAssociationRelationGroupChain < PrivateAssociationRelation + Elem = type_member { { fixed: ::VerificationToken } } + + 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: ::VerificationToken } } + + 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: ::VerificationToken } } + + sig do + params( + records: T.any(::VerificationToken, T::Enumerable[T.any(::VerificationToken, T::Enumerable[::VerificationToken])]) + ).returns(PrivateCollectionProxy) + end + def <<(*records); end + + sig do + params( + records: T.any(::VerificationToken, T::Enumerable[T.any(::VerificationToken, T::Enumerable[::VerificationToken])]) + ).returns(PrivateCollectionProxy) + end + def append(*records); end + + sig { returns(PrivateCollectionProxy) } + def clear; end + + sig do + params( + records: T.any(::VerificationToken, T::Enumerable[T.any(::VerificationToken, T::Enumerable[::VerificationToken])]) + ).returns(PrivateCollectionProxy) + end + def concat(*records); end + + sig do + params( + records: T.any(::VerificationToken, Integer, String, T::Enumerable[T.any(::VerificationToken, Integer, String, T::Enumerable[::VerificationToken])]) + ).returns(T::Array[::VerificationToken]) + end + def delete(*records); end + + sig do + params( + records: T.any(::VerificationToken, Integer, String, T::Enumerable[T.any(::VerificationToken, Integer, String, T::Enumerable[::VerificationToken])]) + ).returns(T::Array[::VerificationToken]) + end + def destroy(*records); end + + sig { returns(T::Array[::VerificationToken]) } + def load_target; end + + sig do + params( + records: T.any(::VerificationToken, T::Enumerable[T.any(::VerificationToken, T::Enumerable[::VerificationToken])]) + ).returns(PrivateCollectionProxy) + end + def prepend(*records); end + + sig do + params( + records: T.any(::VerificationToken, T::Enumerable[T.any(::VerificationToken, T::Enumerable[::VerificationToken])]) + ).returns(PrivateCollectionProxy) + end + def push(*records); end + + sig do + params( + other_array: T.any(::VerificationToken, T::Enumerable[T.any(::VerificationToken, T::Enumerable[::VerificationToken])]) + ).returns(T::Array[::VerificationToken]) + end + def replace(other_array); end + + sig { returns(PrivateAssociationRelation) } + def scope; end + + sig { returns(T::Array[::VerificationToken]) } + def target; end + + sig { returns(T::Array[::VerificationToken]) } + def to_a; end + + sig { returns(T::Array[::VerificationToken]) } + def to_ary; end + end + + class PrivateRelation < ::ActiveRecord::Relation + include CommonRelationMethods + include GeneratedRelationMethods + + Elem = type_member { { fixed: ::VerificationToken } } + + sig { returns(T::Array[::VerificationToken]) } + def to_a; end + + sig { returns(T::Array[::VerificationToken]) } + def to_ary; end + end + + class PrivateRelationGroupChain < PrivateRelation + Elem = type_member { { fixed: ::VerificationToken } } + + 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: ::VerificationToken } } + + 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/gems/.gitattributes b/sorbet/rbi/gems/.gitattributes new file mode 100644 index 000000000..d9bb82a4d --- /dev/null +++ b/sorbet/rbi/gems/.gitattributes @@ -0,0 +1 @@ +**/*.rbi linguist-generated=true diff --git a/sorbet/rbi/gems/actioncable@7.1.3.4.rbi b/sorbet/rbi/gems/actioncable@7.1.3.4.rbi new file mode 100644 index 000000000..dc67e5abf --- /dev/null +++ b/sorbet/rbi/gems/actioncable@7.1.3.4.rbi @@ -0,0 +1,2913 @@ +# 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: actioncable/README.md +# +# pkg:gem/actioncable#lib/action_cable.rb:48 +module ActionCable + private + + # Singleton instance of the server + # + # pkg:gem/actioncable#lib/action_cable.rb:71 + def server; end + + class << self + # pkg:gem/actioncable#lib/action_cable/deprecator.rb:4 + def deprecator; end + + # Returns the currently loaded version of Action Cable as a +Gem::Version+. + # + # pkg:gem/actioncable#lib/action_cable/gem_version.rb:5 + def gem_version; end + + # Singleton instance of the server + # + # pkg:gem/actioncable#lib/action_cable.rb:71 + def server; end + + # Returns the currently loaded version of Action Cable as a +Gem::Version+. + # + # pkg:gem/actioncable#lib/action_cable/version.rb:7 + def version; end + end +end + +# pkg:gem/actioncable#lib/action_cable/channel/base.rb:8 +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. +# +# pkg:gem/actioncable#lib/action_cable/channel/base.rb:100 +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 + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + def initialize(connection, identifier, params = T.unsafe(nil)); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:101 + def __callbacks; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:101 + def __callbacks?; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:101 + def _run_subscribe_callbacks(&block); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:101 + def _run_unsubscribe_callbacks(&block); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:101 + def _subscribe_callbacks; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:101 + def _unsubscribe_callbacks; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:105 + def broadcast_to(model, message, &block); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:105 + def broadcasting_for(model, &block); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:104 + def channel_name(&block); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:108 + def connection; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:108 + def identifier; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:109 + def logger(*, **, &); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:108 + 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). + # + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + def perform_action(data); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:102 + def periodic_timers=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:106 + def rescue_handlers; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:106 + def rescue_handlers=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:106 + def rescue_handlers?; end + + # This method is called after subscription has been added to the connection + # and confirms or rejects the subscription. + # + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + 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. + # + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + def unsubscribe_from_channel; end + + private + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + def action_signature(action, data); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + def defer_subscription_confirmation!; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + def defer_subscription_confirmation?; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + def delegate_connection_identifiers; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + def dispatch_action(action, data); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + def ensure_confirmation_sent; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + def extract_action(data); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + def parameter_filter; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + def processable_action?(action); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + def reject; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + 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. + # + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + def subscribed; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + def subscription_confirmation_sent?; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + 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. + # + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + def transmit(data, via: T.unsafe(nil)); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + def transmit_subscription_confirmation; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + 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. + # + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:142 + def unsubscribed; end + + class << self + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:101 + def __callbacks; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:101 + def __callbacks=(value); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:101 + def __callbacks?; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:101 + def _subscribe_callbacks; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:101 + def _subscribe_callbacks=(value); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:101 + def _unsubscribe_callbacks; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:101 + 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. + # + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:120 + def action_methods; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:102 + def periodic_timers; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:102 + def periodic_timers=(value); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:102 + def periodic_timers?; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:106 + def rescue_handlers; end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:106 + def rescue_handlers=(value); end + + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:106 + def rescue_handlers?; end + + private + + # 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. + # + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:136 + def clear_action_methods!; end + + # Refresh the cached action_methods when a new action_method is added. + # + # pkg:gem/actioncable#lib/action_cable/channel/base.rb:141 + def method_added(name); end + end +end + +# pkg:gem/actioncable#lib/action_cable/channel/broadcasting.rb:7 +module ActionCable::Channel::Broadcasting + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionCable::Channel::Broadcasting::ClassMethods +end + +# pkg:gem/actioncable#lib/action_cable/channel/broadcasting.rb:14 +module ActionCable::Channel::Broadcasting::ClassMethods + # Broadcast a hash to a unique broadcasting for this model in this channel. + # + # pkg:gem/actioncable#lib/action_cable/channel/broadcasting.rb:16 + def broadcast_to(model, message); end + + # Returns a unique broadcasting identifier for this model in this channel: + # + # CommentsChannel.broadcasting_for("all") # => "comments:all" + # + # You can pass any object as a target (e.g. Active Record model), and it + # would be serialized into a string under the hood. + # + # pkg:gem/actioncable#lib/action_cable/channel/broadcasting.rb:26 + def broadcasting_for(model); end + + # pkg:gem/actioncable#lib/action_cable/channel/broadcasting.rb:30 + 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 +# +# pkg:gem/actioncable#lib/action_cable/channel/callbacks.rb:35 +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 + def __callbacks?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def __callbacks?; end + end +end + +# pkg:gem/actioncable#lib/action_cable/channel/callbacks.rb:44 +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? + # + # pkg:gem/actioncable#lib/action_cable/channel/callbacks.rb:58 + def after_subscribe(*methods, &block); end + + # pkg:gem/actioncable#lib/action_cable/channel/callbacks.rb:67 + def after_unsubscribe(*methods, &block); end + + # pkg:gem/actioncable#lib/action_cable/channel/callbacks.rb:45 + def before_subscribe(*methods, &block); end + + # pkg:gem/actioncable#lib/action_cable/channel/callbacks.rb:63 + def before_unsubscribe(*methods, &block); end + + # pkg:gem/actioncable#lib/action_cable/channel/callbacks.rb:61 + def on_subscribe(*methods, &block); end + + # pkg:gem/actioncable#lib/action_cable/channel/callbacks.rb:70 + def on_unsubscribe(*methods, &block); end +end + +# = Action Cable \Channel Stub +# +# Stub +stream_from+ to track streams for the channel. +# Add public aliases for +subscription_confirmation_sent?+ and +# +subscription_rejected?+. +# +# pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:23 +module ActionCable::Channel::ChannelStub + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:24 + def confirmed?; end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:28 + def rejected?; end + + # Make periodic timers no-op + # + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:45 + def start_periodic_timers; end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:36 + def stop_all_streams; end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:46 + def stop_periodic_timers; end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:32 + def stream_from(broadcasting, *); end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:40 + def streams; end +end + +# pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:49 +class ActionCable::Channel::ConnectionStub + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:54 + def initialize(identifiers = T.unsafe(nil)); end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:52 + def config(*, **, &); end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:71 + def connection_identifier; end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:50 + def identifiers; end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:50 + def logger; end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:52 + def pubsub(*, **, &); end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:50 + def server; end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:50 + def subscriptions; end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:50 + def transmissions; end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:67 + def transmit(cable_message); end + + private + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:76 + def connection_gid(ids); end +end + +# pkg:gem/actioncable#lib/action_cable/channel/naming.rb:5 +module ActionCable::Channel::Naming + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionCable::Channel::Naming::ClassMethods +end + +# pkg:gem/actioncable#lib/action_cable/channel/naming.rb:8 +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' + # + # pkg:gem/actioncable#lib/action_cable/channel/naming.rb:16 + def channel_name; end +end + +# pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:10 +class ActionCable::Channel::NonInferrableChannelError < ::StandardError + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:11 + def initialize(name); end +end + +# pkg:gem/actioncable#lib/action_cable/channel/periodic_timers.rb:5 +module ActionCable::Channel::PeriodicTimers + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionCable::Channel::PeriodicTimers::ClassMethods + + private + + # pkg:gem/actioncable#lib/action_cable/channel/periodic_timers.rb:56 + def active_periodic_timers; end + + # pkg:gem/actioncable#lib/action_cable/channel/periodic_timers.rb:66 + def start_periodic_timer(callback, every:); end + + # pkg:gem/actioncable#lib/action_cable/channel/periodic_timers.rb:60 + def start_periodic_timers; end + + # pkg:gem/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 + +# pkg:gem/actioncable#lib/action_cable/channel/periodic_timers.rb:15 +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 + # + # pkg:gem/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. +# +# pkg:gem/actioncable#lib/action_cable/channel/streams.rb:67 +module ActionCable::Channel::Streams + extend ::ActiveSupport::Concern + + # pkg:gem/actioncable#lib/action_cable/channel/streams.rb:140 + def pubsub(*, **, &); end + + # Unsubscribes all streams associated with this channel from the pubsub queue. + # + # pkg:gem/actioncable#lib/action_cable/channel/streams.rb:122 + def stop_all_streams; end + + # Unsubscribes streams for the model. + # + # pkg:gem/actioncable#lib/action_cable/channel/streams.rb:117 + def stop_stream_for(model); end + + # Unsubscribes streams from the named broadcasting. + # + # pkg:gem/actioncable#lib/action_cable/channel/streams.rb:108 + def stop_stream_from(broadcasting); end + + # Start streaming the pubsub queue for the model 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. + # + # pkg:gem/actioncable#lib/action_cable/channel/streams.rb:103 + def stream_for(model, 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. + # + # pkg:gem/actioncable#lib/action_cable/channel/streams.rb:78 + 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. + # + # pkg:gem/actioncable#lib/action_cable/channel/streams.rb:131 + 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. + # + # pkg:gem/actioncable#lib/action_cable/channel/streams.rb:176 + def default_stream_handler(broadcasting, coder:); end + + # pkg:gem/actioncable#lib/action_cable/channel/streams.rb:197 + def identity_handler; end + + # pkg:gem/actioncable#lib/action_cable/channel/streams.rb:181 + 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. + # + # pkg:gem/actioncable#lib/action_cable/channel/streams.rb:160 + def stream_handler(broadcasting, user_handler, coder: T.unsafe(nil)); end + + # pkg:gem/actioncable#lib/action_cable/channel/streams.rb:189 + def stream_transmitter(handler = T.unsafe(nil), broadcasting:); end + + # pkg:gem/actioncable#lib/action_cable/channel/streams.rb:142 + def streams; end + + # Always wrap the outermost handler to invoke the user handler on the + # worker pool rather than blocking the event loop. + # + # pkg:gem/actioncable#lib/action_cable/channel/streams.rb:148 + 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:: +# An ActionCable::Channel::ConnectionStub, representing the current HTTP connection. +# subscription:: +# An instance of the current channel, created when you call +subscribe+. +# transmissions:: +# A list of all messages that have been transmitted into the channel. +# +# +# == 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 +# +# pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:186 +class ActionCable::Channel::TestCase < ::ActiveSupport::TestCase + include ::ActiveSupport::Testing::ConstantLookup + include ::ActionCable::TestHelper + include ::ActionCable::Channel::TestCase::Behavior + extend ::ActiveSupport::Testing::ConstantLookup::ClassMethods + extend ::ActionCable::Channel::TestCase::Behavior::ClassMethods + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:196 + def _channel_class; end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:196 + def _channel_class=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:196 + def _channel_class?; end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:198 + def connection; end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:198 + def subscription; end + + class << self + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:196 + def _channel_class; end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:196 + def _channel_class=(value); end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:196 + def _channel_class?; end + end +end + +# pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:187 +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 + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:278 + def assert_broadcast_on(stream_or_object, *args); end + + # Enhance TestHelper assertions to handle non-String + # broadcastings + # + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:274 + def assert_broadcasts(stream_or_object, *args); end + + # Asserts that the specified stream has been started. + # + # def test_assert_started_stream + # subscribe + # assert_has_stream 'messages' + # end + # + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:300 + 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 + # + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:311 + 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 + # + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:289 + def assert_no_streams; end + + # Perform action on a channel. + # + # NOTE: Must be subscribed. + # + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:261 + 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') + # + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:239 + def stub_connection(identifiers = T.unsafe(nil)); end + + # Subscribe to the channel under test. Optionally pass subscription parameters as a Hash. + # + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:244 + def subscribe(params = T.unsafe(nil)); end + + # Returns messages transmitted into channel + # + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:267 + def transmissions; end + + # Unsubscribe the subscription under test. + # + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:253 + def unsubscribe; end + + private + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:320 + def broadcasting_for(stream_or_object); end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:316 + 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 + +# pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:193 +ActionCable::Channel::TestCase::Behavior::CHANNEL_IDENTIFIER = T.let(T.unsafe(nil), String) + +# pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:203 +module ActionCable::Channel::TestCase::Behavior::ClassMethods + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:215 + def channel_class; end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:223 + def determine_default_channel(name); end + + # pkg:gem/actioncable#lib/action_cable/channel/test_case.rb:204 + def tests(channel); end +end + +# pkg:gem/actioncable#lib/action_cable/connection/identification.rb:6 +module ActionCable::Connection; end + +# pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:20 +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: '' } } + # + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:25 + def assert_reject_connection(&block); end +end + +# pkg:gem/actioncable#lib/action_cable/connection/authorization.rb:5 +module ActionCable::Connection::Authorization + # Closes the WebSocket connection if it is open and returns an "unauthorized" reason. + # + # pkg:gem/actioncable#lib/action_cable/connection/authorization.rb:9 + def reject_unauthorized_connection; end +end + +# pkg:gem/actioncable#lib/action_cable/connection/authorization.rb:6 +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? +# +# pkg:gem/actioncable#lib/action_cable/connection/base.rb:48 +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 + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:58 + def initialize(server, env, coder: T.unsafe(nil)); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:52 + def __callbacks; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:52 + def __callbacks?; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:52 + def _command_callbacks; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:52 + def _run_command_callbacks(&block); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:134 + def beat; end + + # Close the WebSocket connection. + # + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:109 + def close(reason: T.unsafe(nil), reconnect: T.unsafe(nil)); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:56 + def config(*, **, &); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:90 + def dispatch_websocket_message(websocket_message); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:55 + def env; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:56 + def event_loop(*, **, &); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:98 + def handle_channel_command(payload); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:49 + def identifiers; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:49 + def identifiers=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:49 + def identifiers?; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:155 + def inspect; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:55 + def logger; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:151 + def on_close(reason, code); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:146 + def on_error(message); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:142 + def on_message(message); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:138 + 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. + # + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:74 + def process; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:55 + def protocol; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:56 + def pubsub(*, **, &); end + + # Decodes WebSocket messages and dispatches them to subscribed channels. + # WebSocket message transfer encoding is always JSON. + # + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:86 + def receive(websocket_message); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:53 + def rescue_handlers; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:53 + def rescue_handlers=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:53 + def rescue_handlers?; end + + # Invoke a method on the connection asynchronously through the pool of thread workers. + # + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:119 + def send_async(method, *arguments); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:55 + 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. + # + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:125 + def statistics; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:55 + def subscriptions; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:104 + def transmit(cable_message); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:55 + def worker_pool; end + + private + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:214 + def allow_request_origin?; end + + # The cookies of the request that initiated the WebSocket connection. Useful for performing authorization checks. + # + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:172 + def cookies; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:180 + def decode(websocket_message); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:176 + def encode(cable_message); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:256 + def finished_request_message; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:196 + def handle_close; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:184 + def handle_open; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:264 + def invalid_request_message; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:161 + def message_buffer; end + + # Tags are declared in the server but computed in the connection. This allows us per-connection tailored tags. + # + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:242 + def new_tagged_logger; end + + # The request that initiated the WebSocket connection is available here. This gives access to the environment, cookies, etc. + # + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:164 + def request; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:233 + def respond_to_invalid_request; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:228 + def respond_to_successful_request; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:207 + def send_welcome_message; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:247 + def started_request_message; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:270 + def successful_request_message; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:160 + def websocket; end + + class << self + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:52 + def __callbacks; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:52 + def __callbacks=(value); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:52 + def __callbacks?; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:52 + def _command_callbacks; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:52 + def _command_callbacks=(value); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:49 + def identifiers; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:49 + def identifiers=(value); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:49 + def identifiers?; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:53 + def rescue_handlers; end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:53 + def rescue_handlers=(value); end + + # pkg:gem/actioncable#lib/action_cable/connection/base.rb:53 + def rescue_handlers?; 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 +# +# pkg:gem/actioncable#lib/action_cable/connection/callbacks.rb:32 +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 + def __callbacks?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def __callbacks?; end + end +end + +# pkg:gem/actioncable#lib/action_cable/connection/callbacks.rb:40 +module ActionCable::Connection::Callbacks::ClassMethods + # pkg:gem/actioncable#lib/action_cable/connection/callbacks.rb:45 + def after_command(*methods, &block); end + + # pkg:gem/actioncable#lib/action_cable/connection/callbacks.rb:49 + def around_command(*methods, &block); end + + # pkg:gem/actioncable#lib/action_cable/connection/callbacks.rb:41 + def before_command(*methods, &block); end +end + +# -- +# This class is heavily based on faye-websocket-ruby +# +# Copyright (c) 2010-2015 James Coglan +# +# pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:11 +class ActionCable::Connection::ClientSocket + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:34 + def initialize(env, event_target, event_loop, protocols); end + + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:112 + def alive?; end + + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:108 + def client_gone; end + + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:90 + def close(code = T.unsafe(nil), reason = T.unsafe(nil)); end + + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:32 + def env; end + + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:104 + def parse(data); end + + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:116 + def protocol; end + + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:69 + def rack_response; end + + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:57 + def start_driver; end + + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:80 + def transmit(message); end + + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:32 + def url; end + + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:74 + def write(data); end + + private + + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:140 + def begin_close(reason, code); end + + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:134 + def emit_error(message); end + + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:149 + def finalize_close; end + + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:121 + def open; end + + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:128 + def receive_message(data); end + + class << self + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:12 + def determine_url(env); end + + # pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:17 + def secure_request?(env); end + end +end + +# pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:30 +ActionCable::Connection::ClientSocket::CLOSED = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:29 +ActionCable::Connection::ClientSocket::CLOSING = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:27 +ActionCable::Connection::ClientSocket::CONNECTING = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actioncable#lib/action_cable/connection/client_socket.rb:28 +ActionCable::Connection::ClientSocket::OPEN = T.let(T.unsafe(nil), Integer) + +# pkg:gem/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. + # + # pkg:gem/actioncable#lib/action_cable/connection/identification.rb:27 + def connection_identifier; end + + private + + # pkg:gem/actioncable#lib/action_cable/connection/identification.rb:36 + 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 + +# pkg:gem/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. + # + # pkg:gem/actioncable#lib/action_cable/connection/identification.rb:20 + def identified_by(*identifiers); end +end + +# = Action Cable \InternalChannel +# +# Makes it possible for the RemoteConnection to disconnect a specific connection. +# +# pkg:gem/actioncable#lib/action_cable/connection/internal_channel.rb:8 +module ActionCable::Connection::InternalChannel + extend ::ActiveSupport::Concern + + private + + # pkg:gem/actioncable#lib/action_cable/connection/internal_channel.rb:12 + def internal_channel; end + + # pkg:gem/actioncable#lib/action_cable/connection/internal_channel.rb:33 + def process_internal_message(message); end + + # pkg:gem/actioncable#lib/action_cable/connection/internal_channel.rb:16 + def subscribe_to_internal_channel; end + + # pkg:gem/actioncable#lib/action_cable/connection/internal_channel.rb:27 + 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. +# +# pkg:gem/actioncable#lib/action_cable/connection/message_buffer.rb:6 +class ActionCable::Connection::MessageBuffer + # pkg:gem/actioncable#lib/action_cable/connection/message_buffer.rb:7 + def initialize(connection); end + + # pkg:gem/actioncable#lib/action_cable/connection/message_buffer.rb:12 + def append(message); end + + # pkg:gem/actioncable#lib/action_cable/connection/message_buffer.rb:28 + def process!; end + + # pkg:gem/actioncable#lib/action_cable/connection/message_buffer.rb:24 + def processing?; end + + private + + # pkg:gem/actioncable#lib/action_cable/connection/message_buffer.rb:45 + def buffer(message); end + + # pkg:gem/actioncable#lib/action_cable/connection/message_buffer.rb:35 + def buffered_messages; end + + # pkg:gem/actioncable#lib/action_cable/connection/message_buffer.rb:34 + def connection; end + + # pkg:gem/actioncable#lib/action_cable/connection/message_buffer.rb:41 + def receive(message); end + + # pkg:gem/actioncable#lib/action_cable/connection/message_buffer.rb:49 + def receive_buffered_messages; end + + # pkg:gem/actioncable#lib/action_cable/connection/message_buffer.rb:37 + def valid?(message); end +end + +# pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:12 +class ActionCable::Connection::NonInferrableConnectionError < ::StandardError + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:13 + def initialize(name); end +end + +# -- +# This class is heavily based on faye-websocket-ruby +# +# Copyright (c) 2010-2015 James Coglan +# +# pkg:gem/actioncable#lib/action_cable/connection/stream.rb:9 +class ActionCable::Connection::Stream + # pkg:gem/actioncable#lib/action_cable/connection/stream.rb:10 + def initialize(event_loop, socket); end + + # pkg:gem/actioncable#lib/action_cable/connection/stream.rb:26 + def close; end + + # pkg:gem/actioncable#lib/action_cable/connection/stream.rb:22 + def each(&callback); end + + # pkg:gem/actioncable#lib/action_cable/connection/stream.rb:70 + def flush_write_buffer; end + + # pkg:gem/actioncable#lib/action_cable/connection/stream.rb:96 + def hijack_rack_socket; end + + # pkg:gem/actioncable#lib/action_cable/connection/stream.rb:92 + def receive(data); end + + # pkg:gem/actioncable#lib/action_cable/connection/stream.rb:31 + def shutdown; end + + # pkg:gem/actioncable#lib/action_cable/connection/stream.rb:35 + def write(data); end + + private + + # pkg:gem/actioncable#lib/action_cable/connection/stream.rb:108 + def clean_rack_hijack; end +end + +# pkg:gem/actioncable#lib/action_cable/connection/stream_event_loop.rb:7 +class ActionCable::Connection::StreamEventLoop + # pkg:gem/actioncable#lib/action_cable/connection/stream_event_loop.rb:8 + def initialize; end + + # pkg:gem/actioncable#lib/action_cable/connection/stream_event_loop.rb:28 + def attach(io, stream); end + + # pkg:gem/actioncable#lib/action_cable/connection/stream_event_loop.rb:36 + def detach(io, stream); end + + # pkg:gem/actioncable#lib/action_cable/connection/stream_event_loop.rb:21 + def post(task = T.unsafe(nil), &block); end + + # pkg:gem/actioncable#lib/action_cable/connection/stream_event_loop.rb:54 + def stop; end + + # pkg:gem/actioncable#lib/action_cable/connection/stream_event_loop.rb:17 + def timer(interval, &block); end + + # pkg:gem/actioncable#lib/action_cable/connection/stream_event_loop.rb:45 + def writes_pending(io); end + + private + + # pkg:gem/actioncable#lib/action_cable/connection/stream_event_loop.rb:84 + def run; end + + # pkg:gem/actioncable#lib/action_cable/connection/stream_event_loop.rb:60 + def spawn; end + + # pkg:gem/actioncable#lib/action_cable/connection/stream_event_loop.rb:80 + 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. +# +# pkg:gem/actioncable#lib/action_cable/connection/subscriptions.rb:11 +class ActionCable::Connection::Subscriptions + # pkg:gem/actioncable#lib/action_cable/connection/subscriptions.rb:12 + def initialize(connection); end + + # pkg:gem/actioncable#lib/action_cable/connection/subscriptions.rb:30 + def add(data); end + + # pkg:gem/actioncable#lib/action_cable/connection/subscriptions.rb:17 + def execute_command(data); end + + # pkg:gem/actioncable#lib/action_cable/connection/subscriptions.rb:61 + def identifiers; end + + # pkg:gem/actioncable#lib/action_cable/connection/subscriptions.rb:71 + def logger(*, **, &); end + + # pkg:gem/actioncable#lib/action_cable/connection/subscriptions.rb:57 + def perform_action(data); end + + # pkg:gem/actioncable#lib/action_cable/connection/subscriptions.rb:47 + def remove(data); end + + # pkg:gem/actioncable#lib/action_cable/connection/subscriptions.rb:52 + def remove_subscription(subscription); end + + # pkg:gem/actioncable#lib/action_cable/connection/subscriptions.rb:65 + def unsubscribe_from_all; end + + private + + # pkg:gem/actioncable#lib/action_cable/connection/subscriptions.rb:70 + def connection; end + + # pkg:gem/actioncable#lib/action_cable/connection/subscriptions.rb:73 + def find(data); end + + # pkg:gem/actioncable#lib/action_cable/connection/subscriptions.rb:70 + 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. +# +# pkg:gem/actioncable#lib/action_cable/connection/tagged_logger_proxy.rb:10 +class ActionCable::Connection::TaggedLoggerProxy + # pkg:gem/actioncable#lib/action_cable/connection/tagged_logger_proxy.rb:13 + def initialize(logger, tags:); end + + # pkg:gem/actioncable#lib/action_cable/connection/tagged_logger_proxy.rb:18 + def add_tags(*tags); end + + # pkg:gem/actioncable#lib/action_cable/connection/tagged_logger_proxy.rb:33 + def debug(message = T.unsafe(nil), &block); end + + # pkg:gem/actioncable#lib/action_cable/connection/tagged_logger_proxy.rb:33 + def error(message = T.unsafe(nil), &block); end + + # pkg:gem/actioncable#lib/action_cable/connection/tagged_logger_proxy.rb:33 + def fatal(message = T.unsafe(nil), &block); end + + # pkg:gem/actioncable#lib/action_cable/connection/tagged_logger_proxy.rb:33 + def info(message = T.unsafe(nil), &block); end + + # pkg:gem/actioncable#lib/action_cable/connection/tagged_logger_proxy.rb:23 + def tag(logger, &block); end + + # pkg:gem/actioncable#lib/action_cable/connection/tagged_logger_proxy.rb:11 + def tags; end + + # pkg:gem/actioncable#lib/action_cable/connection/tagged_logger_proxy.rb:33 + def unknown(message = T.unsafe(nil), &block); end + + # pkg:gem/actioncable#lib/action_cable/connection/tagged_logger_proxy.rb:33 + def warn(message = T.unsafe(nil), &block); end + + private + + # pkg:gem/actioncable#lib/action_cable/connection/tagged_logger_proxy.rb:39 + 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 as follows: +# +# 1. Simulate a connection attempt by calling +connect+. +# 2. Assert state, e.g. identifiers, has 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 +# +# pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:131 +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 + + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:141 + def _connection_class; end + + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:141 + def _connection_class=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:141 + def _connection_class?; end + + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:143 + def connection; end + + class << self + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:141 + def _connection_class; end + + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:141 + def _connection_class=(value); end + + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:141 + def _connection_class?; end + end +end + +# pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:132 +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) + # + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:185 + def connect(path = T.unsafe(nil), **request_params); end + + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:205 + def cookies; end + + # Exert #disconnect on the connection under test. + # + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:198 + def disconnect; end + + private + + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:210 + 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 + +# pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:148 +module ActionCable::Connection::TestCase::Behavior::ClassMethods + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:160 + def connection_class; end + + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:168 + def determine_default_connection(name); end + + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:149 + def tests(connection); end +end + +# pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:135 +ActionCable::Connection::TestCase::Behavior::DEFAULT_PATH = T.let(T.unsafe(nil), String) + +# pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:47 +module ActionCable::Connection::TestConnection + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:50 + def initialize(request); end + + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:48 + def logger; end + + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:48 + 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) +# +# pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:33 +class ActionCable::Connection::TestCookieJar < ::ActiveSupport::HashWithIndifferentAccess + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:38 + def encrypted; end + + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:34 + def signed; end +end + +# pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:43 +class ActionCable::Connection::TestRequest < ::ActionDispatch::TestRequest + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:44 + def cookie_jar; end + + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:44 + def cookie_jar=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:44 + def session; end + + # pkg:gem/actioncable#lib/action_cable/connection/test_case.rb:44 + def session=(_arg0); end +end + +# = Action Cable \Connection \WebSocket +# +# Wrap the real socket to minimize the externally-presented API +# +# pkg:gem/actioncable#lib/action_cable/connection/web_socket.rb:10 +class ActionCable::Connection::WebSocket + # pkg:gem/actioncable#lib/action_cable/connection/web_socket.rb:11 + def initialize(env, event_target, event_loop, protocols: T.unsafe(nil)); end + + # pkg:gem/actioncable#lib/action_cable/connection/web_socket.rb:19 + def alive?; end + + # pkg:gem/actioncable#lib/action_cable/connection/web_socket.rb:27 + def close; end + + # pkg:gem/actioncable#lib/action_cable/connection/web_socket.rb:15 + def possible?; end + + # pkg:gem/actioncable#lib/action_cable/connection/web_socket.rb:31 + def protocol; end + + # pkg:gem/actioncable#lib/action_cable/connection/web_socket.rb:35 + def rack_response; end + + # pkg:gem/actioncable#lib/action_cable/connection/web_socket.rb:23 + def transmit(data); end + + private + + # pkg:gem/actioncable#lib/action_cable/connection/web_socket.rb:40 + def websocket; end +end + +# pkg:gem/actioncable#lib/action_cable/engine.rb:8 +class ActionCable::Engine < ::Rails::Engine; end + +# pkg:gem/actioncable#lib/action_cable/helpers/action_cable_helper.rb:4 +module ActionCable::Helpers; end + +# pkg:gem/actioncable#lib/action_cable/helpers/action_cable_helper.rb:5 +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: + # => + # + # pkg:gem/actioncable#lib/action_cable/helpers/action_cable_helper.rb:34 + def action_cable_meta_tag; end +end + +# pkg:gem/actioncable#lib/action_cable.rb:52 +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) +# +# pkg:gem/actioncable#lib/action_cable/remote_connections.rb:29 +class ActionCable::RemoteConnections + # pkg:gem/actioncable#lib/action_cable/remote_connections.rb:32 + def initialize(server); end + + # pkg:gem/actioncable#lib/action_cable/remote_connections.rb:30 + def server; end + + # pkg:gem/actioncable#lib/action_cable/remote_connections.rb:36 + 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. +# +# pkg:gem/actioncable#lib/action_cable/remote_connections.rb:45 +class ActionCable::RemoteConnections::RemoteConnection + include ::ActionCable::Connection::InternalChannel + include ::ActionCable::Connection::Identification + extend ::ActionCable::Connection::Identification::ClassMethods + + # pkg:gem/actioncable#lib/action_cable/remote_connections.rb:50 + def initialize(server, ids); end + + # Uses the internal channel to disconnect the connection. + # + # pkg:gem/actioncable#lib/action_cable/remote_connections.rb:56 + def disconnect(reconnect: T.unsafe(nil)); end + + # pkg:gem/actioncable#lib/action_cable/remote_connections.rb:48 + def identifiers; end + + # pkg:gem/actioncable#lib/action_cable/remote_connections.rb:48 + def identifiers=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/remote_connections.rb:48 + def identifiers?; end + + protected + + # pkg:gem/actioncable#lib/action_cable/remote_connections.rb:66 + def server; end + + private + + # pkg:gem/actioncable#lib/action_cable/remote_connections.rb:69 + def set_identifier_instance_vars(ids); end + + # pkg:gem/actioncable#lib/action_cable/remote_connections.rb:74 + def valid_identifiers?(ids); end + + class << self + # pkg:gem/actioncable#lib/action_cable/remote_connections.rb:48 + def identifiers; end + + # pkg:gem/actioncable#lib/action_cable/remote_connections.rb:48 + def identifiers=(value); end + + # pkg:gem/actioncable#lib/action_cable/remote_connections.rb:48 + def identifiers?; end + end +end + +# pkg:gem/actioncable#lib/action_cable/remote_connections.rb:46 +class ActionCable::RemoteConnections::RemoteConnection::InvalidIdentifiersError < ::StandardError; end + +# pkg:gem/actioncable#lib/action_cable/server/base.rb:6 +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. +# +# pkg:gem/actioncable#lib/action_cable/server/base.rb:13 +class ActionCable::Server::Base + include ::ActionCable::Server::Broadcasting + include ::ActionCable::Server::Connections + + # pkg:gem/actioncable#lib/action_cable/server/base.rb:26 + def initialize(config: T.unsafe(nil)); end + + # Called by Rack to set up the server. + # + # pkg:gem/actioncable#lib/action_cable/server/base.rb:33 + def call(env); end + + # pkg:gem/actioncable#lib/action_cable/server/base.rb:19 + def config; end + + # All of the identifiers applied to the connection class associated with this server. + # + # pkg:gem/actioncable#lib/action_cable/server/base.rb:90 + def connection_identifiers; end + + # Disconnect all the connections identified by +identifiers+ on this server or any others via RemoteConnections. + # + # pkg:gem/actioncable#lib/action_cable/server/base.rb:40 + def disconnect(identifiers); end + + # pkg:gem/actioncable#lib/action_cable/server/base.rb:65 + def event_loop; end + + # pkg:gem/actioncable#lib/action_cable/server/base.rb:22 + def logger(*, **, &); end + + # pkg:gem/actioncable#lib/action_cable/server/base.rb:24 + def mutex; end + + # Adapter used for all streams/broadcasting. + # + # pkg:gem/actioncable#lib/action_cable/server/base.rb:85 + def pubsub; end + + # Gateway to RemoteConnections. See that class for details. + # + # pkg:gem/actioncable#lib/action_cable/server/base.rb:61 + def remote_connections; end + + # pkg:gem/actioncable#lib/action_cable/server/base.rb:44 + 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. + # + # pkg:gem/actioncable#lib/action_cable/server/base.rb:80 + def worker_pool; end + + class << self + # pkg:gem/actioncable#lib/action_cable/server/base.rb:17 + def config; end + + # pkg:gem/actioncable#lib/action_cable/server/base.rb:17 + def config=(val); end + + # pkg:gem/actioncable#lib/action_cable/server/base.rb:21 + 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 CoffeeScript, which assumes you've already requested the right to send web notifications: +# App.cable.subscriptions.create "WebNotificationsChannel", +# received: (data) -> +# new Notification data['title'], body: data['body'] +# +# pkg:gem/actioncable#lib/action_cable/server/broadcasting.rb:24 +module ActionCable::Server::Broadcasting + # Broadcast a hash directly to a named broadcasting. This will later be JSON encoded. + # + # pkg:gem/actioncable#lib/action_cable/server/broadcasting.rb:26 + 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. + # + # pkg:gem/actioncable#lib/action_cable/server/broadcasting.rb:32 + def broadcaster_for(broadcasting, coder: T.unsafe(nil)); end +end + +# pkg:gem/actioncable#lib/action_cable/server/broadcasting.rb:37 +class ActionCable::Server::Broadcasting::Broadcaster + # pkg:gem/actioncable#lib/action_cable/server/broadcasting.rb:40 + def initialize(server, broadcasting, coder:); end + + # pkg:gem/actioncable#lib/action_cable/server/broadcasting.rb:44 + def broadcast(message); end + + # pkg:gem/actioncable#lib/action_cable/server/broadcasting.rb:38 + def broadcasting; end + + # pkg:gem/actioncable#lib/action_cable/server/broadcasting.rb:38 + def coder; end + + # pkg:gem/actioncable#lib/action_cable/server/broadcasting.rb:38 + 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. +# +# pkg:gem/actioncable#lib/action_cable/server/configuration.rb:11 +class ActionCable::Server::Configuration + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:19 + def initialize; end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:14 + def allow_same_origin_as_host; end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:14 + def allow_same_origin_as_host=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:14 + def allowed_request_origins; end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:14 + def allowed_request_origins=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:15 + def cable; end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:15 + def cable=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:13 + def connection_class; end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:13 + def connection_class=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:14 + def disable_request_forgery_protection; end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:14 + def disable_request_forgery_protection=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:14 + def filter_parameters; end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:14 + def filter_parameters=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:17 + def health_check_application; end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:17 + def health_check_application=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:17 + def health_check_path; end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:17 + def health_check_path=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:12 + def log_tags; end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:12 + def log_tags=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:12 + def logger; end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:12 + def logger=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:15 + def mount_path; end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:15 + def mount_path=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:16 + def precompile_assets; end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:16 + 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. + # + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:37 + def pubsub_adapter; end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:15 + def url; end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:15 + def url=(_arg0); end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:13 + def worker_pool_size; end + + # pkg:gem/actioncable#lib/action_cable/server/configuration.rb:13 + 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. +# +# pkg:gem/actioncable#lib/action_cable/server/connections.rb:9 +module ActionCable::Server::Connections + # pkg:gem/actioncable#lib/action_cable/server/connections.rb:16 + def add_connection(connection); end + + # pkg:gem/actioncable#lib/action_cable/server/connections.rb:12 + def connections; end + + # pkg:gem/actioncable#lib/action_cable/server/connections.rb:33 + def open_connections_statistics; end + + # pkg:gem/actioncable#lib/action_cable/server/connections.rb:20 + 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. + # + # pkg:gem/actioncable#lib/action_cable/server/connections.rb:27 + def setup_heartbeat_timer; end +end + +# pkg:gem/actioncable#lib/action_cable/server/connections.rb:10 +ActionCable::Server::Connections::BEAT_INTERVAL = T.let(T.unsafe(nil), Integer) + +# Worker used by Server.send_async to do connection work in threads. +# +# pkg:gem/actioncable#lib/action_cable/server/worker.rb:10 +class ActionCable::Server::Worker + include ::ActiveSupport::Callbacks + include ::ActionCable::Server::Worker::ActiveRecordConnectionManagement + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:19 + def initialize(max_size: T.unsafe(nil)); end + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:11 + def __callbacks; end + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:11 + def __callbacks?; end + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:14 + def _run_work_callbacks(&block); end + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:14 + def _work_callbacks; end + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:46 + def async_exec(receiver, *args, connection:, &block); end + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:50 + def async_invoke(receiver, method, *args, connection: T.unsafe(nil), &block); end + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:13 + def connection; end + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:13 + def connection=(obj); end + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:17 + def executor; end + + # Stop processing work: any work that has not already started + # running will be discarded from the queue + # + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:30 + def halt; end + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:56 + def invoke(receiver, method, *args, connection:, &block); end + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:34 + def stopping?; end + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:38 + def work(connection, &block); end + + private + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:68 + def logger; end + + class << self + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:11 + def __callbacks; end + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:11 + def __callbacks=(value); end + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:11 + def __callbacks?; end + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:14 + def _work_callbacks; end + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:14 + def _work_callbacks=(value); end + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:13 + def connection; end + + # pkg:gem/actioncable#lib/action_cable/server/worker.rb:13 + def connection=(obj); end + end +end + +# pkg:gem/actioncable#lib/action_cable/server/worker/active_record_connection_management.rb:6 +module ActionCable::Server::Worker::ActiveRecordConnectionManagement + extend ::ActiveSupport::Concern + + # pkg:gem/actioncable#lib/action_cable/server/worker/active_record_connection_management.rb:15 + def with_database_connections(&block); end +end + +# pkg:gem/actioncable#lib/action_cable/subscription_adapter/async.rb:4 +module ActionCable::SubscriptionAdapter; end + +# pkg:gem/actioncable#lib/action_cable/subscription_adapter/async.rb:5 +class ActionCable::SubscriptionAdapter::Async < ::ActionCable::SubscriptionAdapter::Inline + private + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/async.rb:7 + def new_subscriber_map; end +end + +# pkg:gem/actioncable#lib/action_cable/subscription_adapter/async.rb:11 +class ActionCable::SubscriptionAdapter::Async::AsyncSubscriberMap < ::ActionCable::SubscriptionAdapter::SubscriberMap + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/async.rb:12 + def initialize(event_loop); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/async.rb:17 + def add_subscriber(*); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/async.rb:21 + def invoke_callback(*); end +end + +# pkg:gem/actioncable#lib/action_cable/subscription_adapter/base.rb:5 +class ActionCable::SubscriptionAdapter::Base + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/base.rb:8 + def initialize(server); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/base.rb:13 + def broadcast(channel, payload); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/base.rb:29 + def identifier; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/base.rb:6 + def logger; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/base.rb:6 + def server; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/base.rb:25 + def shutdown; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/base.rb:17 + def subscribe(channel, message_callback, success_callback = T.unsafe(nil)); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/base.rb:21 + def unsubscribe(channel, message_callback); end +end + +# pkg:gem/actioncable#lib/action_cable/subscription_adapter/channel_prefix.rb:5 +module ActionCable::SubscriptionAdapter::ChannelPrefix + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/channel_prefix.rb:6 + def broadcast(channel, payload); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/channel_prefix.rb:11 + def subscribe(channel, callback, success_callback = T.unsafe(nil)); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/channel_prefix.rb:16 + def unsubscribe(channel, callback); end + + private + + # Returns the channel name, including channel_prefix specified in cable.yml + # + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/channel_prefix.rb:23 + def channel_with_prefix(channel); end +end + +# pkg:gem/actioncable#lib/action_cable/subscription_adapter/inline.rb:5 +class ActionCable::SubscriptionAdapter::Inline < ::ActionCable::SubscriptionAdapter::Base + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/inline.rb:6 + def initialize(*); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/inline.rb:11 + def broadcast(channel, payload); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/inline.rb:23 + def shutdown; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/inline.rb:15 + def subscribe(channel, callback, success_callback = T.unsafe(nil)); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/inline.rb:19 + def unsubscribe(channel, callback); end + + private + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/inline.rb:32 + def new_subscriber_map; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/inline.rb:28 + def subscriber_map; end +end + +# pkg:gem/actioncable#lib/action_cable/subscription_adapter/postgresql.rb:9 +class ActionCable::SubscriptionAdapter::PostgreSQL < ::ActionCable::SubscriptionAdapter::Base + include ::ActionCable::SubscriptionAdapter::ChannelPrefix + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/postgresql.rb:12 + def initialize(*); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/postgresql.rb:17 + def broadcast(channel, payload); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/postgresql.rb:31 + def shutdown; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/postgresql.rb:23 + def subscribe(channel, callback, success_callback = T.unsafe(nil)); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/postgresql.rb:27 + def unsubscribe(channel, callback); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/postgresql.rb:50 + def with_broadcast_connection(&block); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/postgresql.rb:35 + def with_subscriptions_connection(&block); end + + private + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/postgresql.rb:59 + def channel_identifier(channel); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/postgresql.rb:63 + def listener; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/postgresql.rb:67 + def verify!(pg_conn); end +end + +# pkg:gem/actioncable#lib/action_cable/subscription_adapter/postgresql.rb:73 +class ActionCable::SubscriptionAdapter::PostgreSQL::Listener < ::ActionCable::SubscriptionAdapter::SubscriberMap + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/postgresql.rb:74 + def initialize(adapter, event_loop); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/postgresql.rb:118 + def add_channel(channel, on_success); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/postgresql.rb:126 + def invoke_callback(*); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/postgresql.rb:87 + def listen; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/postgresql.rb:122 + def remove_channel(channel); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/postgresql.rb:113 + def shutdown; end +end + +# pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:10 +class ActionCable::SubscriptionAdapter::Redis < ::ActionCable::SubscriptionAdapter::Base + include ::ActionCable::SubscriptionAdapter::ChannelPrefix + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:19 + def initialize(*); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:25 + def broadcast(channel, payload); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:41 + def redis_connection_for_subscriptions; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:15 + def redis_connector; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:15 + def redis_connector=(val); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:37 + def shutdown; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:29 + def subscribe(channel, callback, success_callback = T.unsafe(nil)); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:33 + def unsubscribe(channel, callback); end + + private + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:60 + def config_options; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:46 + def listener; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:56 + def redis_connection; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:50 + def redis_connection_for_broadcasts; end + + class << self + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:15 + def redis_connector; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:15 + def redis_connector=(val); end + end +end + +# pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:64 +class ActionCable::SubscriptionAdapter::Redis::Listener < ::ActionCable::SubscriptionAdapter::SubscriberMap + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:65 + def initialize(adapter, config_options, event_loop); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:138 + def add_channel(channel, on_success); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:152 + def invoke_callback(*); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:86 + def listen(conn); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:146 + def remove_channel(channel); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:125 + def shutdown; end + + private + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:157 + def ensure_listener_running; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:240 + def extract_subscribed_client(conn); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:201 + def reset; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:194 + def resubscribe; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:182 + def retry_connecting?; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:174 + def when_connected(&block); end +end + +# pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:210 +ActionCable::SubscriptionAdapter::Redis::Listener::ConnectionError = Redis::BaseConnectionError + +# pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:212 +class ActionCable::SubscriptionAdapter::Redis::Listener::SubscribedClient + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:213 + def initialize(raw_client); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:217 + def subscribe(*channel); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:221 + def unsubscribe(*channel); end + + private + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/redis.rb:226 + def send_command(*command); end +end + +# pkg:gem/actioncable#lib/action_cable/subscription_adapter/subscriber_map.rb:5 +class ActionCable::SubscriptionAdapter::SubscriberMap + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/subscriber_map.rb:6 + def initialize; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/subscriber_map.rb:47 + def add_channel(channel, on_success); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/subscriber_map.rb:11 + def add_subscriber(channel, subscriber, on_success); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/subscriber_map.rb:36 + def broadcast(channel, message); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/subscriber_map.rb:54 + def invoke_callback(callback, message); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/subscriber_map.rb:51 + def remove_channel(channel); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/subscriber_map.rb:25 + 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. +# +# pkg:gem/actioncable#lib/action_cable/subscription_adapter/test.rb:14 +class ActionCable::SubscriptionAdapter::Test < ::ActionCable::SubscriptionAdapter::Async + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/test.rb:15 + def broadcast(channel, payload); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/test.rb:20 + def broadcasts(channel); end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/test.rb:28 + def clear; end + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/test.rb:24 + def clear_messages(channel); end + + private + + # pkg:gem/actioncable#lib/action_cable/subscription_adapter/test.rb:33 + def channels_data; end +end + +# pkg:gem/actioncable#lib/action_cable/test_case.rb:6 +class ActionCable::TestCase < ::ActiveSupport::TestCase + include ::ActionCable::TestHelper +end + +# Provides helper methods for testing Action Cable broadcasting +# +# pkg:gem/actioncable#lib/action_cable/test_helper.rb:5 +module ActionCable::TestHelper + # pkg:gem/actioncable#lib/action_cable/test_helper.rb:16 + 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 + # + # pkg:gem/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. It returns the messages that were broadcasted. + # + # def test_broadcasts_again + # message = assert_broadcasts('messages', 1) do + # ActionCable.server.broadcast 'messages', { text: 'hello' } + # end + # assert_equal({ text: 'hello' }, message) + # + # messages = assert_broadcasts('messages', 2) 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 + # + # pkg:gem/actioncable#lib/action_cable/test_helper.rb:49 + 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 + # + # pkg:gem/actioncable#lib/action_cable/test_helper.rb:81 + def assert_no_broadcasts(stream, &block); end + + # pkg:gem/actioncable#lib/action_cable/test_helper.rb:6 + def before_setup; end + + # pkg:gem/actioncable#lib/action_cable/test_helper.rb:147 + def broadcasts(*, **, &); 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 + # + # pkg:gem/actioncable#lib/action_cable/test_helper.rb:97 + def capture_broadcasts(stream, &block); end + + # pkg:gem/actioncable#lib/action_cable/test_helper.rb:147 + def clear_messages(*, **, &); end + + # pkg:gem/actioncable#lib/action_cable/test_helper.rb:143 + def pubsub_adapter; end + + private + + # pkg:gem/actioncable#lib/action_cable/test_helper.rb:150 + def new_broadcasts_from(current_messages, stream, assertion, &block); end +end + +# pkg:gem/actioncable#lib/action_cable/gem_version.rb:9 +module ActionCable::VERSION; end + +# pkg:gem/actioncable#lib/action_cable/gem_version.rb:10 +ActionCable::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actioncable#lib/action_cable/gem_version.rb:11 +ActionCable::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actioncable#lib/action_cable/gem_version.rb:13 +ActionCable::VERSION::PRE = T.let(T.unsafe(nil), String) + +# pkg:gem/actioncable#lib/action_cable/gem_version.rb:15 +ActionCable::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/actioncable#lib/action_cable/gem_version.rb:12 +ActionCable::VERSION::TINY = T.let(T.unsafe(nil), Integer) diff --git a/sorbet/rbi/gems/actionmailbox@7.1.3.4.rbi b/sorbet/rbi/gems/actionmailbox@7.1.3.4.rbi new file mode 100644 index 000000000..f6b73f669 --- /dev/null +++ b/sorbet/rbi/gems/actionmailbox@7.1.3.4.rbi @@ -0,0 +1,891 @@ +# 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: actionmailbox/README.md +# +# pkg:gem/actionmailbox#lib/action_mailbox/gem_version.rb:3 +module ActionMailbox + extend ::ActiveSupport::Autoload + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:22 + def incinerate; end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:22 + def incinerate=(val); end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:23 + def incinerate_after; end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:23 + def incinerate_after=(val); end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:20 + def ingress; end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:20 + def ingress=(val); end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:21 + def logger; end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:21 + def logger=(val); end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:24 + def queues; end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:24 + def queues=(val); end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:25 + def storage_service; end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:25 + def storage_service=(val); end + + class << self + # pkg:gem/actionmailbox#lib/action_mailbox/deprecator.rb:4 + def deprecator; end + + # Returns the currently loaded version of Action Mailbox as a +Gem::Version+. + # + # pkg:gem/actionmailbox#lib/action_mailbox/gem_version.rb:5 + def gem_version; end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:22 + def incinerate; end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:22 + def incinerate=(val); end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:23 + def incinerate_after; end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:23 + def incinerate_after=(val); end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:20 + def ingress; end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:20 + def ingress=(val); end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:21 + def logger; end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:21 + def logger=(val); end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:24 + def queues; end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:24 + def queues=(val); end + + # pkg:gem/actionmailbox#lib/action_mailbox/engine.rb:13 + def railtie_helpers_paths; end + + # pkg:gem/actionmailbox#lib/action_mailbox/engine.rb:13 + def railtie_namespace; end + + # pkg:gem/actionmailbox#lib/action_mailbox/engine.rb:13 + def railtie_routes_url_helpers(include_path_helpers = T.unsafe(nil)); end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:25 + def storage_service; end + + # pkg:gem/actionmailbox#lib/action_mailbox.rb:25 + def storage_service=(val); end + + # pkg:gem/actionmailbox#lib/action_mailbox/engine.rb:13 + def table_name_prefix; end + + # pkg:gem/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+. + # + # pkg:gem/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 +# +# pkg:gem/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 + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:79 + def initialize(inbound_email); end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:68 + def __callbacks; end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:68 + def __callbacks?; end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:68 + def _process_callbacks; end + + # pkg:gem/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+. + # + # pkg:gem/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+. + # + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:105 + def bounce_with(message); end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:71 + def bounced!(*, **, &); end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:71 + def delivered!(*, **, &); end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:100 + def finished_processing?; end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:70 + def inbound_email; end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:73 + def logger(&block); end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:71 + def mail(*, **, &); end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:83 + def perform_processing; end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:96 + def process; end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:67 + def rescue_handlers; end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:67 + def rescue_handlers=(_arg0); end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:67 + def rescue_handlers?; end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:68 + def router; end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:68 + def router=(val); end + + private + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:117 + def instrumentation_payload; end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:124 + def track_status_of_inbound_email; end + + class << self + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:68 + def __callbacks; end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:68 + def __callbacks=(value); end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:68 + def __callbacks?; end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:68 + def _process_callbacks; end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:68 + def _process_callbacks=(value); end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:75 + def receive(inbound_email); end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:67 + def rescue_handlers; end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:67 + def rescue_handlers=(value); end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:67 + def rescue_handlers?; end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:68 + def router; end + + # pkg:gem/actionmailbox#lib/action_mailbox/base.rb:68 + def router=(val); end + end +end + +class ActionMailbox::BaseController < ::ActionController::Base + private + + def _layout(lookup_context, formats); end + def authenticate_by_password; end + def ensure_configured; end + def ingress_name; end + def password; end + + class << self + def __callbacks; end + def middleware_stack; end + end +end + +# = Action Mailbox \Callbacks +# +# Defines the callbacks related to processing. +# +# pkg:gem/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 + def __callbacks?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def __callbacks?; end + end +end + +# pkg:gem/actionmailbox#lib/action_mailbox/callbacks.rb:22 +module ActionMailbox::Callbacks::ClassMethods + # pkg:gem/actionmailbox#lib/action_mailbox/callbacks.rb:27 + def after_processing(*methods, &block); end + + # pkg:gem/actionmailbox#lib/action_mailbox/callbacks.rb:31 + def around_processing(*methods, &block); end + + # pkg:gem/actionmailbox#lib/action_mailbox/callbacks.rb:23 + def before_processing(*methods, &block); end +end + +# pkg:gem/actionmailbox#lib/action_mailbox/callbacks.rb:13 +ActionMailbox::Callbacks::TERMINATOR = T.let(T.unsafe(nil), Proc) + +# pkg:gem/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 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 +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 queue_name; end + def rescue_handlers; end + def schedule(inbound_email); 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); end + def authenticate; end + def authenticated?; end + def key; end + def mail; end + + class << self + def __callbacks; end + def middleware_stack; 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); end + def authenticate; end + def authenticated?; end + def events; end + def key; end + def raw_emails; end + + class << self + def __callbacks; end + def middleware_stack; 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); end + + class << self + def __callbacks; end + def middleware_stack; end + end +end + +module ActionMailbox::Ingresses::Relay; end + +class ActionMailbox::Ingresses::Relay::InboundEmailsController < ::ActionMailbox::BaseController + def create; end + + private + + def _layout(lookup_context, formats); end + def require_valid_rfc822_message; end + + class << self + def __callbacks; end + def middleware_stack; end + end +end + +module ActionMailbox::Ingresses::Sendgrid; end + +class ActionMailbox::Ingresses::Sendgrid::InboundEmailsController < ::ActionMailbox::BaseController + def create; end + + private + + def _layout(lookup_context, formats); end + def envelope; end + def mail; end + + class << self + def __callbacks; end + def middleware_stack; end + end +end + +class ActionMailbox::Record < ::ActiveRecord::Base + include ::ActionMailbox::Record::GeneratedAttributeMethods + include ::ActionMailbox::Record::GeneratedAssociationMethods +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. +# +# pkg:gem/actionmailbox#lib/action_mailbox/router.rb:8 +class ActionMailbox::Router + # pkg:gem/actionmailbox#lib/action_mailbox/router.rb:11 + def initialize; end + + # pkg:gem/actionmailbox#lib/action_mailbox/router.rb:21 + def add_route(address, to:); end + + # pkg:gem/actionmailbox#lib/action_mailbox/router.rb:15 + def add_routes(routes); end + + # pkg:gem/actionmailbox#lib/action_mailbox/router.rb:35 + def mailbox_for(inbound_email); end + + # pkg:gem/actionmailbox#lib/action_mailbox/router.rb:25 + def route(inbound_email); end + + private + + # pkg:gem/actionmailbox#lib/action_mailbox/router.rb:40 + def routes; end +end + +# Encapsulates a route, which can then be matched against an inbound_email and provide a lookup of the matching +# mailbox class. See examples for the different route addresses and how to use them in the ActionMailbox::Base +# documentation. +# +# pkg:gem/actionmailbox#lib/action_mailbox/router/route.rb:7 +class ActionMailbox::Router::Route + # pkg:gem/actionmailbox#lib/action_mailbox/router/route.rb:10 + def initialize(address, to:); end + + # pkg:gem/actionmailbox#lib/action_mailbox/router/route.rb:8 + def address; end + + # pkg:gem/actionmailbox#lib/action_mailbox/router/route.rb:31 + def mailbox_class; end + + # pkg:gem/actionmailbox#lib/action_mailbox/router/route.rb:8 + def mailbox_name; end + + # pkg:gem/actionmailbox#lib/action_mailbox/router/route.rb:16 + def match?(inbound_email); end + + private + + # pkg:gem/actionmailbox#lib/action_mailbox/router/route.rb:36 + def ensure_valid_address; end +end + +# pkg:gem/actionmailbox#lib/action_mailbox/router.rb:9 +class ActionMailbox::Router::RoutingError < ::StandardError; end + +# See ActionMailbox::Base for how to specify routing. +# +# pkg:gem/actionmailbox#lib/action_mailbox/routing.rb:5 +module ActionMailbox::Routing + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionMailbox::Routing::ClassMethods +end + +# pkg:gem/actionmailbox#lib/action_mailbox/routing.rb:12 +module ActionMailbox::Routing::ClassMethods + # pkg:gem/actionmailbox#lib/action_mailbox/routing.rb:21 + def mailbox_for(inbound_email); end + + # pkg:gem/actionmailbox#lib/action_mailbox/routing.rb:17 + def route(inbound_email); end + + # pkg:gem/actionmailbox#lib/action_mailbox/routing.rb:13 + def routing(routes); end +end + +class ActionMailbox::RoutingJob < ::ActiveJob::Base + def perform(inbound_email); end + + class << self + def queue_name; end + end +end + +# pkg:gem/actionmailbox#lib/action_mailbox/test_case.rb:7 +class ActionMailbox::TestCase < ::ActiveSupport::TestCase + include ::ActionMailbox::TestHelper +end + +# pkg:gem/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+. + # + # pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/actionmailbox#lib/action_mailbox/test_helper.rb:91 + def receive_inbound_email_from_source(*args); end +end + +# pkg:gem/actionmailbox#lib/action_mailbox/gem_version.rb:9 +module ActionMailbox::VERSION; end + +# pkg:gem/actionmailbox#lib/action_mailbox/gem_version.rb:10 +ActionMailbox::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionmailbox#lib/action_mailbox/gem_version.rb:11 +ActionMailbox::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionmailbox#lib/action_mailbox/gem_version.rb:13 +ActionMailbox::VERSION::PRE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionmailbox#lib/action_mailbox/gem_version.rb:15 +ActionMailbox::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/actionmailbox#lib/action_mailbox/gem_version.rb:12 +ActionMailbox::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionmailbox#lib/action_mailbox/mail_ext/address_equality.rb:3 +module Mail + class << self + # pkg:gem/actionmailbox#lib/action_mailbox/mail_ext/from_source.rb:4 + def from_source(source); end + end +end + +# pkg:gem/actionmailbox#lib/action_mailbox/mail_ext/address_equality.rb:4 +class Mail::Address + # pkg:gem/actionmailbox#lib/action_mailbox/mail_ext/address_equality.rb:5 + def ==(other_address); end + + class << self + # pkg:gem/actionmailbox#lib/action_mailbox/mail_ext/address_wrapping.rb:5 + def wrap(address); end + end +end + +# pkg:gem/actionmailbox#lib/action_mailbox/mail_ext/addresses.rb:4 +class Mail::Message + # pkg:gem/actionmailbox#lib/action_mailbox/mail_ext/addresses.rb:21 + def bcc_addresses; end + + # pkg:gem/actionmailbox#lib/action_mailbox/mail_ext/addresses.rb:17 + def cc_addresses; end + + # pkg:gem/actionmailbox#lib/action_mailbox/mail_ext/addresses.rb:5 + def from_address; end + + # pkg:gem/actionmailbox#lib/action_mailbox/mail_ext/recipients.rb:5 + def recipients; end + + # pkg:gem/actionmailbox#lib/action_mailbox/mail_ext/addresses.rb:9 + def recipients_addresses; end + + # pkg:gem/actionmailbox#lib/action_mailbox/mail_ext/addresses.rb:13 + def to_addresses; end + + # pkg:gem/actionmailbox#lib/action_mailbox/mail_ext/addresses.rb:29 + def x_forwarded_to_addresses; end + + # pkg:gem/actionmailbox#lib/action_mailbox/mail_ext/addresses.rb:25 + def x_original_to_addresses; end + + private + + # pkg:gem/actionmailbox#lib/action_mailbox/mail_ext/addresses.rb:34 + 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); end + + class << self + def middleware_stack; 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); end + def create_inbound_email(mail); end + def mail_params; end + def new_mail; end + + class << self + def middleware_stack; end + end +end + +class Rails::Conductor::ActionMailbox::IncineratesController < ::Rails::Conductor::BaseController + def create; end + + private + + def _layout(lookup_context, formats); end + + class << self + def middleware_stack; end + end +end + +class Rails::Conductor::ActionMailbox::ReroutesController < ::Rails::Conductor::BaseController + def create; end + + private + + def _layout(lookup_context, formats); end + def reroute(inbound_email); end + + class << self + def middleware_stack; end + end +end + +class Rails::Conductor::BaseController < ::ActionController::Base + private + + def _layout(lookup_context, formats); end + def ensure_development_env; end + + class << self + def __callbacks; end + def _layout; end + def _layout_conditions; end + def middleware_stack; end + end +end diff --git a/sorbet/rbi/gems/actionmailer@7.1.3.4.rbi b/sorbet/rbi/gems/actionmailer@7.1.3.4.rbi new file mode 100644 index 000000000..12935b51f --- /dev/null +++ b/sorbet/rbi/gems/actionmailer@7.1.3.4.rbi @@ -0,0 +1,2618 @@ +# 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: actionmailer/README.rdoc +# +# pkg:gem/actionmailer#lib/action_mailer/gem_version.rb:3 +module ActionMailer + extend ::ActiveSupport::Autoload + + class << self + # pkg:gem/actionmailer#lib/action_mailer/deprecator.rb:4 + def deprecator; end + + # pkg:gem/actionmailer#lib/action_mailer.rb:61 + def eager_load!; end + + # Returns the currently loaded version of Action Mailer as a +Gem::Version+. + # + # pkg:gem/actionmailer#lib/action_mailer/gem_version.rb:5 + def gem_version; end + + # Returns the currently loaded version of Action Mailer as a + # +Gem::Version+. + # + # pkg:gem/actionmailer#lib/action_mailer/version.rb:8 + def version; 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. +# +# pkg:gem/actionmailer#lib/action_mailer/base.rb:476 +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 ::ActiveSupport::Deprecation::DeprecatedConstantAccessor + 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 + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:644 + def initialize; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:477 + def __callbacks; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:477 + def __callbacks?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:477 + def _deliver_callbacks; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:490 + def _helper_methods; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:490 + def _helper_methods=(_arg0); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:490 + def _helper_methods?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:496 + def _layout_conditions(&block); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:493 + def _process_action_callbacks; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:477 + def _run_deliver_callbacks(&block); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:493 + def _run_process_action_callbacks(&block); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def _view_cache_dependencies; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def _view_cache_dependencies=(_arg0); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def _view_cache_dependencies?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def asset_host; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def asset_host=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def assets_dir; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def assets_dir=(value); 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) + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:761 + def attachments; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def default_asset_host_protocol; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def default_asset_host_protocol=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:502 + def default_params; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:502 + def default_params=(_arg0); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:502 + def default_params?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def default_static_extension; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def default_static_extension=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:479 + def deliver_later_queue_name; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:479 + def deliver_later_queue_name=(_arg0); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:479 + def deliver_later_queue_name?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:479 + def delivery_job; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:479 + def delivery_job=(_arg0); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:479 + def delivery_job?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def delivery_method; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def delivery_method=(_arg0); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def delivery_method?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def delivery_methods; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def delivery_methods=(_arg0); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def delivery_methods?; end + + # Returns an email in the format "Name ". + # + # If the name is a blank string, it returns just the address. + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:685 + def email_address_with_name(address, name); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def enable_fragment_cache_logging; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def enable_fragment_cache_logging=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def file_settings; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def file_settings=(_arg0); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def file_settings?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def fragment_cache_keys; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def fragment_cache_keys=(_arg0); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + 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. + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:723 + def headers(args = T.unsafe(nil)); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def javascripts_dir; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def javascripts_dir=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:489 + def logger; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:489 + def logger=(value); 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 + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:870 + def mail(headers = T.unsafe(nil), &block); end + + # Returns the name of the mailer object. + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:678 + def mailer_name; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:642 + def message; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:642 + def message=(_arg0); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:481 + def params; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:481 + def params=(_arg0); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def perform_caching; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def perform_caching=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def perform_deliveries; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def perform_deliveries=(val); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:482 + def preview_interceptors; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:482 + def preview_paths; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:650 + def process(method_name, *args, **); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def raise_delivery_errors; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def raise_delivery_errors=(val); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:493 + def raise_on_missing_callback_actions; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:493 + def raise_on_missing_callback_actions=(val); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def relative_url_root; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def relative_url_root=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:480 + def rescue_handlers; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:480 + def rescue_handlers=(_arg0); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:480 + def rescue_handlers?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def sendmail_settings; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def sendmail_settings=(_arg0); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def sendmail_settings?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:482 + def show_previews; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def smtp_settings; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def smtp_settings=(_arg0); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def smtp_settings?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def stylesheets_dir; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def stylesheets_dir=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def test_settings; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def test_settings=(_arg0); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def test_settings?; end + + private + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:496 + def _layout(lookup_context, formats); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:1071 + def _protected_ivars; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:947 + def apply_defaults(headers); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:967 + def assign_headers_to_message(message, headers); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:973 + def collect_responses(headers, &block); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:983 + def collect_responses_from_block(headers); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:997 + def collect_responses_from_templates(headers); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:990 + def collect_responses_from_text(headers); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:957 + def compute_default(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:1040 + 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. + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:937 + def default_i18n_subject(interpolations = T.unsafe(nil)); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:1010 + def each_template(paths, name, &block); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:1053 + def insert_part(container, response, charset); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:1067 + def instrument_name; end + + # This and #instrument_name is for caching instrument + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:1060 + 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. + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:915 + def set_content_type(m, user_content_type, class_default); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:1019 + def wrap_inline_attachments(message); end + + class << self + # pkg:gem/actionmailer#lib/action_mailer/base.rb:477 + def __callbacks; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:477 + def __callbacks=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:477 + def __callbacks?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:483 + def _default_form_builder; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:483 + def _default_form_builder=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:483 + def _default_form_builder?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:477 + def _deliver_callbacks; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:477 + def _deliver_callbacks=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:490 + def _helper_methods; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:490 + def _helper_methods=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:490 + def _helper_methods?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:490 + def _helpers; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:496 + def _layout; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:496 + def _layout=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:496 + def _layout?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:496 + def _layout_conditions; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:496 + def _layout_conditions=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:496 + def _layout_conditions?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:493 + def _process_action_callbacks; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:493 + def _process_action_callbacks=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def _view_cache_dependencies; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def _view_cache_dependencies=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def _view_cache_dependencies?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def asset_host; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def asset_host=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def assets_dir; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def assets_dir=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:575 + def controller_path; end + + # Sets the defaults through app configuration: + # + # config.action_mailer.default(from: "no-reply@example.org") + # + # Aliased by ::default_options= + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:582 + def default(value = T.unsafe(nil)); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def default_asset_host_protocol; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def default_asset_host_protocol=(value); end + + # Allows to set defaults through app configuration: + # + # config.action_mailer.default_options = { from: "no-reply@example.org" } + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:589 + def default_options=(value = T.unsafe(nil)); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:502 + def default_params; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:502 + def default_params=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:502 + def default_params?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def default_static_extension; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def default_static_extension=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:479 + def deliver_later_queue_name; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:479 + def deliver_later_queue_name=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:479 + 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. + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:597 + def deliver_mail(mail); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:479 + def delivery_job; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:479 + def delivery_job=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:479 + def delivery_job?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def delivery_method; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def delivery_method=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def delivery_method?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def delivery_methods; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def delivery_methods=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def delivery_methods?; end + + # Returns an email in the format "Name ". + # + # If the name is a blank string, it returns just the address. + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:607 + def email_address_with_name(address, name); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def enable_fragment_cache_logging; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def enable_fragment_cache_logging=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def file_settings; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def file_settings=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def file_settings?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def fragment_cache_keys; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def fragment_cache_keys=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def fragment_cache_keys?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def javascripts_dir; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def javascripts_dir=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:489 + def logger; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:489 + def logger=(value); 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. + # Allows to set the name of current mailer. + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:570 + def mailer_name; 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. + # Allows to set the name of current mailer. + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:574 + def mailer_name=(_arg0); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def perform_caching; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def perform_caching=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def perform_deliveries; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def perform_deliveries=(val); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:482 + def preview_interceptors; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:482 + def preview_interceptors=(val); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:482 + def preview_paths; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:482 + def preview_paths=(val); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def raise_delivery_errors; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def raise_delivery_errors=(val); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:493 + def raise_on_missing_callback_actions; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:493 + 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. + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:547 + def register_interceptor(interceptor); end + + # Register one or more Interceptors which will be called before mail is sent. + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:521 + 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. + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:533 + def register_observer(observer); end + + # Register one or more Observers which will be notified when mail is delivered. + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:511 + def register_observers(*observers); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def relative_url_root; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def relative_url_root=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:480 + def rescue_handlers; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:480 + def rescue_handlers=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:480 + def rescue_handlers?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def sendmail_settings; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def sendmail_settings=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def sendmail_settings?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:482 + def show_previews; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:482 + def show_previews=(val); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def smtp_settings; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def smtp_settings=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def smtp_settings?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def stylesheets_dir; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:492 + def stylesheets_dir=(value); end + + # Emails do not support relative path links. + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:943 + def supports_path?; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def test_settings; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + def test_settings=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:478 + 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. + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:554 + def unregister_interceptor(interceptor); end + + # Unregister one or more previously registered Interceptors. + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:526 + 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. + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:540 + def unregister_observer(observer); end + + # Unregister one or more previously registered Observers. + # + # pkg:gem/actionmailer#lib/action_mailer/base.rb:516 + def unregister_observers(*observers); end + + private + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:628 + def method_missing(method_name, *args, **); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:558 + def observer_class_for(value); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:637 + def respond_to_missing?(method, include_all = T.unsafe(nil)); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:615 + def set_payload_for_mail(payload, mail); end + end +end + +# pkg:gem/actionmailer#lib/action_mailer/base.rb:490 +module ActionMailer::Base::HelperMethods + include ::ActionMailer::MailHelper + include ::ActionText::ContentHelper + include ::ActionText::TagHelper + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def combined_fragment_cache_key(*args, **, &block); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:494 + def view_cache_dependencies(*args, **, &block); end +end + +# pkg:gem/actionmailer#lib/action_mailer/base.rb:769 +class ActionMailer::Base::LateAttachmentsProxy < ::SimpleDelegator + # pkg:gem/actionmailer#lib/action_mailer/base.rb:771 + def []=(_name, _content); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:770 + def inline; end + + private + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:774 + def _raise_error; end +end + +# pkg:gem/actionmailer#lib/action_mailer/base.rb:664 +class ActionMailer::Base::NullMail + # pkg:gem/actionmailer#lib/action_mailer/base.rb:665 + def body; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:666 + def header; end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:672 + def method_missing(*args); end + + # pkg:gem/actionmailer#lib/action_mailer/base.rb:668 + def respond_to?(string, include_all = T.unsafe(nil)); end +end + +# pkg:gem/actionmailer#lib/action_mailer/base.rb:498 +ActionMailer::Base::PROTECTED_IVARS = T.let(T.unsafe(nil), Array) + +# pkg:gem/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 + def __callbacks?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def __callbacks?; end + end +end + +# pkg:gem/actionmailer#lib/action_mailer/callbacks.rb:12 +module ActionMailer::Callbacks::ClassMethods + # Defines a callback that will get called right after the + # message's delivery method is finished. + # + # pkg:gem/actionmailer#lib/action_mailer/callbacks.rb:21 + def after_deliver(*filters, &blk); end + + # Defines a callback that will get called around the message's deliver method. + # + # pkg:gem/actionmailer#lib/action_mailer/callbacks.rb:26 + def around_deliver(*filters, &blk); end + + # Defines a callback that will get called right before the + # message is sent to the delivery method. + # + # pkg:gem/actionmailer#lib/action_mailer/callbacks.rb:15 + def before_deliver(*filters, &blk); end +end + +# pkg:gem/actionmailer#lib/action_mailer/collector.rb:8 +class ActionMailer::Collector + include ::AbstractController::Collector + + # pkg:gem/actionmailer#lib/action_mailer/collector.rb:12 + def initialize(context, &block); end + + # pkg:gem/actionmailer#lib/action_mailer/collector.rb:23 + def all(*args, &block); end + + # pkg:gem/actionmailer#lib/action_mailer/collector.rb:18 + def any(*args, &block); end + + # pkg:gem/actionmailer#lib/action_mailer/collector.rb:25 + def custom(mime, options = T.unsafe(nil)); end + + # pkg:gem/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. +# +# pkg:gem/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 + + # pkg:gem/actionmailer#lib/action_mailer/delivery_methods.rb:80 + 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. +# +# pkg:gem/actionmailer#lib/action_mailer/delivery_methods.rb:42 +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 ] + # + # pkg:gem/actionmailer#lib/action_mailer/delivery_methods.rb:52 + def add_delivery_method(symbol, klass, default_options = T.unsafe(nil)); end + + # pkg:gem/actionmailer#lib/action_mailer/delivery_methods.rb:44 + def deliveries(&block); end + + # pkg:gem/actionmailer#lib/action_mailer/delivery_methods.rb:44 + def deliveries=(arg); end + + # pkg:gem/actionmailer#lib/action_mailer/delivery_methods.rb:58 + 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+. +# +# pkg:gem/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 + # + # pkg:gem/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 + +# pkg:gem/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, an instance of ActionView::Helpers::FormBuilder + # + # pkg:gem/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) +# +# pkg:gem/actionmailer#lib/action_mailer/inline_preview_interceptor.rb:17 +class ActionMailer::InlinePreviewInterceptor + include ::Base64 + + # pkg:gem/actionmailer#lib/action_mailer/inline_preview_interceptor.rb:26 + def initialize(message); end + + # pkg:gem/actionmailer#lib/action_mailer/inline_preview_interceptor.rb:30 + def transform!; end + + private + + # pkg:gem/actionmailer#lib/action_mailer/inline_preview_interceptor.rb:51 + def data_url(part); end + + # pkg:gem/actionmailer#lib/action_mailer/inline_preview_interceptor.rb:55 + def find_part(cid); end + + # pkg:gem/actionmailer#lib/action_mailer/inline_preview_interceptor.rb:47 + def html_part; end + + # pkg:gem/actionmailer#lib/action_mailer/inline_preview_interceptor.rb:45 + def message; end + + class << self + # pkg:gem/actionmailer#lib/action_mailer/inline_preview_interceptor.rb:22 + def previewing_email(message); end + end +end + +# pkg:gem/actionmailer#lib/action_mailer/inline_preview_interceptor.rb:18 +ActionMailer::InlinePreviewInterceptor::PATTERN = T.let(T.unsafe(nil), Regexp) + +# = Action Mailer \LogSubscriber +# +# Implements the ActiveSupport::LogSubscriber for logging notifications when +# email is delivered or received. +# +# pkg:gem/actionmailer#lib/action_mailer/log_subscriber.rb:10 +class ActionMailer::LogSubscriber < ::ActiveSupport::LogSubscriber + # An email was delivered. + # + # pkg:gem/actionmailer#lib/action_mailer/log_subscriber.rb:12 + def deliver(event); end + + # Use the logger configured for ActionMailer::Base. + # + # pkg:gem/actionmailer#lib/action_mailer/log_subscriber.rb:38 + def logger; end + + # An email was generated. + # + # pkg:gem/actionmailer#lib/action_mailer/log_subscriber.rb:28 + def process(event); end + + class << self + # pkg:gem/actionmailer#lib/action_mailer/log_subscriber.rb:25 + def log_levels; 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. +# +# pkg:gem/actionmailer#lib/action_mailer/mail_delivery_job.rb:13 +class ActionMailer::MailDeliveryJob < ::ActiveJob::Base + # pkg:gem/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 + + # pkg:gem/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. + # + # pkg:gem/actionmailer#lib/action_mailer/mail_delivery_job.rb:34 + def mailer_class; end + + class << self + # pkg:gem/actionmailer#lib/action_mailer/mail_delivery_job.rb:14 + def queue_name; end + + # pkg:gem/actionmailer#lib/action_mailer/mail_delivery_job.rb:19 + def rescue_handlers; 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. +# +# pkg:gem/actionmailer#lib/action_mailer/mail_helper.rb:9 +module ActionMailer::MailHelper + # Access the message attachments list. + # + # pkg:gem/actionmailer#lib/action_mailer/mail_helper.rb:45 + 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" + # + # pkg:gem/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" + # + # pkg:gem/actionmailer#lib/action_mailer/mail_helper.rb:57 + def format_paragraph(text, len = T.unsafe(nil), indent = T.unsafe(nil)); end + + # Access the mailer instance. + # + # pkg:gem/actionmailer#lib/action_mailer/mail_helper.rb:35 + def mailer; end + + # Access the message instance. + # + # pkg:gem/actionmailer#lib/action_mailer/mail_helper.rb:40 + 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 +# +# pkg:gem/actionmailer#lib/action_mailer/message_delivery.rb:19 +class ActionMailer::MessageDelivery + # pkg:gem/actionmailer#lib/action_mailer/message_delivery.rb:20 + def initialize(mailer_class, action, *args, **); end + + # Method calls are delegated to the Mail::Message that's ready to deliver. + # + # pkg:gem/actionmailer#lib/action_mailer/message_delivery.rb:31 + def __getobj__; end + + # Unused except for delegator internals (dup, marshalling). + # + # pkg:gem/actionmailer#lib/action_mailer/message_delivery.rb:36 + def __setobj__(mail_message); 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 + # + # pkg:gem/actionmailer#lib/action_mailer/message_delivery.rb:102 + 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 + # + # pkg:gem/actionmailer#lib/action_mailer/message_delivery.rb:75 + def deliver_later!(options = T.unsafe(nil)); end + + # Delivers an email: + # + # Notifier.welcome(User.first).deliver_now + # + # pkg:gem/actionmailer#lib/action_mailer/message_delivery.rb:123 + 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! + # + # pkg:gem/actionmailer#lib/action_mailer/message_delivery.rb:111 + def deliver_now!; end + + # Returns the resulting Mail::Message + # + # pkg:gem/actionmailer#lib/action_mailer/message_delivery.rb:41 + def message; end + + # Was the delegate loaded, causing the mailer action to be processed? + # + # pkg:gem/actionmailer#lib/action_mailer/message_delivery.rb:46 + def processed?; end + + private + + # pkg:gem/actionmailer#lib/action_mailer/message_delivery.rb:140 + 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. + # + # pkg:gem/actionmailer#lib/action_mailer/message_delivery.rb:134 + def processed_mailer; end +end + +# pkg:gem/actionmailer#lib/action_mailer/test_case.rb:7 +class ActionMailer::NonInferrableMailerError < ::StandardError + # pkg:gem/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 +# +# pkg:gem/actionmailer#lib/action_mailer/parameterized.rb:89 +module ActionMailer::Parameterized + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionMailer::Parameterized::ClassMethods +end + +# pkg:gem/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. + # + # pkg:gem/actionmailer#lib/action_mailer/parameterized.rb:106 + def with(params); end +end + +# pkg:gem/actionmailer#lib/action_mailer/parameterized.rb:111 +class ActionMailer::Parameterized::Mailer + # pkg:gem/actionmailer#lib/action_mailer/parameterized.rb:112 + def initialize(mailer, params); end + + private + + # pkg:gem/actionmailer#lib/action_mailer/parameterized.rb:117 + def method_missing(method_name, *args, **); end + + # pkg:gem/actionmailer#lib/action_mailer/parameterized.rb:126 + def respond_to_missing?(method, include_all = T.unsafe(nil)); end +end + +# pkg:gem/actionmailer#lib/action_mailer/parameterized.rb:131 +class ActionMailer::Parameterized::MessageDelivery < ::ActionMailer::MessageDelivery + # pkg:gem/actionmailer#lib/action_mailer/parameterized.rb:132 + def initialize(mailer_class, action, params, *args, **); end + + private + + # pkg:gem/actionmailer#lib/action_mailer/parameterized.rb:146 + def enqueue_delivery(delivery_method, options = T.unsafe(nil)); end + + # pkg:gem/actionmailer#lib/action_mailer/parameterized.rb:139 + def processed_mailer; end +end + +# pkg:gem/actionmailer#lib/action_mailer/preview.rb:93 +class ActionMailer::Preview + extend ::ActiveSupport::DescendantsTracker + + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:98 + def initialize(params = T.unsafe(nil)); end + + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:96 + def params; end + + class << self + # Returns all mailer preview classes. + # + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:104 + 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. + # + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:112 + def call(email, params = T.unsafe(nil)); end + + # Returns +true+ if the email exists. + # + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:125 + def email_exists?(email); end + + # Returns all of the available email previews. + # + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:120 + def emails; end + + # Returns +true+ if the preview exists. + # + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:130 + def exists?(preview); end + + # Find a mailer preview by its underscored class name. + # + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:135 + def find(preview); end + + # Returns the underscored name of the mailer preview without the suffix. + # + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:140 + def preview_name; end + + private + + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:159 + def inform_preview_interceptors(message); end + + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:145 + def load_previews; end + + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:151 + def preview_paths; end + + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:155 + def show_previews; end + end +end + +# pkg:gem/actionmailer#lib/action_mailer/preview.rb:6 +module ActionMailer::Previews + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionMailer::Previews::ClassMethods + + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:28 + def preview_path; end +end + +# pkg:gem/actionmailer#lib/action_mailer/preview.rb:36 +module ActionMailer::Previews::ClassMethods + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:45 + def preview_path; end + + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:37 + def preview_path=(value); end + + # 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. + # + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:66 + def register_preview_interceptor(interceptor); end + + # Register one or more Interceptors which will be called before mail is previewed. + # + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:54 + 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. + # + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:77 + def unregister_preview_interceptor(interceptor); end + + # Unregister one or more previously registered Interceptors. + # + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:59 + def unregister_preview_interceptors(*interceptors); end + + private + + # pkg:gem/actionmailer#lib/action_mailer/preview.rb:82 + def interceptor_class_for(interceptor); end +end + +# pkg:gem/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 + +# pkg:gem/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. +# +# pkg:gem/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 + + # pkg:gem/actionmailer#lib/action_mailer/rescuable.rb:20 + def handle_exceptions; end + + private + + # pkg:gem/actionmailer#lib/action_mailer/rescuable.rb:27 + def process(*, **, &); 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 + +# pkg:gem/actionmailer#lib/action_mailer/rescuable.rb:14 +module ActionMailer::Rescuable::ClassMethods + # pkg:gem/actionmailer#lib/action_mailer/rescuable.rb:15 + def handle_exception(exception); end +end + +# pkg:gem/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 + + # pkg:gem/actionmailer#lib/action_mailer/test_case.rb:41 + def _mailer_class; end + + # pkg:gem/actionmailer#lib/action_mailer/test_case.rb:41 + def _mailer_class=(_arg0); end + + # pkg:gem/actionmailer#lib/action_mailer/test_case.rb:41 + def _mailer_class?; end + + class << self + # pkg:gem/actionmailer#lib/action_mailer/test_case.rb:42 + def __callbacks; end + + # pkg:gem/actionmailer#lib/action_mailer/test_case.rb:41 + def _mailer_class; end + + # pkg:gem/actionmailer#lib/action_mailer/test_case.rb:41 + def _mailer_class=(value); end + + # pkg:gem/actionmailer#lib/action_mailer/test_case.rb:41 + def _mailer_class?; end + end +end + +# pkg:gem/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 + # + # pkg:gem/actionmailer#lib/action_mailer/test_case.rb:82 + def read_fixture(action); end + + private + + # pkg:gem/actionmailer#lib/action_mailer/test_case.rb:115 + def charset; end + + # pkg:gem/actionmailer#lib/action_mailer/test_case.rb:119 + def encode(subject); end + + # pkg:gem/actionmailer#lib/action_mailer/test_case.rb:87 + def initialize_test_deliveries; end + + # pkg:gem/actionmailer#lib/action_mailer/test_case.rb:104 + def restore_delivery_method; end + + # pkg:gem/actionmailer#lib/action_mailer/test_case.rb:94 + def restore_test_deliveries; end + + # pkg:gem/actionmailer#lib/action_mailer/test_case.rb:99 + def set_delivery_method(method); end + + # pkg:gem/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 + +# pkg:gem/actionmailer#lib/action_mailer/test_case.rb:48 +module ActionMailer::TestCase::Behavior::ClassMethods + # pkg:gem/actionmailer#lib/action_mailer/test_case.rb:68 + def determine_default_mailer(name); end + + # pkg:gem/actionmailer#lib/action_mailer/test_case.rb:60 + def mailer_class; end + + # pkg:gem/actionmailer#lib/action_mailer/test_case.rb:49 + def tests(mailer); end +end + +# pkg:gem/actionmailer#lib/action_mailer/test_case.rb:16 +module ActionMailer::TestCase::ClearTestDeliveries + extend ::ActiveSupport::Concern + + private + + # pkg:gem/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. +# +# pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/actionmailer#lib/action_mailer/test_helper.rb:211 + 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 + # + # pkg:gem/actionmailer#lib/action_mailer/test_helper.rb:269 + 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. + # + # pkg:gem/actionmailer#lib/action_mailer/test_helper.rb:251 + def deliver_enqueued_emails(queue: T.unsafe(nil), at: T.unsafe(nil), &block); end + + private + + # pkg:gem/actionmailer#lib/action_mailer/test_helper.rb:278 + def delivery_job_filter(job); end +end + +# pkg:gem/actionmailer#lib/action_mailer/gem_version.rb:9 +module ActionMailer::VERSION; end + +# pkg:gem/actionmailer#lib/action_mailer/gem_version.rb:10 +ActionMailer::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionmailer#lib/action_mailer/gem_version.rb:11 +ActionMailer::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionmailer#lib/action_mailer/gem_version.rb:13 +ActionMailer::VERSION::PRE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionmailer#lib/action_mailer/gem_version.rb:15 +ActionMailer::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/actionmailer#lib/action_mailer/gem_version.rb:12 +ActionMailer::VERSION::TINY = T.let(T.unsafe(nil), Integer) diff --git a/sorbet/rbi/gems/actionpack@7.1.3.4.rbi b/sorbet/rbi/gems/actionpack@7.1.3.4.rbi new file mode 100644 index 000000000..92d3e34c4 --- /dev/null +++ b/sorbet/rbi/gems/actionpack@7.1.3.4.rbi @@ -0,0 +1,19203 @@ +# 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`. + + +# pkg:gem/actionpack#lib/abstract_controller/deprecator.rb:3 +module AbstractController + extend ::ActiveSupport::Autoload + + class << self + # pkg:gem/actionpack#lib/abstract_controller/deprecator.rb:4 + def deprecator; end + + # pkg:gem/actionpack#lib/abstract_controller.rb:25 + def eager_load!; end + end +end + +# Raised when a non-existing controller action is triggered. +# +# pkg:gem/actionpack#lib/abstract_controller/base.rb:11 +class AbstractController::ActionNotFound < ::StandardError + include ::DidYouMean::Correctable + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:14 + def initialize(message = T.unsafe(nil), controller = T.unsafe(nil), action = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:12 + def action; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:12 + def controller; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:23 + def corrections; end +end + +# pkg:gem/actionpack#lib/abstract_controller/asset_paths.rb:4 +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. +# +# pkg:gem/actionpack#lib/abstract_controller/base.rb:35 +class AbstractController::Base + include ::ActiveSupport::Configurable + extend ::ActiveSupport::Configurable::ClassMethods + extend ::ActiveSupport::DescendantsTracker + + # Delegates to the class's ::action_methods. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:131 + def action_methods; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:42 + def action_name; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:42 + 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 + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:131 + def available_action?(action_name); end + + # Delegates to the class's ::controller_path. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:131 + def controller_path; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:46 + def formats; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:46 + def formats=(_arg0); end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:131 + 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. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:131 + 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. + # + # ==== Returns + # * self + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:131 + def process(action, *args, **); end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:38 + def response_body; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:38 + 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. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:131 + 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+. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:131 + 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. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:131 + def _handle_action_missing(*args); end + + # Checks if the action name is valid and returns false otherwise. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:131 + 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 + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:131 + 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. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:131 + 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. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:131 + def process_action(*, **, &); end + + class << self + # pkg:gem/actionpack#lib/abstract_controller/base.rb:52 + def abstract; end + + # Define a controller as abstract. See internal_methods for more + # details. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:57 + def abstract!; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:53 + def abstract?; end + + # A list 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. + # + # ==== Returns + # * Set - A set of all methods that should be considered actions. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:96 + 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. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:111 + def clear_action_methods!; 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" + # + # ==== Returns + # * String + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:125 + def controller_path; end + + # pkg:gem/actionpack#lib/abstract_controller/base.rb:135 + def eager_load!; end + + # pkg:gem/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) + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:76 + def internal_methods; end + + # Refresh the cached action_methods when a new action_method is added. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:130 + 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. + # + # pkg:gem/actionpack#lib/abstract_controller/base.rb:199 + def supports_path?; end + end +end + +# pkg:gem/actionpack#lib/abstract_controller/caching.rb:4 +module AbstractController::Caching + include ::AbstractController::Caching::ConfigMethods + extend ::ActiveSupport::Concern + extend ::ActiveSupport::Autoload + 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 + + # pkg:gem/actionpack#lib/abstract_controller/caching.rb:52 + def view_cache_dependencies; end + + private + + # Convenience accessor. + # + # pkg:gem/actionpack#lib/abstract_controller/caching.rb:58 + def cache(key, options = T.unsafe(nil), &block); end + + module GeneratedClassMethods + def _view_cache_dependencies; end + def _view_cache_dependencies=(value); end + def _view_cache_dependencies?; end + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end + + module GeneratedInstanceMethods + def _view_cache_dependencies; end + def _view_cache_dependencies=(value); end + def _view_cache_dependencies?; end + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end +end + +# pkg:gem/actionpack#lib/abstract_controller/caching.rb:46 +module AbstractController::Caching::ClassMethods + # pkg:gem/actionpack#lib/abstract_controller/caching.rb:47 + def view_cache_dependency(&dependency); end +end + +# pkg:gem/actionpack#lib/abstract_controller/caching.rb:12 +module AbstractController::Caching::ConfigMethods + # pkg:gem/actionpack#lib/abstract_controller/caching.rb:13 + def cache_store; end + + # pkg:gem/actionpack#lib/abstract_controller/caching.rb:17 + def cache_store=(store); end + + private + + # pkg:gem/actionpack#lib/abstract_controller/caching.rb:22 + 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') +# +# pkg:gem/actionpack#lib/abstract_controller/caching/fragments.rb:20 +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. + # + # pkg:gem/actionpack#lib/abstract_controller/caching/fragments.rb:70 + 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). + # + # pkg:gem/actionpack#lib/abstract_controller/caching/fragments.rb:134 + 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). + # + # pkg:gem/actionpack#lib/abstract_controller/caching/fragments.rb:107 + def fragment_exist?(key, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/abstract_controller/caching/fragments.rb:147 + def instrument_fragment_cache(name, key, &block); end + + # Reads a cached fragment from the location signified by +key+ + # (see +expire_fragment+ for acceptable formats). + # + # pkg:gem/actionpack#lib/abstract_controller/caching/fragments.rb:95 + def read_fragment(key, options = T.unsafe(nil)); end + + # Writes +content+ to the location signified by + # +key+ (see +expire_fragment+ for acceptable formats). + # + # pkg:gem/actionpack#lib/abstract_controller/caching/fragments.rb:82 + 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 + +# pkg:gem/actionpack#lib/abstract_controller/caching/fragments.rb:37 +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 + # + # pkg:gem/actionpack#lib/abstract_controller/caching/fragments.rb:59 + 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 +# +# NOTE: Calling the same callback multiple times will overwrite previous callback definitions. +# +# pkg:gem/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. + # + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:257 + def process_action(*, **, &); end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def __callbacks?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def __callbacks?; end + end +end + +# pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:39 +class AbstractController::Callbacks::ActionFilter + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:40 + def initialize(filters, conditional_key, actions); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:69 + def after(controller); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:71 + def around(controller); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:70 + def before(controller); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:46 + def match?(controller); end +end + +# pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:74 +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. + # + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:119 + def _insert_callbacks(callbacks, block = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:99 + 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. + # + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:94 + def _normalize_callback_options(options); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:229 + def after_action(*names, &blk); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:250 + def append_after_action(*names, &blk); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:250 + def append_around_action(*names, &blk); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:250 + def append_before_action(*names, &blk); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:229 + def around_action(*names, &blk); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:229 + def before_action(*names, &blk); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:235 + def prepend_after_action(*names, &blk); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:235 + def prepend_around_action(*names, &blk); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:235 + def prepend_before_action(*names, &blk); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:243 + def skip_after_action(*names); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:243 + def skip_around_action(*names); end + + # pkg:gem/actionpack#lib/abstract_controller/callbacks.rb:243 + def skip_before_action(*names); end +end + +# pkg:gem/actionpack#lib/abstract_controller/collector.rb:6 +module AbstractController::Collector + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def atom(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def bmp(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def css(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def csv(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def gif(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def gzip(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def html(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def ics(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def jpeg(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def js(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def json(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def m4a(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def mp3(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def mp4(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def mpeg(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def multipart_form(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def ogg(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def otf(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def pdf(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def png(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def rss(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def svg(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def text(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def tiff(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def ttf(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def url_encoded_form(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def vcf(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def vtt(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def webm(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def webp(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def woff(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def woff2(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def xml(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def yaml(*args, **, &block); end + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:9 + def zip(*args, **, &block); end + + private + + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:26 + def method_missing(symbol, *args, **, &block); end + + class << self + # pkg:gem/actionpack#lib/abstract_controller/collector.rb:7 + def generate_method_for_mime(mime); end + end +end + +# pkg:gem/actionpack#lib/abstract_controller/rendering.rb:9 +class AbstractController::DoubleRenderError < ::AbstractController::Error + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:12 + def initialize(message = T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/abstract_controller/rendering.rb:10 +AbstractController::DoubleRenderError::DEFAULT_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/abstract_controller/error.rb:4 +class AbstractController::Error < ::StandardError; end + +# pkg:gem/actionpack#lib/abstract_controller/helpers.rb:7 +module AbstractController::Helpers + include ::ActiveSupport::Deprecation::DeprecatedConstantAccessor + extend ::ActiveSupport::Concern + extend ::AbstractController::Helpers::Resolution + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::Helpers::ClassMethods + + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:44 + 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 + +# pkg:gem/actionpack#lib/abstract_controller/helpers.rb:80 +module AbstractController::Helpers::ClassMethods + include ::AbstractController::Helpers::Resolution + + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:92 + def _helpers=(_arg0); end + + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:231 + def _helpers_for_modification; end + + # Clears up all existing helpers in this class, only keeping the helper + # with the same name as this class. + # + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:222 + 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 + # + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:211 + 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. + # + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:140 + 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. + # + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:84 + def inherited(klass); end + + private + + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:250 + def default_helper_module!; end + + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:239 + def define_helpers_module(klass, helpers = T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/abstract_controller/helpers.rb:27 +class AbstractController::Helpers::DeprecatedMissingHelperError < ::LoadError + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:28 + def initialize(error, path); end +end + +# pkg:gem/actionpack#lib/abstract_controller/helpers.rb:48 +module AbstractController::Helpers::Resolution + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:64 + def all_helpers_from_path(path); end + + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:73 + def helper_modules_from_paths(paths); end + + # pkg:gem/actionpack#lib/abstract_controller/helpers.rb:49 + def modules_for_helpers(modules_or_helper_prefixes); end +end + +# pkg:gem/actionpack#lib/abstract_controller/logger.rb:6 +module AbstractController::Logger + extend ::ActiveSupport::Concern + include ::ActiveSupport::Benchmarkable +end + +# pkg:gem/actionpack#lib/abstract_controller/railties/routes_helpers.rb:6 +module AbstractController::Railties; end + +# pkg:gem/actionpack#lib/abstract_controller/railties/routes_helpers.rb:7 +module AbstractController::Railties::RoutesHelpers + class << self + # pkg:gem/actionpack#lib/abstract_controller/railties/routes_helpers.rb:8 + def with(routes, include_path_helpers = T.unsafe(nil)); end + end +end + +# pkg:gem/actionpack#lib/abstract_controller/rendering.rb:17 +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. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:25 + def render(*args, &block); end + + # Performs the actual template rendering. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:49 + 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. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:43 + def render_to_string(*args, &block); end + + # Returns +Content-Type+ of rendered content. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:53 + def rendered_format; end + + # This method should return a hash with assigns. + # You can overwrite this configuration per controller. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:61 + def view_assigns; end + + private + + # Normalize args by converting render "foo" to + # render action: "foo" and render "foo/bar" to + # render file: "foo/bar". + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:73 + def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil)); end + + # Normalize options. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:88 + def _normalize_options(options); end + + # Normalize args and options. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:114 + def _normalize_render(*args, &block); end + + # Process the rendered format. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:98 + def _process_format(format); end + + # Process extra options. + # + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:93 + def _process_options(options); end + + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:101 + def _process_variant(options); end + + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:121 + def _protected_ivars; end + + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:104 + def _set_html_content_type; end + + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:110 + def _set_rendered_content_type(format); end + + # pkg:gem/actionpack#lib/abstract_controller/rendering.rb:107 + def _set_vary_header; end +end + +# pkg:gem/actionpack#lib/abstract_controller/rendering.rb:57 +AbstractController::Rendering::DEFAULT_PROTECTED_INSTANCE_VARIABLES = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/abstract_controller/translation.rb:6 +module AbstractController::Translation + # pkg:gem/actionpack#lib/abstract_controller/translation.rb:39 + def l(object, **options); end + + # Delegates to I18n.localize. + # + # pkg:gem/actionpack#lib/abstract_controller/translation.rb:36 + def localize(object, **options); end + + # pkg:gem/actionpack#lib/abstract_controller/translation.rb:33 + 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. + # + # pkg:gem/actionpack#lib/abstract_controller/translation.rb:15 + 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. +# +# pkg:gem/actionpack#lib/abstract_controller/url_for.rb:12 +module AbstractController::UrlFor + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionDispatch::Routing::UrlFor + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::AbstractController::UrlFor::ClassMethods + + # pkg:gem/actionpack#lib/abstract_controller/url_for.rb:16 + 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 + +# pkg:gem/actionpack#lib/abstract_controller/url_for.rb:21 +module AbstractController::UrlFor::ClassMethods + # pkg:gem/actionpack#lib/abstract_controller/url_for.rb:22 + def _routes; end + + # pkg:gem/actionpack#lib/abstract_controller/url_for.rb:26 + 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. +# +# pkg:gem/actionpack#lib/action_controller/deprecator.rb:3 +module ActionController + extend ::ActiveSupport::Autoload + + class << self + # See Renderers.add + # + # pkg:gem/actionpack#lib/action_controller/metal/renderers.rb:7 + def add_renderer(key, &block); end + + # pkg:gem/actionpack#lib/action_controller/deprecator.rb:4 + def deprecator; end + + # See Renderers.remove + # + # pkg:gem/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. +# +# pkg:gem/actionpack#lib/action_controller/api.rb:91 +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::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 ::CanCan::ControllerAdditions + include ::ActionController::RespondWith + include ::Doorkeeper::Rails::Helpers + extend ::ActionView::ViewPaths::ClassMethods + extend ::AbstractController::UrlFor::ClassMethods + extend ::ActionController::Rendering::ClassMethods + extend ::ActionController::Renderers::ClassMethods + extend ::ActionController::ConditionalGet::ClassMethods + extend ::ActionController::DefaultHeaders::ClassMethods + extend ::ActionController::Logging::ClassMethods + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::AbstractController::Callbacks::ClassMethods + extend ::ActiveSupport::Rescuable::ClassMethods + extend ::ActionController::Instrumentation::ClassMethods + extend ::ActionController::ParamsWrapper::ClassMethods + extend ::CanCan::ControllerAdditions::ClassMethods + extend ::ActionController::RespondWith::ClassMethods + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def __callbacks; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def __callbacks?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _cancan_skipper; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _cancan_skipper=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _cancan_skipper?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def _process_action_callbacks; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def _renderers; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def _renderers=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def _renderers?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def _run_process_action_callbacks(&block); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def _wrapper_options; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def _wrapper_options=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def _wrapper_options?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def default_url_options=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def default_url_options?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def etaggers; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def etaggers=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def etaggers?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def logger; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def logger=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def mimes_for_respond_to; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def mimes_for_respond_to=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def mimes_for_respond_to?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def raise_on_missing_callback_actions; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def raise_on_missing_callback_actions=(val); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def raise_on_open_redirects; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def raise_on_open_redirects=(val); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def rescue_handlers; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def rescue_handlers=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def rescue_handlers?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def responder; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def responder=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def responder?; end + + class << self + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def __callbacks; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def __callbacks=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def __callbacks?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _cancan_skipper; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _cancan_skipper=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def _cancan_skipper?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def _process_action_callbacks; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def _process_action_callbacks=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def _renderers; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def _renderers=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def _renderers?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def _wrapper_options; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def _wrapper_options=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def _wrapper_options?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def default_url_options=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def default_url_options?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def etaggers; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def etaggers=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def etaggers?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def logger; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def logger=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:91 + def middleware_stack; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def mimes_for_respond_to; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def mimes_for_respond_to=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def mimes_for_respond_to?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def raise_on_missing_callback_actions; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def raise_on_missing_callback_actions=(val); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def raise_on_open_redirects; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def raise_on_open_redirects=(val); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def rescue_handlers; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def rescue_handlers=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:146 + def rescue_handlers?; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def responder; end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def responder=(value); end + + # pkg:gem/actionpack#lib/action_controller/api.rb:150 + def responder?; 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. + # + # pkg:gem/actionpack#lib/action_controller/api.rb:106 + def without_modules(*modules); end + end +end + +# pkg:gem/actionpack#lib/action_controller/api.rb:114 +ActionController::API::MODULES = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:4 +class ActionController::ActionControllerError < ::StandardError; end + +# pkg:gem/actionpack#lib/action_controller/api/api_rendering.rb:4 +module ActionController::ApiRendering + extend ::ActiveSupport::Concern + include ::ActionController::Rendering + + mixes_in_class_methods ::ActionController::Rendering::ClassMethods + + # pkg:gem/actionpack#lib/action_controller/api/api_rendering.rb:11 + def render_to_body(options = T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:7 +class ActionController::BadRequest < ::ActionController::ActionControllerError + # pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:8 + 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. Included in the Action Pack is the 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 contain only a single render or a single redirect. Attempting to try 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 "and return" to halt execution. +# +# def do_something +# redirect_to(action: "elsewhere") and return if monkeys.nil? +# render action: "overthere" # won't be called if monkeys is nil +# end +# +# pkg:gem/actionpack#lib/action_controller/base.rb:169 +class ActionController::Base < ::ActionController::Metal + include ::ActionView::ViewPaths + include ::AbstractController::Rendering + include ::AbstractController::Translation + include ::AbstractController::AssetPaths + include ::ActiveSupport::Deprecation::DeprecatedConstantAccessor + 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::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 ::CanCan::ControllerAdditions + include ::ActionController::RespondWith + include ::Doorkeeper::Rails::Helpers + extend ::ActionView::ViewPaths::ClassMethods + extend ::AbstractController::Helpers::Resolution + extend ::AbstractController::Helpers::ClassMethods + extend ::ActionController::Helpers::ClassMethods + extend ::AbstractController::UrlFor::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::HttpAuthentication::Basic::ControllerMethods::ClassMethods + extend ::ActionController::DefaultHeaders::ClassMethods + extend ::ActionController::Logging::ClassMethods + extend ::ActiveSupport::Rescuable::ClassMethods + extend ::ActionController::Instrumentation::ClassMethods + extend ::ActionController::ParamsWrapper::ClassMethods + extend ::Responders::ControllerMethod + extend ::CanCan::ControllerAdditions::ClassMethods + extend ::ActionController::RespondWith::ClassMethods + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def __callbacks; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def __callbacks?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def _cancan_skipper; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def _cancan_skipper=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def _cancan_skipper?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _helper_methods; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _helper_methods=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _helper_methods?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _layout_conditions(&block); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _process_action_callbacks; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _renderers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _renderers=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _renderers?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _run_process_action_callbacks(&block); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _view_cache_dependencies; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _view_cache_dependencies=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _view_cache_dependencies?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _wrapper_options; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _wrapper_options=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _wrapper_options?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def alert; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def allow_forgery_protection; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def allow_forgery_protection=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def asset_host; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def asset_host=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def assets_dir; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def assets_dir=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def csrf_token_storage_strategy; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def csrf_token_storage_strategy=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def default_asset_host_protocol; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def default_asset_host_protocol=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def default_protect_from_forgery; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def default_protect_from_forgery=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def default_static_extension; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def default_static_extension=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def default_url_options=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def default_url_options?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def enable_fragment_cache_logging; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def enable_fragment_cache_logging=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def etag_with_template_digest; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def etag_with_template_digest=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def etag_with_template_digest?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def etaggers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def etaggers=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def etaggers?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def flash(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def forgery_protection_origin_check; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def forgery_protection_origin_check=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def forgery_protection_strategy; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def forgery_protection_strategy=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def fragment_cache_keys; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def fragment_cache_keys=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def fragment_cache_keys?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def helpers_path; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def helpers_path=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def helpers_path?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def include_all_helpers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def include_all_helpers=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def include_all_helpers?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def javascripts_dir; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def javascripts_dir=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def log_warning_on_csrf_failure; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def log_warning_on_csrf_failure=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def logger; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def logger=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def mimes_for_respond_to; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def mimes_for_respond_to=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def mimes_for_respond_to?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def notice; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def per_form_csrf_tokens; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def per_form_csrf_tokens=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def perform_caching; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def perform_caching=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def raise_on_missing_callback_actions; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def raise_on_missing_callback_actions=(val); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def raise_on_open_redirects; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def raise_on_open_redirects=(val); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def relative_url_root; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def relative_url_root=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def request_forgery_protection_token; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def request_forgery_protection_token=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def rescue_handlers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def rescue_handlers=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def rescue_handlers?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def responder; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def responder=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def responder?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def stylesheets_dir; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def stylesheets_dir=(value); end + + private + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _layout(lookup_context, formats); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:252 + def _protected_ivars; end + + class << self + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def __callbacks; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def __callbacks=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def __callbacks?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def _cancan_skipper; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def _cancan_skipper=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def _cancan_skipper?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _default_form_builder; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _default_form_builder=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _default_form_builder?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _flash_types; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _flash_types=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _flash_types?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _helper_methods; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _helper_methods=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _helper_methods?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _helpers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _layout; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _layout=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _layout?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _layout_conditions; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _layout_conditions=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _layout_conditions?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _process_action_callbacks; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _process_action_callbacks=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _renderers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _renderers=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _renderers?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _view_cache_dependencies; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _view_cache_dependencies=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _view_cache_dependencies?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _wrapper_options; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _wrapper_options=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def _wrapper_options?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def allow_forgery_protection; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def allow_forgery_protection=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def asset_host; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def asset_host=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def assets_dir; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def assets_dir=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def csrf_token_storage_strategy; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def csrf_token_storage_strategy=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def default_asset_host_protocol; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def default_asset_host_protocol=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def default_protect_from_forgery; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def default_protect_from_forgery=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def default_static_extension; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def default_static_extension=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def default_url_options=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def default_url_options?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def enable_fragment_cache_logging; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def enable_fragment_cache_logging=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def etag_with_template_digest; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def etag_with_template_digest=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def etag_with_template_digest?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def etaggers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def etaggers=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def etaggers?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def forgery_protection_origin_check; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def forgery_protection_origin_check=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def forgery_protection_strategy; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def forgery_protection_strategy=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def fragment_cache_keys; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def fragment_cache_keys=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def fragment_cache_keys?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def helpers_path; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def helpers_path=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def helpers_path?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def include_all_helpers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def include_all_helpers=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def include_all_helpers?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def javascripts_dir; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def javascripts_dir=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def log_warning_on_csrf_failure; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def log_warning_on_csrf_failure=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def logger; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def logger=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:169 + def middleware_stack; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def mimes_for_respond_to; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def mimes_for_respond_to=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def mimes_for_respond_to?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def per_form_csrf_tokens; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def per_form_csrf_tokens=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def perform_caching; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def perform_caching=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def raise_on_missing_callback_actions; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def raise_on_missing_callback_actions=(val); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def raise_on_open_redirects; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def raise_on_open_redirects=(val); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def relative_url_root; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def relative_url_root=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def request_forgery_protection_token; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def request_forgery_protection_token=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def rescue_handlers; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def rescue_handlers=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def rescue_handlers?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def responder; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def responder=(value); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def responder?; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def stylesheets_dir; end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def stylesheets_dir=(value); 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. + # + # pkg:gem/actionpack#lib/action_controller/base.rb:184 + def without_modules(*modules); end + end +end + +# pkg:gem/actionpack#lib/action_controller/base.rb:242 +module ActionController::Base::HelperMethods + include ::ActionText::ContentHelper + include ::ActionText::TagHelper + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def alert(*args, **, &block); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def can?(*args, **, &block); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def cannot?(*args, **, &block); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def combined_fragment_cache_key(*args, **, &block); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def content_security_policy?(*args, **, &block); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def content_security_policy_nonce(*args, **, &block); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def cookies(*args, **, &block); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:258 + def current_ability(*args, **, &block); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def form_authenticity_token(*args, **, &block); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def notice(*args, **, &block); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def protect_against_forgery?(*args, **, &block); end + + # pkg:gem/actionpack#lib/action_controller/base.rb:242 + def view_cache_dependencies(*args, **, &block); end +end + +# pkg:gem/actionpack#lib/action_controller/base.rb:192 +ActionController::Base::MODULES = T.let(T.unsafe(nil), Array) + +# Define some internal variables that should not be propagated to the view. +# +# pkg:gem/actionpack#lib/action_controller/base.rb:247 +ActionController::Base::PROTECTED_IVARS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_controller/metal/basic_implicit_render.rb:4 +module ActionController::BasicImplicitRender + # pkg:gem/actionpack#lib/action_controller/metal/basic_implicit_render.rb:11 + def default_render; end + + # pkg:gem/actionpack#lib/action_controller/metal/basic_implicit_render.rb:5 + 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. +# +# You can read more about each approach by clicking the modules below. +# +# 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') +# +# pkg:gem/actionpack#lib/action_controller/caching.rb:26 +module ActionController::Caching + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::AbstractController::Caching::Fragments + include ::AbstractController::Caching + + 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 + + # pkg:gem/actionpack#lib/action_controller/caching.rb:42 + def instrument_name; end + + # pkg:gem/actionpack#lib/action_controller/caching.rb:34 + def instrument_payload(key); end + + module GeneratedClassMethods + def _view_cache_dependencies; end + def _view_cache_dependencies=(value); end + def _view_cache_dependencies?; end + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end + + module GeneratedInstanceMethods + def _view_cache_dependencies; end + def _view_cache_dependencies=(value); end + def _view_cache_dependencies?; end + def fragment_cache_keys; end + def fragment_cache_keys=(value); end + def fragment_cache_keys?; end + end +end + +# pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:7 +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+] + # If true, replaces the default +private+ directive with the +public+ + # directive. + # [+:must_revalidate+] + # If true, adds the +must-revalidate+ directive. + # [+:stale_while_revalidate+] + # Sets the value of the +stale-while-revalidate+ directive. + # [+:stale_if_error+] + # Sets the value of the +stale-if-error+ directive. + # + # 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 + # + # pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:274 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:292 + 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+] + # Sets a "weak" ETag validator on the response. See the +:weak_etag+ option. + # [+:weak_etag+] + # Sets a "weak" ETag validator on the response. Requests that specify an + # +If-None-Match+ header may receive a 304 Not Modified response + # if the ETag matches exactly. + # + # A weak ETag indicates semantic equivalence, not byte-for-byte equality, + # so 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+] + # Sets a "strong" ETag validator on the response. Requests that specify an + # +If-None-Match+ header may receive a 304 Not Modified response + # if the ETag matches exactly. + # + # A strong ETag implies exact equality -- the response must match byte for + # 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+] + # Sets a "weak" last-update validator on the response. Subsequent requests + # that specify an +If-Modified-Since+ header may receive a 304 Not Modified + # response if +last_modified+ <= +If-Modified-Since+. + # [+:public+] + # By default the +Cache-Control+ header is private. Set this option to + # +true+ if you want your application to be cacheable by other devices, + # such as proxy caches. + # [+:cache_control+] + # When given, will overwrite an existing +Cache-Control+ header. For a + # list of +Cache-Control+ directives, see the {article on + # MDN}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control]. + # [+:template+] + # By default, the template digest for the current controller/action is + # 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" } + # + # pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:128 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:304 + def http_cache_forever(public: T.unsafe(nil)); end + + # Sets an HTTP 1.1 +Cache-Control+ header of no-store. This means the + # resource may not be stored in any cache. + # + # pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:314 + 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 + # + # pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:227 + def stale?(object = T.unsafe(nil), **freshness_kwargs); end + + private + + # pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:319 + 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 + +# pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:16 +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 + # + # pkg:gem/actionpack#lib/action_controller/metal/conditional_get.rb:31 + def etag(&etagger); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/content_security_policy.rb:4 +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 + + # pkg:gem/actionpack#lib/action_controller/metal/content_security_policy.rb:73 + def content_security_policy?; end + + # pkg:gem/actionpack#lib/action_controller/metal/content_security_policy.rb:77 + def content_security_policy_nonce; end + + # pkg:gem/actionpack#lib/action_controller/metal/content_security_policy.rb:81 + def current_content_security_policy; end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def __callbacks?; end + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def __callbacks?; end + def _helper_methods; end + def _helper_methods=(value); end + def _helper_methods?; end + end +end + +# pkg:gem/actionpack#lib/action_controller/metal/content_security_policy.rb:15 +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 + # + # pkg:gem/actionpack#lib/action_controller/metal/content_security_policy.rb:39 + 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 + # + # pkg:gem/actionpack#lib/action_controller/metal/content_security_policy.rb:65 + def content_security_policy_report_only(report_only = T.unsafe(nil), **options); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/cookies.rb:4 +module ActionController::Cookies + extend ::ActiveSupport::Concern + + private + + # The cookies for the current request. See ActionDispatch::Cookies for + # more information. + # + # pkg:gem/actionpack#lib/action_controller/metal/cookies.rb:14 + def cookies; end +end + +# = Action Controller Data \Streaming +# +# Methods for sending arbitrary data and for streaming files to the browser, +# instead of rendering. +# +# pkg:gem/actionpack#lib/action_controller/metal/data_streaming.rb:11 +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. + # + # pkg:gem/actionpack#lib/action_controller/metal/data_streaming.rb:111 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/data_streaming.rb:71 + def send_file(path, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_controller/metal/data_streaming.rb:116 + def send_file_headers!(options); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/data_streaming.rb:17 +ActionController::DataStreaming::DEFAULT_SEND_FILE_DISPOSITION = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_controller/metal/data_streaming.rb:16 +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. +# +# pkg:gem/actionpack#lib/action_controller/metal/default_headers.rb:8 +module ActionController::DefaultHeaders + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::DefaultHeaders::ClassMethods +end + +# pkg:gem/actionpack#lib/action_controller/metal/default_headers.rb:11 +module ActionController::DefaultHeaders::ClassMethods + # pkg:gem/actionpack#lib/action_controller/metal/default_headers.rb:12 + 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. +# +# pkg:gem/actionpack#lib/action_controller/metal/etag_with_flash.rb:11 +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 +# +# pkg:gem/actionpack#lib/action_controller/metal/etag_with_template_digest.rb:23 +module ActionController::EtagWithTemplateDigest + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionController::ConditionalGet + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::ConditionalGet::ClassMethods + + private + + # pkg:gem/actionpack#lib/action_controller/metal/etag_with_template_digest.rb:37 + def determine_template_etag(options); end + + # pkg:gem/actionpack#lib/action_controller/metal/etag_with_template_digest.rb:53 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/etag_with_template_digest.rb:47 + 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 + +# pkg:gem/actionpack#lib/action_controller/metal/flash.rb:4 +module ActionController::Flash + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::Flash::ClassMethods + + private + + # pkg:gem/actionpack#lib/action_controller/metal/flash.rb:51 + 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 + +# pkg:gem/actionpack#lib/action_controller/metal/flash.rb:14 +module ActionController::Flash::ClassMethods + # pkg:gem/actionpack#lib/action_controller/metal/flash.rb:45 + def action_methods; end + + # 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/flash.rb:32 + 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_for+ will be an instance of the +# specified form builder: +# +# <%= form_for(@instance) do |builder| %> +# <%= builder.special_field(:name) %> +# <% end %> +# +# pkg:gem/actionpack#lib/action_controller/form_builder.rb:29 +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 + # + # pkg:gem/actionpack#lib/action_controller/form_builder.rb:48 + 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 + +# pkg:gem/actionpack#lib/action_controller/form_builder.rb:36 +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, an instance of ActionView::Helpers::FormBuilder + # + # pkg:gem/actionpack#lib/action_controller/form_builder.rb:42 + def default_form_builder(builder); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/head.rb:4 +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. + # + # pkg:gem/actionpack#lib/action_controller/metal/head.rb:21 + def head(status, options = T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_controller/metal/head.rb:54 + 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 +# +# pkg:gem/actionpack#lib/action_controller/metal/helpers.rb:58 +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. + # + # pkg:gem/actionpack#lib/action_controller/metal/helpers.rb:117 + def helpers; end + + class << self + # pkg:gem/actionpack#lib/action_controller/metal/helpers.rb:61 + def helpers_path; end + + # pkg:gem/actionpack#lib/action_controller/metal/helpers.rb:61 + 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 + +# pkg:gem/actionpack#lib/action_controller/metal/helpers.rb:69 +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. + # + # pkg:gem/actionpack#lib/action_controller/metal/helpers.rb:78 + 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+. + # + # pkg:gem/actionpack#lib/action_controller/metal/helpers.rb:88 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/helpers.rb:104 + def modules_for_helpers(args); end + + private + + # Extract helper names from files in app/helpers/**/*_helper.rb + # + # pkg:gem/actionpack#lib/action_controller/metal/helpers.rb:111 + def all_application_helpers; end +end + +# HTTP Basic, Digest, and Token authentication. +# +# pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:9 +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 +# +# pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:66 +module ActionController::HttpAuthentication::Basic + extend ::ActionController::HttpAuthentication::Basic + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:127 + def auth_param(request); end + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:123 + def auth_scheme(request); end + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:105 + def authenticate(request, &login_procedure); end + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:135 + def authentication_request(controller, realm, message); end + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:119 + def decode_credentials(request); end + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:131 + def encode_credentials(user_name, password); end + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:111 + def has_basic_credentials?(request); end + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:115 + def user_name_and_password(request); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:69 +module ActionController::HttpAuthentication::Basic::ControllerMethods + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:92 + def authenticate_or_request_with_http_basic(realm = T.unsafe(nil), message = T.unsafe(nil), &login_procedure); end + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:96 + def authenticate_with_http_basic(&login_procedure); end + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:83 + def http_basic_authenticate_or_request_with(name:, password:, realm: T.unsafe(nil), message: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:100 + def request_http_basic_authentication(realm = T.unsafe(nil), message = T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:72 +module ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods + # Enables HTTP \Basic authentication. + # + # See ActionController::HttpAuthentication::Basic for example usage. + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:76 + 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. +# +# pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:185 +module ActionController::HttpAuthentication::Digest + extend ::ActionController::HttpAuthentication::Digest + + # Returns false on a valid response, true otherwise. + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:211 + def authenticate(request, realm, &password_procedure); end + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:269 + def authentication_header(controller, realm); end + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:276 + def authentication_request(controller, realm, message = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:262 + def decode_credentials(header); end + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:258 + def decode_credentials_header(request); end + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:253 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:243 + def expected_response(http_method, uri, credentials, password, password_is_ha1 = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:249 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:321 + def nonce(secret_key, time = T.unsafe(nil)); end + + # Opaque based on digest of secret key + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:340 + def opaque(secret_key); end + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:283 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:218 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:333 + def validate_nonce(secret_key, request, value, seconds_to_timeout = T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:188 +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. + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:193 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:199 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:205 + 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] +# +# pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:419 +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| ... } + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:466 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:550 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:535 + def encode_credentials(token, options = T.unsafe(nil)); end + + # Takes +raw_params+ and turns it into an array of parameters. + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:501 + 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+. + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:516 + def raw_params(auth); end + + # This removes the " characters wrapping the value. + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:506 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:488 + def token_and_options(request); end + + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:496 + def token_params_from(auth); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:422 +ActionController::HttpAuthentication::Token::AUTHN_PAIR_DELIMITERS = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:425 +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+ should return a non-nil + # value. Typically, the authenticated user is returned. + # + # See ActionController::HttpAuthentication::Token for example usage. + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:432 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:441 + def authenticate_with_http_token(&login_procedure); end + + # Render an HTTP header requesting the client to send a Bearer token for + # authentication. + # + # pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:447 + def request_http_token_authentication(realm = T.unsafe(nil), message = T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:420 +ActionController::HttpAuthentication::Token::TOKEN_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:421 +ActionController::HttpAuthentication::Token::TOKEN_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_controller/metal/http_authentication.rb:510 +ActionController::HttpAuthentication::Token::WHITESPACED_AUTHN_PAIR_DELIMITERS = 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. +# +# pkg:gem/actionpack#lib/action_controller/metal/implicit_render.rb:31 +module ActionController::ImplicitRender + include ::ActionController::BasicImplicitRender + + # pkg:gem/actionpack#lib/action_controller/metal/implicit_render.rb:35 + def default_render; end + + # pkg:gem/actionpack#lib/action_controller/metal/implicit_render.rb:54 + def method_for_action(action_name); end + + private + + # pkg:gem/actionpack#lib/action_controller/metal/implicit_render.rb:61 + 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. +# +# pkg:gem/actionpack#lib/action_controller/metal/instrumentation.rb:14 +module ActionController::Instrumentation + extend ::ActiveSupport::Concern + include ::ActiveSupport::Benchmarkable + include ::AbstractController::Logger + + mixes_in_class_methods ::ActionController::Instrumentation::ClassMethods + + # pkg:gem/actionpack#lib/action_controller/metal/instrumentation.rb:21 + def initialize(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/metal/instrumentation.rb:47 + def redirect_to(*); end + + # pkg:gem/actionpack#lib/action_controller/metal/instrumentation.rb:26 + def render(*); end + + # pkg:gem/actionpack#lib/action_controller/metal/instrumentation.rb:41 + def send_data(data, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_controller/metal/instrumentation.rb:34 + def send_file(path, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_controller/metal/instrumentation.rb:19 + def view_runtime; end + + # pkg:gem/actionpack#lib/action_controller/metal/instrumentation.rb:19 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/instrumentation.rb:103 + 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 + # + # pkg:gem/actionpack#lib/action_controller/metal/instrumentation.rb:97 + def cleanup_view_runtime; end + + # A hook invoked every time a before callback is halted. + # + # pkg:gem/actionpack#lib/action_controller/metal/instrumentation.rb:87 + def halted_callback_hook(filter, _); end + + # pkg:gem/actionpack#lib/action_controller/metal/instrumentation.rb:57 + def process_action(*); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/instrumentation.rb:107 +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. + # + # pkg:gem/actionpack#lib/action_controller/metal/instrumentation.rb:111 + def log_process_action(payload); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/request_forgery_protection.rb:8 +class ActionController::InvalidAuthenticityToken < ::ActionController::ActionControllerError; end + +# pkg:gem/actionpack#lib/action_controller/metal/request_forgery_protection.rb:11 +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 +# +# pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:72 +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 +# +# pkg:gem/actionpack#lib/action_controller/metal/live.rb:54 +module ActionController::Live + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::Live::ClassMethods + + # 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! + # + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:364 + def new_controller_thread; end + + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:273 + def process(name); end + + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:319 + 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 + # + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:345 + def send_stream(filename:, disposition: T.unsafe(nil), type: T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:372 + def log_error(exception); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/live.rb:146 +class ActionController::Live::Buffer < ::ActionDispatch::Response::Buffer + include ::MonitorMixin + + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:162 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:217 + def abort; end + + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:236 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:204 + 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`. + # + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:228 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:160 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:160 + def ignore_disconnect=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:232 + def on_error(&block); end + + # pkg:gem/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. + # + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:196 + def writeln(string); end + + private + + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:252 + def build_queue(queue_size); end + + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:241 + def each_chunk(&block); end + + class << self + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:150 + def queue_size; end + + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:150 + def queue_size=(_arg0); end + end +end + +# pkg:gem/actionpack#lib/action_controller/metal/live.rb:57 +module ActionController::Live::ClassMethods + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:58 + def make_response!(request); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/live.rb:143 +class ActionController::Live::ClientDisconnected < ::RuntimeError; end + +# pkg:gem/actionpack#lib/action_controller/metal/live.rb:257 +class ActionController::Live::Response < ::ActionDispatch::Response + private + + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:259 + def before_committed; end + + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:266 + 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: +# +# 1) Event. If specified, an event with this name will be dispatched on +# the browser. +# 2) Retry. The reconnection time in milliseconds used when attempting +# to send the event. +# 3) Id. If the connection dies while sending an SSE to the browser, then +# the 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. +# +# pkg:gem/actionpack#lib/action_controller/metal/live.rb:107 +class ActionController::Live::SSE + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:110 + def initialize(stream, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:115 + def close; end + + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:119 + def write(object, options = T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_controller/metal/live.rb:129 + def perform_write(json, options); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/live.rb:108 +ActionController::Live::SSE::PERMITTED_OPTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_controller/test_case.rb:172 +class ActionController::LiveTestResponse < ::ActionController::Live::Response + # Was there a server-side error? + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:180 + def error?; end + + # Was the URL not found? + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:177 + def missing?; end + + # Was the response successful? + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:174 + def success?; end +end + +# pkg:gem/actionpack#lib/action_controller/log_subscriber.rb:4 +class ActionController::LogSubscriber < ::ActiveSupport::LogSubscriber + # pkg:gem/actionpack#lib/action_controller/log_subscriber.rb:78 + def exist_fragment?(event); end + + # pkg:gem/actionpack#lib/action_controller/log_subscriber.rb:78 + def expire_fragment(event); end + + # pkg:gem/actionpack#lib/action_controller/log_subscriber.rb:45 + def halted_callback(event); end + + # pkg:gem/actionpack#lib/action_controller/log_subscriber.rb:88 + def logger; end + + # pkg:gem/actionpack#lib/action_controller/log_subscriber.rb:24 + def process_action(event); end + + # pkg:gem/actionpack#lib/action_controller/log_subscriber.rb:78 + def read_fragment(event); end + + # pkg:gem/actionpack#lib/action_controller/log_subscriber.rb:55 + def redirect_to(event); end + + # pkg:gem/actionpack#lib/action_controller/log_subscriber.rb:60 + def send_data(event); end + + # pkg:gem/actionpack#lib/action_controller/log_subscriber.rb:50 + def send_file(event); end + + # pkg:gem/actionpack#lib/action_controller/log_subscriber.rb:7 + def start_processing(event); end + + # pkg:gem/actionpack#lib/action_controller/log_subscriber.rb:65 + def unpermitted_parameters(event); end + + # pkg:gem/actionpack#lib/action_controller/log_subscriber.rb:78 + def write_fragment(event); end + + class << self + # pkg:gem/actionpack#lib/action_controller/log_subscriber.rb:22 + def log_levels; end + end +end + +# pkg:gem/actionpack#lib/action_controller/log_subscriber.rb:5 +ActionController::LogSubscriber::INTERNAL_PARAMS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_controller/metal/logging.rb:4 +module ActionController::Logging + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::Logging::ClassMethods +end + +# pkg:gem/actionpack#lib/action_controller/metal/logging.rb:7 +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 + # + # pkg:gem/actionpack#lib/action_controller/metal/logging.rb:15 + 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 +# +# +ActionController::Metal+ by default provides no utilities for rendering +# views, partials, or other responses aside from explicitly calling of +# 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. +# +# pkg:gem/actionpack#lib/action_controller/metal.rb:121 +class ActionController::Metal < ::AbstractController::Base + include ::ActionController::Testing::Functional + + # pkg:gem/actionpack#lib/action_controller/metal.rb:185 + def initialize; end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:182 + def content_type(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:182 + def content_type=(arg); end + + # Delegates to the class's ::controller_name. + # + # pkg:gem/actionpack#lib/action_controller/metal.rb:156 + def controller_name; end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:224 + def dispatch(name, request, response); end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:180 + def headers(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:182 + def location(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:182 + def location=(arg); end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:182 + def media_type(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:262 + def middleware_stack; end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:262 + def middleware_stack=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:262 + def middleware_stack?; end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:194 + def params; end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:198 + def params=(val); end + + # Tests if render or redirect has already happened. + # + # pkg:gem/actionpack#lib/action_controller/metal.rb:220 + def performed?; end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:164 + def request; end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:164 + def request=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:258 + def reset_session; end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:170 + def response; end + + # Assign the response and mark it as committed. No further processing will occur. + # + # pkg:gem/actionpack#lib/action_controller/metal.rb:242 + def response=(response); end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:209 + def response_body=(body); end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:202 + def response_code(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:176 + def session(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:249 + def set_request!(request); end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:232 + def set_response!(response); end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:182 + def status(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:182 + def status=(arg); end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:254 + def to_a; end + + # Basic \url_for that can be overridden for more robust functionality. + # + # pkg:gem/actionpack#lib/action_controller/metal.rb:205 + def url_for(string); end + + class << self + # Returns a Rack endpoint for the given action name. + # + # pkg:gem/actionpack#lib/action_controller/metal.rb:289 + def action(name); end + + # pkg:gem/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 + # + # pkg:gem/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+. + # + # pkg:gem/actionpack#lib/action_controller/metal.rb:305 + def dispatch(name, req, res); end + + # pkg:gem/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. + # + # pkg:gem/actionpack#lib/action_controller/metal.rb:284 + def middleware; end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:262 + def middleware_stack; end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:262 + def middleware_stack=(value); end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:262 + def middleware_stack?; end + + # Pushes the given Rack middleware and its arguments to the bottom of the + # middleware stack. + # + # pkg:gem/actionpack#lib/action_controller/metal.rb:267 + def use(*, **, &); end + + private + + # pkg:gem/actionpack#lib/action_controller/metal.rb:146 + def inherited(subclass); end + end +end + +# pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:50 +class ActionController::MethodNotAllowed < ::ActionController::ActionControllerError + # pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:51 + 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 +# +# pkg:gem/actionpack#lib/action_controller/metal.rb:16 +class ActionController::MiddlewareStack < ::ActionDispatch::MiddlewareStack + # pkg:gem/actionpack#lib/action_controller/metal.rb:29 + def build(action, app = T.unsafe(nil), &block); end + + private + + # pkg:gem/actionpack#lib/action_controller/metal.rb:42 + def build_middleware(klass, args, block); end +end + +# pkg:gem/actionpack#lib/action_controller/metal.rb:39 +ActionController::MiddlewareStack::EXCLUDE = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionpack#lib/action_controller/metal.rb:38 +ActionController::MiddlewareStack::INCLUDE = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionpack#lib/action_controller/metal.rb:17 +class ActionController::MiddlewareStack::Middleware < ::ActionDispatch::MiddlewareStack::Middleware + # pkg:gem/actionpack#lib/action_controller/metal.rb:18 + def initialize(klass, args, actions, strategy, block); end + + # pkg:gem/actionpack#lib/action_controller/metal.rb:24 + def valid?(action); end +end + +# pkg:gem/actionpack#lib/action_controller/metal.rb:40 +ActionController::MiddlewareStack::NULL = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:6 +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 + # + # pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:201 + 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. +# +# pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:242 +class ActionController::MimeResponds::Collector + include ::AbstractController::Collector + + # pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:246 + def initialize(mimes, variant = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:260 + def all(*args, &block); end + + # pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:253 + def any(*args, &block); end + + # pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:271 + def any_response?; end + + # pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:262 + def custom(mime_type, &block); end + + # pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:244 + def format; end + + # pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:244 + def format=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:288 + def negotiate_format(request); end + + # pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:275 + def response; end +end + +# pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:292 +class ActionController::MimeResponds::Collector::VariantCollector + # pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:293 + def initialize(variant = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:307 + def all(*args, &block); end + + # pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:298 + def any(*args, &block); end + + # pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:309 + def method_missing(name, *args, &block); end + + # pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:313 + def variant; end + + private + + # pkg:gem/actionpack#lib/action_controller/metal/mime_responds.rb:322 + def variant_key; end +end + +# pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:94 +class ActionController::MissingExactTemplate < ::ActionController::UnknownFormat + # pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:97 + def initialize(message, controller, action_name); end + + # pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:95 + def action_name; end + + # pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:95 + def controller; end +end + +# pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:59 +class ActionController::MissingFile < ::ActionController::ActionControllerError; end + +# See Responder#api_behavior +# +# pkg:gem/actionpack#lib/action_controller/metal/renderers.rb:17 +class ActionController::MissingRenderer < ::LoadError + # pkg:gem/actionpack#lib/action_controller/metal/renderers.rb:18 + def initialize(format); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:56 +class ActionController::NotImplemented < ::ActionController::MethodNotAllowed; end + +# Specify binary encoding for parameters for a given action. +# +# pkg:gem/actionpack#lib/action_controller/metal/parameter_encoding.rb:5 +module ActionController::ParameterEncoding + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::ParameterEncoding::ClassMethods +end + +# pkg:gem/actionpack#lib/action_controller/metal/parameter_encoding.rb:8 +module ActionController::ParameterEncoding::ClassMethods + # pkg:gem/actionpack#lib/action_controller/metal/parameter_encoding.rb:18 + def action_encoding_template(action); end + + # pkg:gem/actionpack#lib/action_controller/metal/parameter_encoding.rb:9 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/parameter_encoding.rb:77 + def param_encoding(action, param, encoding); end + + # pkg:gem/actionpack#lib/action_controller/metal/parameter_encoding.rb:14 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/parameter_encoding.rb:48 + 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: b +# params.require(:a) +# # => ActionController::ParameterMissing: param is missing or the value is empty: a +# +# pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:22 +class ActionController::ParameterMissing < ::KeyError + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:25 + def initialize(param, keys = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:34 + def corrections; end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:23 + def keys; end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:23 + 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 two methods for this purpose: #require and #permit. The former is +# used to mark parameters as required. The latter is used to set the parameter +# as permitted and limit which attributes should be allowed for mass updating. +# +# params = ActionController::Parameters.new({ +# person: { +# name: "Francesco", +# age: 22, +# role: "admin" +# } +# }) +# +# permitted = params.require(:person).permit(:name, :age) +# permitted # => #"Francesco", "age"=>22} permitted: true> +# permitted.permitted? # => true +# +# Person.first.update!(permitted) +# # => # +# +# It provides two options that controls 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" +# +# pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:140 +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) # => # + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:269 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:283 + 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 + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:665 + def [](key); end + + # Assigns a value to a given +key+. The given key may still get filtered out + # when #permit is called. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:671 + def []=(key, value); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:243 + def always_permitted_parameters; end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:243 + def always_permitted_parameters=(val); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:229 + def as_json(*, **, &); end + + # Returns a new +ActionController::Parameters+ instance with +nil+ values removed. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:842 + def compact; end + + # Removes all +nil+ values in place and returns +self+, or +nil+ if no changes were made. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:847 + def compact!; end + + # Returns a new +ActionController::Parameters+ instance without the blank values. + # Uses Object#blank? for determining if a value is blank. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:853 + def compact_blank; end + + # Removes all blank values in place and returns self. + # Uses Object#blank? for determining if a value is blank. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:859 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:430 + def converted_arrays; end + + # Returns a duplicate +ActionController::Parameters+ instance with the same permitted parameters. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:958 + def deep_dup; end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:894 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:793 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:802 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:811 + def delete(key, &block); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:839 + 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 + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:709 + def dig(*keys); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:405 + def each(&block); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:229 + def each_key(*, **, &); end + + # Convert all hashes in values into parameters, then yield each pair in + # the same way as Hash#each_pair. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:397 + def each_pair(&block); end + + # Convert all hashes in values into parameters, then yield each value in + # the same way as Hash#each_value. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:409 + def each_value(&block); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:229 + def empty?(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:953 + def encode_with(coder); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:304 + 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> + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:738 + def except(*keys); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:229 + def exclude?(*, **, &); 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> + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:748 + 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) # => ["ruby", "rails", "", "web"] + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:976 + 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: none + # params.fetch(:none, {}) # => # + # params.fetch(:none, "Francesco") # => "Francesco" + # params.fetch(:none) { "Francesco" } # => "Francesco" + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:688 + def fetch(key, *args); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:232 + def has_key?(*, **, &); end + + # Returns true if the given value is present for some key in the parameters. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:864 + def has_value?(value); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:310 + def hash; end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:229 + def include?(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:935 + def init_with(coder); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:922 + def inspect; end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:826 + def keep_if(&block); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:233 + def key?(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:229 + def keys(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:234 + def member?(*, **, &); end + + # Returns a new +ActionController::Parameters+ instance with all keys from + # +other_hash+ merged into current hash. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:878 + def merge(other_hash); end + + # :call-seq: merge!(other_hash) + # + # Returns the current +ActionController::Parameters+ instance with + # +other_hash+ merged into current hash. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:889 + 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(user: { name: "Francesco", age: 22, role: "admin" }) + # permitted = params.require(:user).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, like: + # + # 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 + # + # 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.require(:person).permit(:contact) + # # => # + # + # params.require(:person).permit(contact: :phone) + # # => ##"555-1234"} permitted: true>} permitted: true> + # + # params.require(:person).permit(contact: [ :email, :phone ]) + # # => ##"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"}}} + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:642 + 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) # => # + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:456 + def permit!; end + + # Returns +true+ if the parameter is permitted, +false+ otherwise. + # + # params = ActionController::Parameters.new + # params.permitted? # => false + # params.permit! + # params.permitted? # => true + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:440 + def permitted?; end + + # Returns a new +ActionController::Parameters+ instance with items + # that the block evaluates to true removed. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:830 + def reject(&block); end + + # Removes items that the block evaluates to true and returns self. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:835 + 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: person + # + # ActionController::Parameters.new(person: nil).require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty: person + # + # ActionController::Parameters.new(person: "\t").require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty: person + # + # ActionController::Parameters.new(person: {}).require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty: 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: user + # + # Technically this method can be used to fetch terminal values: + # + # # CAREFUL + # params = ActionController::Parameters.new(person: { name: "Finn" }) + # name = params.require(:person).require(:name) # CAREFUL + # + # but take into account that at some point those ones have to be permitted: + # + # def person_params + # params.require(:person).permit(:name).tap do |person_params| + # person_params.require(:name) # SAFER + # end + # end + # + # for example. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:517 + def require(key); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:527 + def required(key); end + + # Returns a new +ActionController::Parameters+ instance with all keys + # from current hash merged into +other_hash+. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:900 + def reverse_merge(other_hash); end + + # Returns the current +ActionController::Parameters+ instance with + # current hash merged into +other_hash+. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:909 + def reverse_merge!(other_hash); end + + # Returns a new +ActionController::Parameters+ instance with only + # items that the block evaluates to true. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:817 + def select(&block); end + + # Equivalent to Hash#keep_if, but returns +nil+ if no changes were made. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:822 + 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) # => # + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:721 + def slice(*keys); end + + # Returns the current +ActionController::Parameters+ instance which + # contains only the given +keys+. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:727 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:918 + 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"} + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:326 + 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"} + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:346 + def to_hash; end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:379 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:376 + def to_query(*args); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:229 + def to_s(*, **, &); 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"} + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:390 + def to_unsafe_h; end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:393 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:775 + def transform_keys(&block); end + + # Performs keys transformation and returns the altered + # +ActionController::Parameters+ instance. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:784 + 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> + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:758 + def transform_values; end + + # Performs values transformation and returns the altered + # +ActionController::Parameters+ instance. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:767 + def transform_values!; end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:868 + def value?(value); end + + # Returns a new array of the values of the parameters. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:419 + def values; end + + # Returns values that were assigned to the given +keys+. Note that all the + # +Hash+ objects will be converted to +ActionController::Parameters+. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:872 + def values_at(*keys); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:905 + def with_defaults(other_hash); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:913 + def with_defaults!(other_hash); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:741 + def without(*keys); end + + protected + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:989 + def each_nested_attribute; end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:985 + def nested_attributes?; end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:981 + def parameters; end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:983 + def permitted=(_arg0); end + + private + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1131 + def array_of_permitted_scalars?(value); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1018 + def convert_hashes_to_parameters(key, value); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1002 + def convert_parameters_to_hashes(value, using, &block); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1024 + def convert_value_to_parameters(value); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1044 + def each_element(object, filter, &block); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1143 + def hash_filter(params, filter); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1204 + def initialize_copy(source); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:996 + def new_instance_with_inherited_permitted_status(hash); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1137 + def non_scalar?(value); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1187 + def permit_any_in_array(array); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1170 + def permit_any_in_parameters(params); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1102 + 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"] + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1116 + def permitted_scalar_filter(params, permitted_key); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1038 + def specify_numeric_keys?(filter); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1070 + def unpermitted_keys(params); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1057 + def unpermitted_parameters!(params); end + + class << self + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:145 + def action_on_unpermitted_parameters; end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:145 + def action_on_unpermitted_parameters=(val); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:245 + def allow_deprecated_parameters_hash_equality; end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:245 + def allow_deprecated_parameters_hash_equality=(val); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:243 + def always_permitted_parameters; end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:243 + def always_permitted_parameters=(val); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:926 + def hook_into_yaml_loading; end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:248 + def nested_attribute?(key, value); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:143 + def permit_all_parameters; end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:143 + def permit_all_parameters=(val); end + end +end + +# pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1141 +ActionController::Parameters::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1142 +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. +# +# pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1086 +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 +# +# pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:82 +module ActionController::ParamsWrapper + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::ParamsWrapper::ClassMethods + + private + + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:279 + def _extract_parameters(parameters); end + + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:301 + def _perform_parameter_wrapping; end + + # Returns the list of parameters which will be selected for wrapped. + # + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:275 + def _wrap_parameters(parameters); end + + # Checks if we should perform parameters wrapping. + # + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:291 + def _wrapper_enabled?; end + + # Returns the list of enabled formats. + # + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:270 + def _wrapper_formats; end + + # Returns the wrapper key which will be used to store wrapped parameters. + # + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:265 + def _wrapper_key; end + + # Performs parameters wrapping upon the request. Called automatically + # by the metal call stack. + # + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:259 + def process_action(*); 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 + +# pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:190 +module ActionController::ParamsWrapper::ClassMethods + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:191 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:246 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:222 + def wrap_parameters(name_or_model_or_options, options = T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:85 +ActionController::ParamsWrapper::EXCLUDE_PARAMETERS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:89 +class ActionController::ParamsWrapper::Options < ::Struct + include ::Mutex_m + + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:100 + def initialize(name, format, include, exclude, klass, model); end + + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:110 + def include; end + + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:90 + def lock; end + + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:90 + def locked?; end + + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:106 + def model; end + + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:143 + def name; end + + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:90 + def synchronize(&block); end + + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:90 + def try_lock; end + + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:90 + def unlock; 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:167 + def _default_wrap_model; end + + class << self + # pkg:gem/actionpack#lib/action_controller/metal/params_wrapper.rb:92 + def from_hash(hash); end + end +end + +# pkg:gem/actionpack#lib/action_controller/metal/permissions_policy.rb:4 +module ActionController::PermissionsPolicy + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionController::PermissionsPolicy::ClassMethods +end + +# pkg:gem/actionpack#lib/action_controller/metal/permissions_policy.rb:7 +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 + # + # pkg:gem/actionpack#lib/action_controller/metal/permissions_policy.rb:26 + def permissions_policy(**options, &block); end +end + +# pkg:gem/actionpack#lib/action_controller/railtie.rb:11 +class ActionController::Railtie < ::Rails::Railtie; end + +# pkg:gem/actionpack#lib/action_controller/railties/helpers.rb:4 +module ActionController::Railties; end + +# pkg:gem/actionpack#lib/action_controller/railties/helpers.rb:5 +module ActionController::Railties::Helpers + # pkg:gem/actionpack#lib/action_controller/railties/helpers.rb:6 + def inherited(klass); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/redirecting.rb:4 +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 + + # pkg:gem/actionpack#lib/action_controller/metal/redirecting.rb:136 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/redirecting.rb:101 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/redirecting.rb:127 + 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. + # Note: this was a new default in \Rails 7.0, after upgrading opt-in by uncommenting the line with +raise_on_open_redirects+ in config/initializers/new_framework_defaults_7_0.rb + # + # Here #redirect_to automatically validates the potentially-unsafe URL: + # + # redirect_to params[:redirect_url] + # + # Raises UnsafeRedirectError in the case of an unsafe redirect. + # + # 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/redirecting.rb:84 + 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]). + # + # pkg:gem/actionpack#lib/action_controller/metal/redirecting.rb:175 + def url_from(location); end + + private + + # pkg:gem/actionpack#lib/action_controller/metal/redirecting.rb:181 + def _allow_other_host; end + + # pkg:gem/actionpack#lib/action_controller/metal/redirecting.rb:195 + def _enforce_open_redirect_protection(location, allow_other_host:); end + + # pkg:gem/actionpack#lib/action_controller/metal/redirecting.rb:214 + def _ensure_url_is_http_header_safe(url); end + + # pkg:gem/actionpack#lib/action_controller/metal/redirecting.rb:185 + def _extract_redirect_to_status(options, response_options); end + + # pkg:gem/actionpack#lib/action_controller/metal/redirecting.rb:203 + def _url_host_allowed?(url); end + + class << self + # pkg:gem/actionpack#lib/action_controller/metal/redirecting.rb:153 + def _compute_redirect_to_location(request, options); end + 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 + +# pkg:gem/actionpack#lib/action_controller/metal/redirecting.rb:12 +ActionController::Redirecting::ILLEGAL_HEADER_VALUE_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_controller/metal/redirecting.rb:10 +class ActionController::Redirecting::UnsafeRedirectError < ::StandardError; end + +# pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:14 +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 } +# +# pkg:gem/actionpack#lib/action_controller/renderer.rb:24 +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+. + # + # pkg:gem/actionpack#lib/action_controller/renderer.rb:106 + def initialize(controller, env, defaults); end + + # pkg:gem/actionpack#lib/action_controller/renderer.rb:25 + def controller; end + + # pkg:gem/actionpack#lib/action_controller/renderer.rb:117 + def defaults; end + + # Creates a new renderer using the same controller, but with a new Rack env. + # + # ApplicationController.renderer.new(method: "post") + # + # pkg:gem/actionpack#lib/action_controller/renderer.rb:69 + def new(env = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_controller/renderer.rb:145 + def normalize_env(env, &block); end + + # Renders a template to a string, just like ActionController::Rendering#render_to_string. + # + # pkg:gem/actionpack#lib/action_controller/renderer.rb:123 + def render(*args); end + + # pkg:gem/actionpack#lib/action_controller/renderer.rb:132 + 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. + # + # pkg:gem/actionpack#lib/action_controller/renderer.rb:75 + def with_defaults(defaults); end + + private + + # pkg:gem/actionpack#lib/action_controller/renderer.rb:147 + def env_for_request; end + + class << self + # Creates a new renderer using the given controller class. See ::new. + # + # pkg:gem/actionpack#lib/action_controller/renderer.rb:61 + def for(controller, env = T.unsafe(nil), defaults = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_controller/renderer.rb:32 + def normalize_env(env); end + end +end + +# pkg:gem/actionpack#lib/action_controller/renderer.rb:27 +ActionController::Renderer::DEFAULTS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_controller/renderer.rb:143 +ActionController::Renderer::DEFAULT_ENV = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_controller/renderer.rb:135 +ActionController::Renderer::RACK_KEY_TRANSLATION = T.let(T.unsafe(nil), Hash) + +# pkg:gem/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 + + # pkg:gem/actionpack#lib/action_controller/metal/renderers.rb:144 + def _render_to_body_with_renderer(options); end + + # pkg:gem/actionpack#lib/action_controller/metal/renderers.rb:75 + def _render_with_renderer_js(js, options); end + + # pkg:gem/actionpack#lib/action_controller/metal/renderers.rb:75 + def _render_with_renderer_json(json, options); end + + # pkg:gem/actionpack#lib/action_controller/metal/renderers.rb:75 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/renderers.rb:140 + def render_to_body(options); end + + class << self + # pkg:gem/actionpack#lib/action_controller/metal/renderers.rb:90 + 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 + # + # pkg:gem/actionpack#lib/action_controller/metal/renderers.rb:74 + def add(key, &block); end + + # This method is the opposite of add method. + # + # To remove a csv renderer: + # + # ActionController::Renderers.remove(:csv) + # + # pkg:gem/actionpack#lib/action_controller/metal/renderers.rb:84 + def remove(key); end + end + + module GeneratedClassMethods + def _renderers; end + def _renderers=(value); end + def _renderers?; 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. +# +# pkg:gem/actionpack#lib/action_controller/metal/renderers.rb:36 +module ActionController::Renderers::All + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActionController::Renderers + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActionController::Renderers::ClassMethods + + module GeneratedClassMethods + def _renderers; end + def _renderers=(value); end + def _renderers?; end + end + + module GeneratedInstanceMethods + def _renderers; end + def _renderers=(value); end + def _renderers?; end + end +end + +# pkg:gem/actionpack#lib/action_controller/metal/renderers.rb:94 +module ActionController::Renderers::ClassMethods + # pkg:gem/actionpack#lib/action_controller/metal/renderers.rb:132 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/renderers.rb:128 + def use_renderers(*args); end +end + +# A Set containing renderer names that correspond to available renderer procs. +# Default values are :json, :js, :xml. +# +# pkg:gem/actionpack#lib/action_controller/metal/renderers.rb:28 +ActionController::Renderers::RENDERERS = T.let(T.unsafe(nil), Set) + +# pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:4 +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. + # + # ==== \Rendering Mode + # + # [+:partial+] + # See ActionView::PartialRenderer for details. + # + # render partial: "posts/form", locals: { post: Post.new } + # # => renders app/views/posts/_form.html.erb + # + # [+:file+] + # Renders the contents of a file. This option should not be used + # with unsanitized user input. + # + # render file: "/path/to/some/file" + # # => renders /path/to/some/file + # + # [+:inline+] + # Renders an ERB template string. + # + # @name = "World" + # render inline: "

Hello, <%= @name %>!

" + # # => renders "

Hello, World!

" + # + # [+:body+] + # Renders the provided text, and sets the content type as +text/plain+. + # + # render body: "Hello, World!" + # # => renders "Hello, World!" + # + # [+:plain+] + # Renders the provided text, and sets the content type as +text/plain+. + # + # render plain: "Hello, World!" + # # => renders "Hello, World!" + # + # [+:html+] + # Renders the provided HTML string, and sets the content type as +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+] + # Renders the provided object as JSON, and sets the content type as + # +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\"}" + # + # By default, when a rendering mode is specified, no layout template is + # rendered. + # + # ==== Options + # + # [+:assigns+] + # Hash of instance variable assignments for the template. + # + # render inline: "

Hello, <%= @name %>!

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

Hello, World!

" + # + # [+:locals+] + # Hash of local variable assignments for the template. + # + # render inline: "

Hello, <%= name %>!

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

Hello, World!

" + # + # [+:layout+] + # The layout template to render. Can also be +false+ or +true+ to disable + # or (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+] + # The HTTP status code to send with the response. Can be specified as a + # 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 + # + # -- + # Check for double render errors and set the content_type after rendering. + # + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:137 + def render(*args); end + + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:157 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:146 + def render_to_string(*); end + + private + + # Normalize both text and status options. + # + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:199 + def _normalize_options(options); end + + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:213 + def _normalize_text(options); end + + # Process controller specific options, as status, content-type and location. + # + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:222 + def _process_options(options); end + + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:168 + def _process_variant(options); end + + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:174 + def _render_in_priorities(options); end + + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:182 + def _set_html_content_type; end + + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:186 + def _set_rendered_content_type(format); end + + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:192 + def _set_vary_header; end + + # Before processing, set the request formats in current controller formats. + # + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:163 + def process_action(*); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:9 +module ActionController::Rendering::ClassMethods + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:21 + def inherited(klass); end + + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:11 + def render(*, **, &); end + + # Returns a renderer instance (inherited from ActionController::Renderer) + # for the controller. + # + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:15 + def renderer; end + + # pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:17 + def setup_renderer!; end +end + +# pkg:gem/actionpack#lib/action_controller/metal/rendering.rb:7 +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 +# +# Not all web servers support streaming out-of-the-box. You need to check +# the instructions for each of them. +# +# ==== Unicorn +# +# Unicorn supports streaming but it needs to be configured. For this, you +# need to create a config file as follow: +# +# # unicorn.config.rb +# listen 3000, tcp_nopush: false +# +# And use it on initialization: +# +# unicorn_rails --config-file unicorn.config.rb +# +# You may also want to configure other parameters like :tcp_nodelay. +# +# For more information, please check the +# {documentation}[https://bogomips.org/unicorn/Unicorn/Configurator.html#method-i-listen]. +# +# If you are using Unicorn with NGINX, you may need to tweak NGINX. +# \Streaming should work out of the box on Rainbows. +# +# ==== Passenger +# +# Phusion Passenger with NGINX, offers two streaming mechanisms out of the box. +# +# 1. NGINX response buffering mechanism which is dependent on the value of +# +passenger_buffer_response+ option (default is "off"). +# 2. Passenger buffering system which is always 'on' irrespective of the value +# of +passenger_buffer_response+. +# +# When +passenger_buffer_response+ is turned "on", then streaming would be +# done at the NGINX level which waits until the application is done sending +# the response back to the client. +# +# For more information, please check the +# {documentation}[https://www.phusionpassenger.com/docs/references/config_reference/nginx/#passenger_buffer_response]. +# +# pkg:gem/actionpack#lib/action_controller/metal/streaming.rb:206 +module ActionController::Streaming + private + + # Set proper cache control and transfer encoding when streaming + # + # pkg:gem/actionpack#lib/action_controller/metal/streaming.rb:238 + def _process_options(options); end + + # Call render_body if we are streaming instead of usual +render+. + # + # pkg:gem/actionpack#lib/action_controller/metal/streaming.rb:252 + def _render_template(options); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/streaming.rb:207 +class ActionController::Streaming::Body + # Store the response body to be chunked. + # + # pkg:gem/actionpack#lib/action_controller/metal/streaming.rb:212 + def initialize(body); end + + # Close the response body if the response body supports it. + # + # pkg:gem/actionpack#lib/action_controller/metal/streaming.rb:231 + def close; end + + # For each element yielded by the response body, yield + # the element in chunked encoding. + # + # pkg:gem/actionpack#lib/action_controller/metal/streaming.rb:218 + def each(&block); end +end + +# pkg:gem/actionpack#lib/action_controller/metal/streaming.rb:209 +ActionController::Streaming::Body::TAIL = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_controller/metal/streaming.rb:208 +ActionController::Streaming::Body::TERM = T.let(T.unsafe(nil), String) + +# = 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.require(:person).permit(: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.require(:person).permit(:name, :age, pets_attributes: [ :id, :name, :category ]) +# end +# end +# +# See ActionController::Parameters.require and ActionController::Parameters.permit +# for more information. +# +# pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1278 +module ActionController::StrongParameters + # Returns a new ActionController::Parameters object that + # has been instantiated with the request.parameters. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1281 + 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. + # + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:1296 + def params=(value); end +end + +# pkg:gem/actionpack#lib/action_controller/template_assertions.rb:4 +module ActionController::TemplateAssertions + # pkg:gem/actionpack#lib/action_controller/template_assertions.rb:5 + 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: +# +# @controller:: +# The controller instance that will be tested. +# @request:: +# An ActionController::TestRequest, representing the current HTTP +# request. 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. +# @response:: +# An ActionDispatch::TestResponse object, representing the response +# of the 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') +# +# pkg:gem/actionpack#lib/action_controller/test_case.rb:345 +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 + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:571 + def _controller_class; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:571 + def _controller_class=(_arg0); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:571 + def _controller_class?; end + + class << self + # pkg:gem/actionpack#lib/action_controller/test_case.rb:572 + def __callbacks; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:571 + def _controller_class; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:571 + def _controller_class=(value); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:571 + def _controller_class?; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:346 + def executor_around_each_request; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:346 + def executor_around_each_request=(_arg0); end + end +end + +# pkg:gem/actionpack#lib/action_controller/test_case.rb:348 +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 + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:564 + def build_response(klass); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:524 + def controller_class_name; end + + # Simulate a DELETE request with the given parameters and set/volley the response. + # See +get+ for more details. + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:439 + def delete(action, **args); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:528 + 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. + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:413 + def get(action, **args); end + + # Simulate a HEAD request with the given parameters and set/volley the response. + # See +get+ for more details. + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:445 + def head(action, **args); end + + # Simulate a PATCH request with the given parameters and set/volley the response. + # See +get+ for more details. + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:427 + def patch(action, **args); end + + # Simulate a POST request with the given parameters and set/volley the response. + # See +get+ for more details. + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:421 + 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. + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:484 + 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. + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:433 + def put(action, **args); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:532 + def query_parameter_names(generated_extras); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:354 + def request; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:354 + def response; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:536 + def setup_controller_request_and_response; end + + private + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:656 + def check_required_ivars; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:652 + def document_root_element; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:607 + def process_controller_response(action, cookies, xhr); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:642 + def scrub_env!(env); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:577 + def setup_request(controller_class_name, action, parameters, session, flash, xhr); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:599 + 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 + +# pkg:gem/actionpack#lib/action_controller/test_case.rb:356 +module ActionController::TestCase::Behavior::ClassMethods + # pkg:gem/actionpack#lib/action_controller/test_case.rb:378 + def controller_class; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:374 + def controller_class=(new_class); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:386 + 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' + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:363 + 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. +# +# pkg:gem/actionpack#lib/action_controller/test_case.rb:34 +class ActionController::TestRequest < ::ActionDispatch::TestRequest + # pkg:gem/actionpack#lib/action_controller/test_case.rb:57 + def initialize(env, session, controller_class); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:76 + def assign_parameters(routes, controller_path, action, parameters, generated_path, query_string_keys); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:72 + def content_type=(type); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:42 + def controller_class; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:68 + def query_string=(string); end + + private + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:167 + def params_parsers; end + + class << self + # Create a new test request with default `env` values. + # + # pkg:gem/actionpack#lib/action_controller/test_case.rb:45 + def create(controller_class); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:38 + def new_session; end + + private + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:52 + def default_env; end + end +end + +# pkg:gem/actionpack#lib/action_controller/test_case.rb:35 +ActionController::TestRequest::DEFAULT_ENV = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_controller/test_case.rb:139 +ActionController::TestRequest::ENCODER = T.let(T.unsafe(nil), T.untyped) + +# Methods #destroy and #load! are overridden to avoid calling methods on the +# @store object, which does not exist for the TestSession class. +# +# pkg:gem/actionpack#lib/action_controller/test_case.rb:185 +class ActionController::TestSession < ::Rack::Session::Abstract::PersistedSecure::SecureSessionHash + # pkg:gem/actionpack#lib/action_controller/test_case.rb:188 + def initialize(session = T.unsafe(nil), id = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:208 + def destroy; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:212 + def dig(*keys); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:221 + def enabled?; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:196 + def exists?; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:217 + def fetch(key, *args, &block); end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:225 + def id_was; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:200 + def keys; end + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:204 + def values; end + + private + + # pkg:gem/actionpack#lib/action_controller/test_case.rb:230 + def load!; end +end + +# pkg:gem/actionpack#lib/action_controller/test_case.rb:186 +ActionController::TestSession::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_controller/metal/testing.rb:4 +module ActionController::Testing; end + +# Behavior specific to functional tests +# +# pkg:gem/actionpack#lib/action_controller/metal/testing.rb:6 +module ActionController::Testing::Functional + # pkg:gem/actionpack#lib/action_controller/metal/testing.rb:7 + def clear_instance_variables_between_requests; end + + # pkg:gem/actionpack#lib/action_controller/metal/testing.rb:16 + def recycle!; end +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 +# +# pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:62 +class ActionController::UnfilteredParameters < ::ArgumentError + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:63 + def initialize; end +end + +# pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:73 +class ActionController::UnknownFormat < ::ActionController::ActionControllerError; end + +# pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:70 +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 +# +# pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:47 +class ActionController::UnpermittedParameters < ::IndexError + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:50 + def initialize(params); end + + # pkg:gem/actionpack#lib/action_controller/metal/strong_parameters.rb:48 + 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 +# +# pkg:gem/actionpack#lib/action_controller/metal/url_for.rb:25 +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 + + # pkg:gem/actionpack#lib/action_controller/metal/url_for.rb:30 + def initialize(*, **, &); end + + # pkg:gem/actionpack#lib/action_controller/metal/url_for.rb:35 + 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 + +# pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:25 +class ActionController::UrlGenerationError < ::ActionController::ActionControllerError + include ::DidYouMean::Correctable + + # pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:28 + def initialize(message, routes = T.unsafe(nil), route_name = T.unsafe(nil), method_name = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:39 + def corrections; end + + # pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:26 + def method_name; end + + # pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:26 + def route_name; end + + # pkg:gem/actionpack#lib/action_controller/metal/exceptions.rb:26 + 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. +# +# pkg:gem/actionpack#lib/action_dispatch/deprecator.rb:3 +module ActionDispatch + include ::ActiveSupport::Deprecation::DeprecatedConstantAccessor + extend ::ActiveSupport::Autoload + + # pkg:gem/actionpack#lib/action_dispatch.rb:141 + def eager_load!; end + + # pkg:gem/actionpack#lib/action_dispatch.rb:127 + def test_app; end + + # pkg:gem/actionpack#lib/action_dispatch.rb:127 + def test_app=(val); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/deprecator.rb:4 + def deprecator; end + + # pkg:gem/actionpack#lib/action_dispatch.rb:127 + def test_app; end + + # pkg:gem/actionpack#lib/action_dispatch.rb:127 + def test_app=(val); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/actionable_exceptions.rb:7 +class ActionDispatch::ActionableExceptions + # pkg:gem/actionpack#lib/action_dispatch/middleware/actionable_exceptions.rb:10 + def initialize(app); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/actionable_exceptions.rb:14 + def call(env); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/actionable_exceptions.rb:8 + def endpoint; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/actionable_exceptions.rb:8 + def endpoint=(val); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/actionable_exceptions.rb:24 + def actionable_request?(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/actionable_exceptions.rb:28 + def redirect_to(location); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/middleware/actionable_exceptions.rb:8 + def endpoint; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/actionable_exceptions.rb:8 + 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. +# +# pkg:gem/actionpack#lib/action_dispatch/testing/assertion_response.rb:7 +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). + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertion_response.rb:20 + def initialize(code_or_name); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertion_response.rb:8 + def code; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertion_response.rb:33 + def code_and_name; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertion_response.rb:8 + def name; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertion_response.rb:38 + def code_from_name(name); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertion_response.rb:42 + def name_from_code(code); end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/assertion_response.rb:10 +ActionDispatch::AssertionResponse::GENERIC_RESPONSE_CODES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:4 +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 + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions.rb:15 + def html_document; end +end + +# A small suite of assertions that test responses from \Rails applications. +# +# pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:6 +module ActionDispatch::Assertions::ResponseAssertions + # 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 + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:57 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:30 + def assert_response(type, message = T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:102 + def code_with_name(code_or_name); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:86 + def generate_response_message(expected, actual = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:96 + def location_if_redirected; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:77 + def normalize_argument_to_redirection(fragment); end + + # Proxy to to_param if the object will respond to it. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:73 + def parameterize(value); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:91 + def response_body_if_short; end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/assertions/response.rb:7 +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. +# +# pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:11 +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" } + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:115 + 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') + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:77 + 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" }) + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:158 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:191 + def method_missing(selector, *args, **, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:42 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:183 + def with_routing(&block); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:201 + def create_routes; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:267 + def fail_on(exception_class, message); end + + # Recognizes the route for a given path. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:233 + def recognized_request_for(path, extras = T.unsafe(nil), msg); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:225 + def reset_routes(old_routes, old_controller); end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:14 +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 + # + # pkg:gem/actionpack#lib/action_dispatch/testing/assertions/routing.rb:28 + 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. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/assume_ssl.rb:10 +class ActionDispatch::AssumeSSL + # pkg:gem/actionpack#lib/action_dispatch/middleware/assume_ssl.rb:11 + def initialize(app); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/assume_ssl.rb:15 + def call(env); end +end + +# = Action Dispatch \Callbacks +# +# Provides callbacks to be executed before and after dispatching the request. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:7 +class ActionDispatch::Callbacks + include ::ActiveSupport::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:22 + def initialize(app); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:8 + def __callbacks; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:8 + def __callbacks?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:10 + def _call_callbacks; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:10 + def _run_call_callbacks(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:26 + def call(env); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:8 + def __callbacks; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:8 + def __callbacks=(value); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:8 + def __callbacks?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:10 + def _call_callbacks; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:10 + def _call_callbacks=(value); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:17 + def after(*args, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/callbacks.rb:13 + def before(*args, &block); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:6 +module ActionDispatch::Constants; end + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:10 +ActionDispatch::Constants::CONTENT_ENCODING = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:11 +ActionDispatch::Constants::CONTENT_SECURITY_POLICY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:12 +ActionDispatch::Constants::CONTENT_SECURITY_POLICY_REPORT_ONLY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:14 +ActionDispatch::Constants::FEATURE_POLICY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:13 +ActionDispatch::Constants::LOCATION = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:17 +ActionDispatch::Constants::SERVER_TIMING = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:18 +ActionDispatch::Constants::STRICT_TRANSPORT_SECURITY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:9 +ActionDispatch::Constants::VARY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:16 +ActionDispatch::Constants::X_CASCADE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/constants.rb:15 +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 +# +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:26 +class ActionDispatch::ContentSecurityPolicy + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:174 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:202 + def block_all_mixed_content(enabled = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:291 + def build(context = T.unsafe(nil), nonce = T.unsafe(nil), nonce_directives = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + def child_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + def connect_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + def default_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:172 + def directives; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + def font_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + def form_action(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + def frame_ancestors(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + def frame_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + def img_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + def manifest_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + def media_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:218 + def plugin_types(*types); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + 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" + # + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:231 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:244 + def require_sri_for(*types); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:265 + def sandbox(*values); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + def script_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + def script_src_attr(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + def script_src_elem(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + def style_src(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + def style_src_attr(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + def style_src_elem(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:283 + def upgrade_insecure_requests(enabled = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:184 + def worker_src(*sources); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:310 + def apply_mapping(source); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:297 + def apply_mappings(sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:332 + def build_directive(sources, context); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:316 + def build_directives(context, nonce, nonce_directives); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:179 + def initialize_copy(other); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:354 + def nonce_directive?(directive, nonce_directives); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:336 + def resolve_source(source, context); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:168 +ActionDispatch::ContentSecurityPolicy::DEFAULT_NONCE_DIRECTIVES = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:143 +ActionDispatch::ContentSecurityPolicy::DIRECTIVES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:123 +ActionDispatch::ContentSecurityPolicy::MAPPINGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:27 +class ActionDispatch::ContentSecurityPolicy::Middleware + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:28 + def initialize(app); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:32 + def call(env); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:54 + def header_name(request); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:62 + def policy_present?(headers); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:68 +module ActionDispatch::ContentSecurityPolicy::Request + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:75 + def content_security_policy; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:79 + def content_security_policy=(policy); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:107 + def content_security_policy_nonce; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:99 + def content_security_policy_nonce_directives; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:103 + def content_security_policy_nonce_directives=(generator); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:91 + def content_security_policy_nonce_generator; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:95 + def content_security_policy_nonce_generator=(generator); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:83 + def content_security_policy_report_only; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:87 + def content_security_policy_report_only=(value); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:118 + def generate_content_security_policy_nonce; end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:72 +ActionDispatch::ContentSecurityPolicy::Request::NONCE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:73 +ActionDispatch::ContentSecurityPolicy::Request::NONCE_DIRECTIVES = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:71 +ActionDispatch::ContentSecurityPolicy::Request::NONCE_GENERATOR = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:69 +ActionDispatch::ContentSecurityPolicy::Request::POLICY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_security_policy.rb:70 +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. +# # It can be read using the signed method `cookies.signed[:name]` +# cookies.signed[:user_id] = current_user.id +# +# # Sets an encrypted cookie value before sending it to the client which +# # prevent users from reading and tampering with its value. +# # It can be read using the encrypted method `cookies.encrypted[:name]` +# 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+. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:188 +class ActionDispatch::Cookies + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:683 + def initialize(app); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:687 + def call(env); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:194 +ActionDispatch::Cookies::AUTHENTICATED_ENCRYPTED_COOKIE_SALT = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:489 +class ActionDispatch::Cookies::AbstractCookieJar + include ::ActionDispatch::Cookies::ChainedCookieJars + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:492 + def initialize(parent_jar); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:496 + def [](name); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:508 + def []=(name, options); end + + protected + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:520 + def request; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:538 + def commit(name, options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:531 + def cookie_metadata(name, options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:523 + def expiry_options(options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:537 + def parse(name, data, purpose: T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:200 +ActionDispatch::Cookies::COOKIES_DIGEST = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:201 +ActionDispatch::Cookies::COOKIES_ROTATIONS = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:202 +ActionDispatch::Cookies::COOKIES_SAME_SITE_PROTECTION = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:199 +ActionDispatch::Cookies::COOKIES_SERIALIZER = T.let(T.unsafe(nil), String) + +# Include in a cookie jar to allow chaining, e.g. +cookies.permanent.signed+. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:212 +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 + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:258 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:224 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:240 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:264 + def signed_or_encrypted; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:287 + def encrypted_cookie_cipher; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:281 + def prepare_upgrade_legacy_hmac_aes_cbc_cookies?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:291 + def signed_cookie_digest; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:274 + def upgrade_legacy_hmac_aes_cbc_cookies?; end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:296 +class ActionDispatch::Cookies::CookieJar + include ::ActionDispatch::Cookies::ChainedCookieJars + include ::Enumerable + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:307 + def initialize(request); end + + # Returns the value of the cookie by +name+, or +nil+ if no such cookie exists. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:328 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:362 + def []=(name, options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:424 + def always_write_cookie; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:424 + def always_write_cookie=(val); end + + # Removes all cookies on the client machine by calling delete for each cookie. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:408 + def clear(options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:317 + def commit!; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:315 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:387 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:401 + def deleted?(name, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:323 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:332 + def fetch(name, *args, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:339 + def has_key?(name); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:336 + def key?(name); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:305 + def request; end + + # Returns the cookies as Hash. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:342 + def to_hash(*_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:356 + def to_header; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:344 + def update(other_hash); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:349 + def update_cookies_from_jar; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:412 + def write(response); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:427 + def escape(string); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:435 + def handle_options(options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:431 + def write_cookie?(cookie); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:424 + def always_write_cookie; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:424 + def always_write_cookie=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:299 + def build(req, cookies); end + end +end + +# Raised when storing more than 4K of session data. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:209 +class ActionDispatch::Cookies::CookieOverflow < ::StandardError; end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:196 +ActionDispatch::Cookies::ENCRYPTED_COOKIE_CIPHER = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:192 +ActionDispatch::Cookies::ENCRYPTED_COOKIE_SALT = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:193 +ActionDispatch::Cookies::ENCRYPTED_SIGNED_COOKIE_SALT = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:631 +class ActionDispatch::Cookies::EncryptedKeyRotatingCookieJar < ::ActionDispatch::Cookies::AbstractCookieJar + include ::ActionDispatch::Cookies::SerializedCookieJars + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:634 + def initialize(parent_jar); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:676 + def commit(name, options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:668 + def parse(name, encrypted_message, purpose: T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:190 +ActionDispatch::Cookies::GENERATOR_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:189 +ActionDispatch::Cookies::HTTP_HEADER = T.let(T.unsafe(nil), String) + +# Cookies can typically store 4096 bytes. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:206 +ActionDispatch::Cookies::MAX_COOKIE_SIZE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:541 +class ActionDispatch::Cookies::PermanentCookieJar < ::ActionDispatch::Cookies::AbstractCookieJar + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:543 + def commit(name, options); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:198 +ActionDispatch::Cookies::SECRET_KEY_BASE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:197 +ActionDispatch::Cookies::SIGNED_COOKIE_DIGEST = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:191 +ActionDispatch::Cookies::SIGNED_COOKIE_SALT = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:548 +module ActionDispatch::Cookies::SerializedCookieJars + protected + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:552 + def digest; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:595 + def check_for_overflow!(name, options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:591 + def commit(name, options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:577 + def parse(name, dumped, force_reserialize: T.unsafe(nil), **); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:571 + def reserialize?(dumped); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:557 + def serializer; end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:549 +ActionDispatch::Cookies::SerializedCookieJars::SERIALIZER = ActiveSupport::MessageEncryptor::NullSerializer + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:602 +class ActionDispatch::Cookies::SignedKeyRotatingCookieJar < ::ActionDispatch::Cookies::AbstractCookieJar + include ::ActionDispatch::Cookies::SerializedCookieJars + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:605 + def initialize(parent_jar); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:624 + def commit(name, options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:618 + def parse(name, signed_message, purpose: T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:195 +ActionDispatch::Cookies::USE_AUTHENTICATED_COOKIE_ENCRYPTION = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:203 +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. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:13 +class ActionDispatch::DebugExceptions + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:21 + def initialize(app, routes_app = T.unsafe(nil), response_format = T.unsafe(nil), interceptors = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:28 + def call(env); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:177 + def api_request?(content_type); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:114 + def create_template(request, wrapper); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:48 + def invoke_interceptors(request, exception, wrapper); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:151 + def log_array(logger, lines, request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:133 + def log_error(request, wrapper); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:181 + def log_rescued_responses?(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:163 + def logger(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:129 + def render(status, body, format); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:56 + def render_exception(request, exception, wrapper); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:90 + def render_for_api_request(content_type, wrapper); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:76 + def render_for_browser_request(request, wrapper); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:171 + def routes_inspector(exception); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:167 + def stderr_logger; end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:14 + def interceptors; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_exceptions.rb:16 + 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. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/debug_locks.rb:27 +class ActionDispatch::DebugLocks + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_locks.rb:28 + def initialize(app, path = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_locks.rb:33 + def call(env); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_locks.rb:106 + def blocked_by?(victim, blocker, all_threads); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_locks.rb:47 + def render_details(req); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:9 +class ActionDispatch::DebugView < ::ActionView::Base + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:12 + def initialize(assigns); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:19 + def compiled_method_container; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:47 + def debug_hash(object); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:39 + def debug_headers(headers); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:27 + def debug_params(params); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:23 + def error_highlight_available?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:65 + def params_valid?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:61 + def protect_against_forgery?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:51 + def render(*); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/debug_view.rb:10 +ActionDispatch::DebugView::RESCUES_TEMPLATE_PATHS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch.rb:50 +class ActionDispatch::DeprecatedIllegalStateError < ::StandardError; end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:9 +class ActionDispatch::ExceptionWrapper + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:48 + def initialize(backtrace_cleaner, exception); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:99 + def actions; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:111 + def annotated_source_code; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:133 + def application_trace; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:46 + def backtrace_cleaner; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:87 + def corrections; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:210 + def error_highlight_available?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:46 + def exception; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:46 + def exception_class_name; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:239 + def exception_id; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:235 + def exception_inspect; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:227 + def exception_name; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:127 + def exception_trace; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:75 + def failures; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:91 + def file_name; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:137 + def framework_trace; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:141 + def full_trace; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:71 + def has_cause?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:79 + def has_corrections?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:95 + def line_number; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:231 + def message; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:83 + def original_message; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:200 + def rescue_response?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:10 + def rescue_responses; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:10 + def rescue_responses=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:119 + def rescue_template; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:28 + def rescue_templates; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:28 + def rescue_templates=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:59 + def routing_error?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:177 + def show?(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:41 + def silent_exceptions; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:41 + def silent_exceptions=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:204 + def source_extracts; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:223 + def source_to_show_id; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:123 + def status_code; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:67 + def sub_template_message; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:63 + def template_error?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:215 + def trace_to_show; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:145 + def traces; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:103 + def unwrapped_exception; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:46 + def wrapped_causes; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:37 + def wrapper_exceptions; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:37 + def wrapper_exceptions=(val); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:263 + def backtrace; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:265 + def build_backtrace; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:288 + def causes_for(exception); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:298 + def clean_backtrace(*args); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:351 + def extract_file_and_line_number(trace); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:306 + def extract_source(trace); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:335 + def extract_source_fragment_lines(source_lines, line); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:341 + def source_fragment(path, line); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:294 + def wrapped_causes_for(exception, backtrace_cleaner); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:10 + def rescue_responses; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:10 + def rescue_responses=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:28 + def rescue_templates; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:28 + def rescue_templates=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:41 + def silent_exceptions; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:41 + def silent_exceptions=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:173 + def status_code_for_exception(class_name); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:37 + def wrapper_exceptions; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:37 + def wrapper_exceptions=(val); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:244 +class ActionDispatch::ExceptionWrapper::SourceMapLocation + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:245 + def initialize(location, template); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/exception_wrapper.rb:250 + def spot(exc); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/executor.rb:6 +class ActionDispatch::Executor + # pkg:gem/actionpack#lib/action_dispatch/middleware/executor.rb:7 + def initialize(app, executor); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/executor.rb:11 + 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 +# +# 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. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:45 +class ActionDispatch::FileHandler + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:53 + def initialize(root, index: T.unsafe(nil), headers: T.unsafe(nil), precompressed: T.unsafe(nil), compressible_content_types: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:67 + def attempt(env); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:63 + def call(env); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:183 + def clean_path(path_info); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:147 + def compressible?(content_type); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:160 + def each_candidate_filepath(path_info); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:151 + def each_precompressed_filepath(filepath); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:142 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:102 + def find_file(path_info, accept_encoding:); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:78 + def serve(request, filepath, content_headers); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:110 + def try_files(filepath, content_type, accept_encoding:); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:120 + def try_precompressed_files(filepath, headers, accept_encoding:); end +end + +# +Accept-Encoding+ value -> file extension +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:47 +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. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:43 +class ActionDispatch::Flash + class << self + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:300 + def new(app); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:112 +class ActionDispatch::Flash::FlashHash + include ::Enumerable + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:142 + def initialize(flashes = T.unsafe(nil), discard = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:162 + def [](k); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:156 + def []=(k, v); end + + # Convenience accessor for flash[:alert]. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:268 + def alert; end + + # Convenience accessor for flash[:alert]=. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:273 + def alert=(message); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:197 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:182 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:253 + def discard(k = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:202 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:193 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:240 + def keep(k = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:176 + def key?(name); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:172 + def keys; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:206 + def merge!(h); end + + # Convenience accessor for flash[:notice]. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:278 + def notice; end + + # Convenience accessor for flash[:notice]=. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:283 + 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!" + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:232 + def now; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:208 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:262 + def sweep; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:189 + def to_hash; end + + # Builds a hash containing the flashes to keep for the next request. + # If there are none to keep, returns +nil+. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:136 + def to_session_value; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:166 + def update(h); end + + protected + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:288 + def now_is_loaded?; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:148 + def initialize_copy(other); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:293 + def stringify_array(array); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:115 + def from_session_value(value); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:83 +class ActionDispatch::Flash::FlashNow + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:86 + def initialize(flash); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:97 + def [](k); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:90 + def []=(k, v); end + + # Convenience accessor for flash.now[:alert]=. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:102 + def alert=(message); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:84 + def flash; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:84 + def flash=(_arg0); end + + # Convenience accessor for flash.now[:notice]=. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:107 + def notice=(message); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:44 +ActionDispatch::Flash::KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:46 +module ActionDispatch::Flash::RequestMethods + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:64 + def commit_flash; end + + # Access the contents of the flash. Returns a ActionDispatch::Flash::FlashHash. + # + # See ActionDispatch::Flash for example usage. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:50 + def flash; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:56 + def flash=(flash); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:60 + def flash_hash; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/flash.rb:77 + 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. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:20 +class ActionDispatch::HostAuthorization + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:125 + def initialize(app, hosts, exclude: T.unsafe(nil), response_app: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:133 + def call(env); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:149 + def blocked_hosts(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:161 + def excluded?(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:165 + def mark_as_authorized(request); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:21 +ActionDispatch::HostAuthorization::ALLOWED_HOSTS_IN_DEVELOPMENT = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:86 +class ActionDispatch::HostAuthorization::DefaultResponseApp + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:89 + def call(env); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:120 + def available_logger(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:112 + def log_error(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:105 + def response(format, body); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:98 + def response_body(request); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:87 +ActionDispatch::HostAuthorization::DefaultResponseApp::RESPONSE_STATUS = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:24 +ActionDispatch::HostAuthorization::IPV4_HOSTNAME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:25 +ActionDispatch::HostAuthorization::IPV6_HOSTNAME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:26 +ActionDispatch::HostAuthorization::IPV6_HOSTNAME_WITH_PORT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:22 +ActionDispatch::HostAuthorization::PORT_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:33 +class ActionDispatch::HostAuthorization::Permissions + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:34 + def initialize(hosts); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:42 + def allows?(host); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:38 + def empty?; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:81 + def extract_hostname(host); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:59 + def sanitize_hosts(hosts); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:69 + def sanitize_regexp(host); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:73 + def sanitize_string(host); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:23 +ActionDispatch::HostAuthorization::SUBDOMAIN_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/host_authorization.rb:27 +ActionDispatch::HostAuthorization::VALID_IP_HOSTNAME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch.rb:95 +module ActionDispatch::Http + extend ::ActiveSupport::Autoload +end + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:5 +module ActionDispatch::Http::Cache; end + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:6 +module ActionDispatch::Http::Cache::Request + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:28 + 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, both must match, or the request is not considered fresh. + # + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:38 + def fresh?(response); end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:10 + def if_modified_since; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:16 + def if_none_match; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:20 + def if_none_match_etags; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:24 + def not_modified?(modified_at); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:7 +ActionDispatch::Http::Cache::Request::HTTP_IF_MODIFIED_SINCE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:8 +ActionDispatch::Http::Cache::Request::HTTP_IF_NONE_MATCH = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:51 +module ActionDispatch::Http::Cache::Response + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:52 + def cache_control; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:68 + def date; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:78 + def date=(utc_time); end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:74 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:101 + def etag=(weak_validators); end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:113 + def etag?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:54 + def last_modified; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:64 + def last_modified=(utc_time); end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:60 + def last_modified?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:109 + def strong_etag=(strong_validators); end + + # True if an ETag is set, and it isn't a weak validator (not preceded with W/). + # + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:121 + def strong_etag?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:105 + def weak_etag=(weak_validators); end + + # True if an ETag is set, and it's a weak validator (preceded with W/). + # + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:116 + def weak_etag?; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:144 + def cache_control_headers; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:138 + def cache_control_segments; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:134 + def generate_strong_etag(validators); end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:130 + def generate_weak_etag(validators); end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:173 + def handle_conditional_get!; end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:183 + def merge_and_normalize_cache_control!(cache_control); end + + # pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:162 + def prepare_cache_control!; end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:126 +ActionDispatch::Http::Cache::Response::DATE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:166 +ActionDispatch::Http::Cache::Response::DEFAULT_CACHE_CONTROL = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:127 +ActionDispatch::Http::Cache::Response::LAST_MODIFIED = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:171 +ActionDispatch::Http::Cache::Response::MUST_REVALIDATE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:168 +ActionDispatch::Http::Cache::Response::NO_CACHE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:167 +ActionDispatch::Http::Cache::Response::NO_STORE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:170 +ActionDispatch::Http::Cache::Response::PRIVATE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:169 +ActionDispatch::Http::Cache::Response::PUBLIC = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/cache.rb:128 +ActionDispatch::Http::Cache::Response::SPECIAL_KEYS = T.let(T.unsafe(nil), Set) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:5 +class ActionDispatch::Http::ContentDisposition + # pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:12 + def initialize(disposition:, filename:); end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:19 + def ascii_filename; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:10 + def disposition; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:10 + def filename; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:29 + def to_s; end + + # pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:25 + def utf8_filename; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:38 + def percent_escape(string, pattern); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:6 + def format(disposition:, filename:); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:23 +ActionDispatch::Http::ContentDisposition::RFC_5987_ESCAPED_CHAR = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/http/content_disposition.rb:17 +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. +# +# pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:16 +module ActionDispatch::Http::FilterParameters + # pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:21 + def initialize; end + + # Returns a hash of request.env with all sensitive data replaced. + # + # pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:37 + def filtered_env; end + + # Returns a hash of parameters with all sensitive data replaced. + # + # pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:30 + def filtered_parameters; end + + # Reconstructs a path with all sensitive GET parameters replaced. + # + # pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:42 + def filtered_path; end + + # Returns the +ActiveSupport::ParameterFilter+ object used to filter in this request. + # + # pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:47 + def parameter_filter; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:56 + def env_filter; end + + # pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:69 + def filtered_query_string; end + + # pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:63 + def parameter_filter_for(filters); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:17 +ActionDispatch::Http::FilterParameters::ENV_MATCH = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:67 +ActionDispatch::Http::FilterParameters::KV_RE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:19 +ActionDispatch::Http::FilterParameters::NULL_ENV_FILTER = T.let(T.unsafe(nil), ActiveSupport::ParameterFilter) + +# pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:18 +ActionDispatch::Http::FilterParameters::NULL_PARAM_FILTER = T.let(T.unsafe(nil), ActiveSupport::ParameterFilter) + +# pkg:gem/actionpack#lib/action_dispatch/http/filter_parameters.rb:68 +ActionDispatch::Http::FilterParameters::PAIR_RE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/http/filter_redirect.rb:5 +module ActionDispatch::Http::FilterRedirect + # pkg:gem/actionpack#lib/action_dispatch/http/filter_redirect.rb:8 + def filtered_location; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/filter_redirect.rb:25 + def location_filter_match?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/filter_redirect.rb:17 + def location_filters; end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/filter_redirect.rb:6 +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" +# +# pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:26 +class ActionDispatch::Http::Headers + include ::Enumerable + + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:56 + def initialize(request); end + + # Returns the value for the given key mapped to @env. + # + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:61 + def [](key); end + + # Sets the given value for the key mapped to @env. + # + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:66 + def []=(key, value); end + + # Add a value to a multivalued header like +Vary+ or +Accept-Encoding+. + # + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:71 + def add(key, value); end + + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:97 + def each(&block); end + + # pkg:gem/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. + # + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:89 + def fetch(key, default = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:78 + def include?(key); end + + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:75 + def key?(key); end + + # Returns a new Http::Headers instance containing the contents of + # headers_or_env and the original instance. + # + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:103 + 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. + # + # pkg:gem/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. + # + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:123 + def env_name(key); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:52 + def from_hash(hash); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:27 +ActionDispatch::Http::Headers::CGI_VARIABLES = T.let(T.unsafe(nil), Set) + +# pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:80 +ActionDispatch::Http::Headers::DEFAULT = T.let(T.unsafe(nil), Object) + +# pkg:gem/actionpack#lib/action_dispatch/http/headers.rb:48 +ActionDispatch::Http::Headers::HTTP_HEADER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:7 +module ActionDispatch::Http::MimeNegotiation + extend ::ActiveSupport::Concern + + # Returns the accepted MIME type for the request. + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:54 + def accepts; end + + # The MIME type of the HTTP request, such as Mime[:xml]. + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:36 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:75 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:127 + def format=(extension); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:79 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:146 + def formats=(extensions); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:49 + def has_content_type?; end + + # Returns the first MIME type that matches the provided array of MIME types. + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:154 + def negotiate_mime(order); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:166 + def should_apply_vary_header?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:112 + def variant; end + + # Sets the \variant for template. + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:102 + def variant=(variant); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:190 + def format_from_path_extension; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:175 + def params_readable?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:186 + def use_accept_header; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:181 + 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. +# +# pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:173 +ActionDispatch::Http::MimeNegotiation::BROWSER_LIKE_ACCEPTS = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:10 +class ActionDispatch::Http::MimeNegotiation::InvalidType < ::Mime::Type::InvalidMimeType; end + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_negotiation.rb:12 +ActionDispatch::Http::MimeNegotiation::RESCUABLE_MIME_FORMAT_ERRORS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:5 +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. + # + # pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:50 + def parameters; end + + # pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:63 + 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" } + # + # pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:82 + def path_parameters; end + + # pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:65 + def path_parameters=(parameters); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:100 + def log_parse_error_once; end + + # pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:112 + def params_parsers; end + + # pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:87 + def parse_formatted_parameters(parsers); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:34 +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 + # + # pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:44 + def parameter_parsers=(parsers); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:10 +ActionDispatch::Http::Parameters::DEFAULT_PARSERS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:8 +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. +# +# pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:19 +class ActionDispatch::Http::Parameters::ParseError < ::StandardError + # pkg:gem/actionpack#lib/action_dispatch/http/parameters.rb:20 + def initialize(message = T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/url.rb:7 +module ActionDispatch::Http::URL + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:179 + 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". + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:321 + def domain(tld_length = T.unsafe(nil)); end + + # Returns the host for this request, such as "example.com". + # + # req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' + # req.host # => "example.com" + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:226 + 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" + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:242 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:292 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:253 + 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" + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:304 + 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://" + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:200 + 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" + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:214 + def raw_host_with_port; end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:12 + def secure_protocol; end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:12 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:315 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:265 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:280 + 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". + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:337 + 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". + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:329 + def subdomains(tld_length = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:13 + def tld_length; end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:13 + 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" + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:189 + def url; end + + class << self + # 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" + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:22 + 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" + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:46 + 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"] + # + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:32 + def extract_subdomains(host, tld_length); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:58 + def full_url_for(options); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:70 + def path_for(options); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:12 + def secure_protocol; end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:12 + def secure_protocol=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:13 + def tld_length; end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:13 + def tld_length=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:50 + def url_for(options); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:90 + def add_anchor(path, anchor); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:83 + def add_params(path, params); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:105 + def build_host_url(host, port, protocol, options, path); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:96 + def extract_domain_from(host, tld_length); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:100 + def extract_subdomains_from(host, tld_length); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:129 + def named_host?(host); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:146 + def normalize_host(_host, options); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:166 + def normalize_port(port, protocol); end + + # pkg:gem/actionpack#lib/action_dispatch/http/url.rb:133 + def normalize_protocol(protocol); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/url.rb:9 +ActionDispatch::Http::URL::HOST_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/http/url.rb:8 +ActionDispatch::Http::URL::IP_HOST_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/http/url.rb:10 +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. +# +# pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:15 +class ActionDispatch::Http::UploadedFile + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:29 + def initialize(hash); end + + # Shortcut for +tempfile.close+. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:71 + def close(unlink_now = T.unsafe(nil)); end + + # A string with the MIME type of the file. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:20 + def content_type; end + + # A string with the MIME type of the file. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:20 + def content_type=(_arg0); end + + # Shortcut for +tempfile.eof?+. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:96 + def eof?; end + + # A string with the headers of the multipart request. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:27 + def headers; end + + # A string with the headers of the multipart request. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:27 + def headers=(_arg0); end + + # Shortcut for +tempfile.open+. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:66 + def open; end + + # The basename of the file in the client. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:17 + def original_filename; end + + # The basename of the file in the client. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:17 + def original_filename=(_arg0); end + + # Shortcut for +tempfile.path+. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:76 + def path; end + + # Shortcut for +tempfile.read+. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:61 + def read(length = T.unsafe(nil), buffer = T.unsafe(nil)); end + + # Shortcut for +tempfile.rewind+. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:86 + def rewind; end + + # Shortcut for +tempfile.size+. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:91 + def size; end + + # A +Tempfile+ object with the actual uploaded file. Note that some of + # its interface is available directly. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:24 + def tempfile; end + + # A +Tempfile+ object with the actual uploaded file. Note that some of + # its interface is available directly. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:24 + def tempfile=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:100 + def to_io; end + + # Shortcut for +tempfile.to_path+. + # + # pkg:gem/actionpack#lib/action_dispatch/http/upload.rb:81 + def to_path; end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:11 +module ActionDispatch::Integration; end + +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:12 +module ActionDispatch::Integration::RequestHelpers + # Performs a DELETE request with the given parameters. See ActionDispatch::Integration::Session#process + # for more details. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:39 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:63 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:15 + def get(path, **args); end + + # Performs a HEAD request with the given parameters. See ActionDispatch::Integration::Session#process + # for more details. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:45 + def head(path, **args); end + + # Performs an OPTIONS request with the given parameters. See ActionDispatch::Integration::Session#process + # for more details. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:51 + def options(path, **args); end + + # Performs a PATCH request with the given parameters. See ActionDispatch::Integration::Session#process + # for more details. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:27 + def patch(path, **args); end + + # Performs a POST request with the given parameters. See ActionDispatch::Integration::Session#process + # for more details. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:21 + def post(path, **args); end + + # Performs a PUT request with the given parameters. See ActionDispatch::Integration::Session#process + # for more details. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:33 + def put(path, **args); end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:325 +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 + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:333 + def initialize(*args, &blk); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:330 + def app; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:404 + def assertions; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:408 + def assertions=(assertions); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:375 + def assigns(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:338 + def before_setup; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:375 + def cookies(*, **, &); end + + # Copy the instance variables from the current session instance into the + # test instance. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:414 + def copy_session_variables!; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:353 + def create_session(app); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:420 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:424 + def default_url_options=(options); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:375 + def delete(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:375 + def follow_redirect!(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:375 + def get(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:375 + def head(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:343 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:396 + def open_session; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:375 + def patch(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:375 + def post(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:375 + def put(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:365 + def remove!; end + + # Reset the current session. This is useful for testing multiple sessions + # in a single test case. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:349 + def reset!; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:331 + def root_session; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:331 + def root_session=(_arg0); end + + private + + # Delegate unhandled messages to the current session instance. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:434 + def method_missing(method, *args, **, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:429 + def respond_to_missing?(method, _); end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:328 +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. +# +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:89 +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. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:131 + def initialize(app); end + + # The Accept header to send. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:108 + def accept; end + + # The Accept header to send. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:108 + def accept=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:95 + def body(*, **, &); end + + # A reference to the controller instance used by the last request. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:117 + def controller; end + + # A map of the cookies returned by the last response, and which will be + # sent with the next request. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:112 + def cookies; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:128 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:128 + def default_url_options=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:128 + def default_url_options?; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:95 + def headers(*, **, &); end + + # The hostname used in the last request. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:99 + def host; end + + # Set the host name to use in the next request. + # + # session.host! "www.example.com" + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:306 + def host!(_arg0); end + + # The hostname used in the last request. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:102 + def host=(_arg0); end + + # Specify whether or not the session should mimic a secure HTTPS request. + # + # session.https! + # session.https!(false) + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:179 + def https!(flag = T.unsafe(nil)); end + + # Returns +true+ if the session is mimicking a secure HTTPS request. + # + # if session.https? + # ... + # end + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:188 + def https?; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:96 + def path(*, **, &); 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 } + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:226 + 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 + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:95 + def redirect?(*, **, &); end + + # The remote_addr used in the last request. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:105 + def remote_addr; end + + # The remote_addr used in the last request. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:105 + def remote_addr=(_arg0); end + + # A reference to the request instance used by the last request. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:120 + def request; end + + # A running counter of the number of requests processed. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:126 + def request_count; end + + # A running counter of the number of requests processed. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:126 + 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! + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:155 + def reset!; end + + # A reference to the response instance used by the last request. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:123 + def response; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:95 + def status(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:95 + def status_message(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:138 + def url_options; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:309 + def _mock_session; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:317 + def build_expanded_path(path); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:313 + def build_full_uri(path, env); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:128 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:128 + def default_url_options=(value); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:128 + def default_url_options?; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:90 +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_select '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_select '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. +# +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:641 +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::IntegrationTest::Behavior + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor + include ::ActionDispatch::IntegrationTest::UrlOptions + extend ::ActionDispatch::IntegrationTest::Behavior::ClassMethods +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:651 +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 + extend ::ActiveSupport::Concern + include ::ActionDispatch::Routing::UrlFor + include ::ActionDispatch::IntegrationTest::UrlOptions + + mixes_in_class_methods ::ActionDispatch::IntegrationTest::Behavior::ClassMethods + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:682 + def app; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:686 + def document_root_element; end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:664 +module ActionDispatch::IntegrationTest::Behavior::ClassMethods + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:665 + def app; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:673 + def app=(app); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:677 + def register_encoder(*args, **options); end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:644 +module ActionDispatch::IntegrationTest::UrlOptions + extend ::ActiveSupport::Concern + + # pkg:gem/actionpack#lib/action_dispatch/testing/integration.rb:646 + def url_options; end +end + +# :stopdoc: +# +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:4 +module ActionDispatch::Journey; end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:7 +class ActionDispatch::Journey::Ast + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:11 + def initialize(tree, formatted); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:37 + def glob?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:8 + def names; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:8 + def path_params; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:23 + def requirements=(requirements); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:9 + def root; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:33 + def route=(route); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:8 + def terminals; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:8 + def tree; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:8 + def wildcard_options; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:42 + def stars; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:42 + def symbols; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:44 + def visit_tree(formatted); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:6 +class ActionDispatch::Journey::Format + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:22 + def initialize(parts); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:37 + def evaluate(hash); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:14 + def required_path(symbol); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:18 + def required_segment(symbol); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:7 +ActionDispatch::Journey::Format::ESCAPE_PATH = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:8 +ActionDispatch::Journey::Format::ESCAPE_SEGMENT = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:10 +class ActionDispatch::Journey::Format::Parameter < ::Struct + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:11 + def escape(value); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:10 + def escaper; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:10 + def escaper=(_); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:10 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:10 + def name=(_); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:10 + def [](*_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:10 + def inspect; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:10 + def keyword_init?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:10 + def members; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:10 + 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. +# +# pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:10 +class ActionDispatch::Journey::Formatter + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:13 + def initialize(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:103 + def clear; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:59 + def generate(name, options, path_parameters); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:11 + def routes; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:202 + def build_cache; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:213 + def cache; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:108 + def extract_parameterized_parts(route, options, recall); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:135 + def match_route(name, options); end + + # Returns an array populated with missing keys if any are present. + # + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:174 + def missing_keys(route, parts); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:131 + def named_routes; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:157 + def non_recursive(cache, options); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:194 + def possibles(cache, options, depth = T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:32 +class ActionDispatch::Journey::Formatter::MissingRoute + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:35 + def initialize(constraints, missing_keys, unmatched_keys, routes, name); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:33 + def constraints; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:51 + def message; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:33 + def missing_keys; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:33 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:47 + def params; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:43 + def path(method_name); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:33 + def routes; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:33 + def unmatched_keys; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:18 +class ActionDispatch::Journey::Formatter::RouteWithParams + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:21 + def initialize(route, parameterized_parts, params); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:19 + def params; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/formatter.rb:27 + def path(_); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:7 +module ActionDispatch::Journey::GTG; end + +# pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:8 +class ActionDispatch::Journey::GTG::Builder + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:13 + def initialize(root); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:11 + def ast; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:11 + def endpoints; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:86 + def firstpos(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:107 + def lastpos(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:64 + def nullable?(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:11 + def root; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:19 + def transition_table; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:129 + def build_followpos; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:142 + def symbol(edge); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/gtg/builder.rb:9 +ActionDispatch::Journey::GTG::Builder::DUMMY_END_NODE = T.let(T.unsafe(nil), ActionDispatch::Journey::Nodes::Dummy) + +# pkg:gem/actionpack#lib/action_dispatch/journey/gtg/simulator.rb:8 +class ActionDispatch::Journey::GTG::MatchData + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/simulator.rb:11 + def initialize(memos); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/simulator.rb:9 + def memos; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/gtg/simulator.rb:16 +class ActionDispatch::Journey::GTG::Simulator + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/simulator.rb:21 + def initialize(transition_table); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/simulator.rb:25 + def memos(string); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/simulator.rb:19 + def tt; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/gtg/simulator.rb:17 +ActionDispatch::Journey::GTG::Simulator::INITIAL_STATE = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:8 +class ActionDispatch::Journey::GTG::TransitionTable + include ::ActionDispatch::Journey::NFA::Dot + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:16 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:163 + def []=(from, to, sym); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:32 + def accepting?(state); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:28 + def accepting_states; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:24 + def add_accepting(state); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:36 + def add_memo(idx, memo); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:98 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:44 + def eclosure(t); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:40 + def memo(idx); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:11 + def memos; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:48 + def move(t, full_string, start_index, end_index); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:180 + def states; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:115 + def to_svg; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:187 + def transitions; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:125 + def visualizer(paths, title = T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:198 + def states_hash_for(sym); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:13 +ActionDispatch::Journey::GTG::TransitionTable::DEFAULT_EXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/journey/gtg/transition_table.rb:14 +ActionDispatch::Journey::GTG::TransitionTable::DEFAULT_EXP_ANCHORED = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/journey/nfa/dot.rb:5 +module ActionDispatch::Journey::NFA; end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nfa/dot.rb:6 +module ActionDispatch::Journey::NFA::Dot + # pkg:gem/actionpack#lib/action_dispatch/journey/nfa/dot.rb:7 + def to_dot; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:67 +module ActionDispatch::Journey::Nodes; end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:180 +class ActionDispatch::Journey::Nodes::Binary < ::ActionDispatch::Journey::Nodes::Node + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:183 + def initialize(left, right); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:188 + def children; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:181 + def right; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:181 + def right=(_arg0); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:191 +class ActionDispatch::Journey::Nodes::Cat < ::ActionDispatch::Journey::Nodes::Binary + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:192 + def cat?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:193 + def type; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:132 +class ActionDispatch::Journey::Nodes::Dot < ::ActionDispatch::Journey::Nodes::Terminal + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:133 + def type; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:120 +class ActionDispatch::Journey::Nodes::Dummy < ::ActionDispatch::Journey::Nodes::Literal + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:121 + def initialize(x = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:125 + def literal?; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:157 +class ActionDispatch::Journey::Nodes::Group < ::ActionDispatch::Journey::Nodes::Unary + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:159 + def group?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:158 + def type; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:115 +class ActionDispatch::Journey::Nodes::Literal < ::ActionDispatch::Journey::Nodes::Terminal + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:116 + def literal?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:117 + def type; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:68 +class ActionDispatch::Journey::Nodes::Node + include ::Enumerable + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:73 + def initialize(left); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:106 + def cat?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:78 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:107 + def group?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:71 + def left; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:71 + def left=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:103 + def literal?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:71 + def memo; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:71 + def memo=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:94 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:105 + def star?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:102 + def symbol?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:104 + def terminal?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:86 + def to_dot; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:82 + def to_s; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:90 + def to_sym; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:98 + def type; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:196 +class ActionDispatch::Journey::Nodes::Or < ::ActionDispatch::Journey::Nodes::Node + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:199 + def initialize(children); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:197 + def children; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:203 + def type; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:128 +class ActionDispatch::Journey::Nodes::Slash < ::ActionDispatch::Journey::Nodes::Terminal + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:129 + def type; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:162 +class ActionDispatch::Journey::Nodes::Star < ::ActionDispatch::Journey::Nodes::Unary + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:165 + def initialize(left); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:175 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:163 + def regexp; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:163 + def regexp=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:172 + def star?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:173 + def type; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:136 +class ActionDispatch::Journey::Nodes::Symbol < ::ActionDispatch::Journey::Nodes::Terminal + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:143 + def initialize(left, regexp = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:139 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:137 + def regexp; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:137 + def regexp=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:138 + def symbol; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:150 + def symbol?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:149 + def type; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:141 +ActionDispatch::Journey::Nodes::Symbol::DEFAULT_EXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:142 +ActionDispatch::Journey::Nodes::Symbol::GREEDY_EXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:110 +class ActionDispatch::Journey::Nodes::Terminal < ::ActionDispatch::Journey::Nodes::Node + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:111 + def symbol; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:112 + def terminal?; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:153 +class ActionDispatch::Journey::Nodes::Unary < ::ActionDispatch::Journey::Nodes::Node + # pkg:gem/actionpack#lib/action_dispatch/journey/nodes/node.rb:154 + def children; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/parser_extras.rb:9 +class ActionDispatch::Journey::Parser < ::Racc::Parser + include ::ActionDispatch::Journey::Nodes + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser_extras.rb:16 + def initialize; end + + # reduce 0 omitted + # + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:137 + def _reduce_1(val, _values); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:165 + def _reduce_10(val, _values); end + + # reduce 14 omitted + # + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:177 + def _reduce_15(val, _values); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:181 + def _reduce_16(val, _values); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:185 + def _reduce_17(val, _values); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:189 + def _reduce_18(val, _values); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:141 + def _reduce_2(val, _values); end + + # reduce 6 omitted + # + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:153 + def _reduce_7(val, _values); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:157 + def _reduce_8(val, _values); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:161 + def _reduce_9(val, _values); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:193 + def _reduce_none(val, _values); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser_extras.rb:25 + def next_token; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/parser_extras.rb:20 + def parse(string); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/parser_extras.rb:12 + def parse(string); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:92 +ActionDispatch::Journey::Parser::Racc_arg = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:131 +ActionDispatch::Journey::Parser::Racc_debug_parser = T.let(T.unsafe(nil), FalseClass) + +# pkg:gem/actionpack#lib/action_dispatch/journey/parser.rb:108 +ActionDispatch::Journey::Parser::Racc_token_to_s_table = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:5 +module ActionDispatch::Journey::Path; end + +# pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:6 +class ActionDispatch::Journey::Path::Pattern + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:9 + def initialize(ast, requirements, separators, anchored); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:160 + def =~(other); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:7 + def anchored; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:7 + def ast; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:23 + def build_formatter; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:27 + def eager_load!; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:156 + def match(other); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:162 + def match?(other); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:7 + def names; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:59 + def optional_names; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:55 + def required_names; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:7 + def requirements; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:34 + def requirements_anchored?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:174 + def requirements_for_missing_keys_check; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:166 + def source; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:7 + def spec; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:170 + def to_regexp; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:185 + def offsets; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:181 + def regexp_visitor; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:65 +class ActionDispatch::Journey::Path::Pattern::AnchoredRegexp < ::ActionDispatch::Journey::Visitors::Visitor + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:66 + def initialize(separator, matchers); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:73 + def accept(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:77 + def visit_CAT(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:97 + def visit_DOT(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:90 + def visit_GROUP(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:94 + def visit_LITERAL(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:108 + def visit_OR(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:99 + def visit_SLASH(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:103 + def visit_STAR(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:81 + def visit_SYMBOL(node); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:121 +class ActionDispatch::Journey::Path::Pattern::MatchData + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:124 + def initialize(names, offsets, match); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:138 + def [](x); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:130 + def captures; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:143 + def length; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:134 + def named_captures; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:122 + def names; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:147 + def post_match; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:151 + def to_s; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:114 +class ActionDispatch::Journey::Path::Pattern::UnanchoredRegexp < ::ActionDispatch::Journey::Path::Pattern::AnchoredRegexp + # pkg:gem/actionpack#lib/action_dispatch/journey/path/pattern.rb:115 + def accept(node); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:6 +class ActionDispatch::Journey::Route + # +path+ is a path constraint. + # +constraints+ is a hash of constraints to be applied to this route. + # + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:56 + def initialize(name:, path:, app: T.unsafe(nil), constraints: T.unsafe(nil), required_defaults: T.unsafe(nil), defaults: T.unsafe(nil), request_method_match: T.unsafe(nil), precedence: T.unsafe(nil), scope_options: T.unsafe(nil), internal: T.unsafe(nil), source_location: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:7 + def app; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:7 + def ast; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:10 + def conditions; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:7 + def constraints; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:7 + def defaults; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:142 + def dispatcher?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:78 + def eager_load!; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:120 + def format(path_options); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:138 + def glob?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:7 + def internal; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:164 + def ip; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:146 + def matches?(request); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:7 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:115 + def parts; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:7 + def path; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:7 + def precedence; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:128 + def required_default?(key); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:132 + def required_defaults; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:103 + def required_keys; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:124 + 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]\d{5}/} + # as requirements. + # + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:93 + def requirements; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:168 + def requires_matching_verb?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:7 + def scope_options; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:107 + def score(supplied_keys); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:118 + def segment_keys; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:99 + def segments; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:7 + def source_location; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:172 + def verb; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:181 + def match_verb(request); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:177 + def verbs; end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:47 + def verb_matcher(verb); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:12 +module ActionDispatch::Journey::Route::VerbMatchers; end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:34 +class ActionDispatch::Journey::Route::VerbMatchers::All + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:35 + def call(_); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:36 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 +class ActionDispatch::Journey::Route::VerbMatchers::DELETE + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 +class ActionDispatch::Journey::Route::VerbMatchers::GET + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 +class ActionDispatch::Journey::Route::VerbMatchers::HEAD + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 +class ActionDispatch::Journey::Route::VerbMatchers::LINK + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 +class ActionDispatch::Journey::Route::VerbMatchers::OPTIONS + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 +class ActionDispatch::Journey::Route::VerbMatchers::PATCH + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 +class ActionDispatch::Journey::Route::VerbMatchers::POST + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 +class ActionDispatch::Journey::Route::VerbMatchers::PUT + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 +class ActionDispatch::Journey::Route::VerbMatchers::TRACE + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 +class ActionDispatch::Journey::Route::VerbMatchers::UNLINK + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def call(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:15 + def verb; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:24 +class ActionDispatch::Journey::Route::VerbMatchers::Unknown + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:27 + def initialize(verb); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:31 + def call(request); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:25 + def verb; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:13 +ActionDispatch::Journey::Route::VerbMatchers::VERBS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/journey/route.rb:39 +ActionDispatch::Journey::Route::VerbMatchers::VERB_TO_CLASS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:5 +class ActionDispatch::Journey::Router + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:20 + def initialize(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:24 + def eager_load!; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:66 + def recognize(rails_req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:18 + def routes; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:18 + def routes=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:31 + def serve(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:79 + def visualizer; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:93 + def ast; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:101 + def custom_routes; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:105 + def filter_routes(path); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:110 + def find_routes(req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:135 + def match_head_routes(routes, req); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:87 + def partitioned_routes; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router.rb:97 + def simulator; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:6 +class ActionDispatch::Journey::Router::Utils + class << self + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:90 + def escape_fragment(fragment); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:82 + def escape_path(path); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:86 + 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" + # + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:17 + def normalize_path(path); end + + # Replaces any escaped sequences with their unescaped representations. + # + # uri = "/topics?title=Ruby%20on%20Rails" + # unescape_uri(uri) #=> "/topics?title=Ruby on Rails" + # + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:98 + def unescape_uri(uri); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:80 +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 +# +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:33 +class ActionDispatch::Journey::Router::Utils::UriEncoder + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:51 + def escape_fragment(fragment); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:55 + def escape_path(path); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:59 + def escape_segment(segment); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:63 + def unescape_uri(uri); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:69 + def escape(component, pattern); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:73 + def percent_encode(unsafe); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:40 +ActionDispatch::Journey::Router::Utils::UriEncoder::ALPHA = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:38 +ActionDispatch::Journey::Router::Utils::UriEncoder::DEC2HEX = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:41 +ActionDispatch::Journey::Router::Utils::UriEncoder::DIGIT = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:37 +ActionDispatch::Journey::Router::Utils::UriEncoder::EMPTY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:34 +ActionDispatch::Journey::Router::Utils::UriEncoder::ENCODE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:45 +ActionDispatch::Journey::Router::Utils::UriEncoder::ESCAPED = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:47 +ActionDispatch::Journey::Router::Utils::UriEncoder::FRAGMENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:49 +ActionDispatch::Journey::Router::Utils::UriEncoder::PATH = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:48 +ActionDispatch::Journey::Router::Utils::UriEncoder::SEGMENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:43 +ActionDispatch::Journey::Router::Utils::UriEncoder::SUB_DELIMS = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:42 +ActionDispatch::Journey::Router::Utils::UriEncoder::UNRESERVED = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:35 +ActionDispatch::Journey::Router::Utils::UriEncoder::US_ASCII = T.let(T.unsafe(nil), Encoding) + +# pkg:gem/actionpack#lib/action_dispatch/journey/router/utils.rb:36 +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. +# +# pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:7 +class ActionDispatch::Journey::Routes + include ::Enumerable + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:12 + def initialize(routes = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:65 + def add_route(name, mapping); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:10 + def anchored_routes; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:51 + def ast; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:37 + def clear; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:10 + def custom_routes; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:33 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:20 + def empty?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:29 + def last; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:24 + def length; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:43 + def partition_route(route); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:10 + def routes; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:58 + def simulator; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:27 + def size; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/routes.rb:74 + def clear_cache!; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:7 +class ActionDispatch::Journey::Scanner + # pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:8 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:16 + def eos?; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:28 + def next_token; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:20 + def pos; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:24 + def pre_match; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:12 + def scan_setup(str); end + + private + + # takes advantage of String @- deduping capabilities in Ruby 2.5 upwards + # see: https://bugs.ruby-lang.org/issues/13077 + # + # pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:38 + def dedup_scan(regex); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/scanner.rb:43 + def scan; end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:53 +module ActionDispatch::Journey::Visitors; end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:194 +class ActionDispatch::Journey::Visitors::Dot < ::ActionDispatch::Journey::Visitors::FunctionalVisitor + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:195 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:200 + def accept(node, seed = T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:215 + def binary(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:222 + def nary(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:254 + def terminal(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:229 + def unary(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:239 + def visit_CAT(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:234 + def visit_GROUP(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:249 + def visit_OR(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:244 + def visit_STAR(node, seed); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:260 +ActionDispatch::Journey::Visitors::Dot::INSTANCE = T.let(T.unsafe(nil), ActionDispatch::Journey::Visitors::Dot) + +# Loop through the requirements AST. +# +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:159 +class ActionDispatch::Journey::Visitors::Each < ::ActionDispatch::Journey::Visitors::FunctionalVisitor + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:160 + def visit(node, block); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:165 +ActionDispatch::Journey::Visitors::Each::INSTANCE = T.let(T.unsafe(nil), ActionDispatch::Journey::Visitors::Each) + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:134 +class ActionDispatch::Journey::Visitors::FormatBuilder < ::ActionDispatch::Journey::Visitors::Visitor + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:135 + def accept(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:138 + def binary(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:136 + def terminal(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:142 + def visit_GROUP(n); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:144 + def visit_STAR(n); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:148 + def visit_SYMBOL(n); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:95 +class ActionDispatch::Journey::Visitors::FunctionalVisitor + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:98 + def accept(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:106 + def binary(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:111 + def nary(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:122 + def terminal(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:116 + def unary(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:102 + def visit(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:109 + def visit_CAT(n, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:126 + def visit_DOT(n, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:119 + def visit_GROUP(n, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:123 + def visit_LITERAL(n, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:114 + def visit_OR(n, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:125 + def visit_SLASH(n, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:120 + def visit_STAR(n, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:124 + def visit_SYMBOL(n, seed); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:96 +ActionDispatch::Journey::Visitors::FunctionalVisitor::DISPATCH_CACHE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:168 +class ActionDispatch::Journey::Visitors::String < ::ActionDispatch::Journey::Visitors::FunctionalVisitor + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:170 + def binary(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:174 + def nary(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:183 + def terminal(node, seed); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:187 + def visit_GROUP(node, seed); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:191 +ActionDispatch::Journey::Visitors::String::INSTANCE = T.let(T.unsafe(nil), ActionDispatch::Journey::Visitors::String) + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:54 +class ActionDispatch::Journey::Visitors::Visitor + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:57 + def accept(node); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:66 + def binary(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:72 + def nary(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:83 + def terminal(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:77 + def unary(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:62 + def visit(node); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:70 + def visit_CAT(n); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:87 + def visit_DOT(n); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:80 + def visit_GROUP(n); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:84 + def visit_LITERAL(n); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:75 + def visit_OR(n); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:86 + def visit_SLASH(n); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:81 + def visit_STAR(n); end + + # pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:85 + def visit_SYMBOL(n); end +end + +# pkg:gem/actionpack#lib/action_dispatch/journey/visitors.rb:55 +ActionDispatch::Journey::Visitors::Visitor::DISPATCH_CACHE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/log_subscriber.rb:4 +class ActionDispatch::LogSubscriber < ::ActiveSupport::LogSubscriber + # pkg:gem/actionpack#lib/action_dispatch/log_subscriber.rb:5 + def redirect(event); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/log_subscriber.rb:19 + def log_levels; 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. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:12 +class ActionDispatch::MiddlewareStack + include ::Enumerable + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:75 + def initialize(*args); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:92 + def [](i); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:165 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:130 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:138 + def delete!(target); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:80 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:105 + def insert(index, klass, *args, **, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:113 + def insert_after(index, *args, **, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:111 + def insert_before(index, klass, *args, **, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:88 + def last; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:73 + def middlewares; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:73 + def middlewares=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:142 + def move(target, source); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:152 + def move_after(target, source); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:150 + def move_before(target, source); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:84 + def size; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:119 + def swap(target, *args, **, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:96 + def unshift(klass, *args, **, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:160 + def use(klass, *args, **, &block); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:177 + def assert_index(index, where); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:183 + def build_middleware(klass, args, block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:187 + def index_of(klass); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:101 + 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. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:53 +class ActionDispatch::MiddlewareStack::InstrumentationProxy + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:56 + def initialize(middleware, class_name); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:64 + def call(env); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:54 +ActionDispatch::MiddlewareStack::InstrumentationProxy::EVENT_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:13 +class ActionDispatch::MiddlewareStack::Middleware + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:16 + def initialize(klass, args, block); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:24 + def ==(middleware); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:14 + def args; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:14 + def block; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:41 + def build(app); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:45 + def build_instrumented(app); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:33 + def inspect; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:14 + def klass; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/stack.rb:22 + def name; end +end + +# pkg:gem/actionpack#lib/action_dispatch.rb:56 +class ActionDispatch::MissingController < ::NameError; 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. +# +# pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:29 +class ActionDispatch::PermissionsPolicy + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:109 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def accelerometer(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def ambient_light_sensor(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def autoplay(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:147 + def build(context = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def camera(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:107 + def directives; end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def encrypted_media(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def fullscreen(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def geolocation(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def gyroscope(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def hid(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def idle_detection(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def magnetometer(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def microphone(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def midi(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def payment(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def picture_in_picture(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def screen_wake_lock(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def serial(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:129 + def speaker(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def sync_xhr(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def usb(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:129 + def vibrate(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:129 + def vr(*sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:119 + def web_share(*sources); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:165 + def apply_mapping(source); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:152 + def apply_mappings(sources); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:183 + def build_directive(sources, context); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:171 + def build_directives(context); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:114 + def initialize_copy(other); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:187 + 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 +# +# pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:82 +ActionDispatch::PermissionsPolicy::DIRECTIVES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:75 +ActionDispatch::PermissionsPolicy::MAPPINGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:30 +class ActionDispatch::PermissionsPolicy::Middleware + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:31 + def initialize(app); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:35 + def call(env); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:58 + def policy_empty?(policy); end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:54 + def policy_present?(headers); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:63 +module ActionDispatch::PermissionsPolicy::Request + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:66 + def permissions_policy; end + + # pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:70 + def permissions_policy=(policy); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/permissions_policy.rb:64 +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. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/public_exceptions.rb:16 +class ActionDispatch::PublicExceptions + # pkg:gem/actionpack#lib/action_dispatch/middleware/public_exceptions.rb:19 + def initialize(public_path); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/public_exceptions.rb:23 + def call(env); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/public_exceptions.rb:17 + def public_path; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/public_exceptions.rb:17 + def public_path=(_arg0); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/public_exceptions.rb:37 + def render(status, content_type, body); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/public_exceptions.rb:46 + def render_format(status, content_type, body); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/public_exceptions.rb:51 + def render_html(status); end +end + +# pkg:gem/actionpack#lib/action_dispatch/railtie.rb:8 +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. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/reloader.rb:12 +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. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:29 +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. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:61 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:89 + def call(env); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:45 + def check_ip; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:45 + 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. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:98 +class ActionDispatch::RemoteIp::GetIp + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:99 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:123 + def calculate_ip; end + + # Memoizes the value returned by #calculate_ip and returns it for + # ActionDispatch::Request to use. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:167 + def to_s; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:187 + def filter_proxies(ips); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:172 + def ips_from(header); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:30 +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. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/remote_ip.rb:36 +ActionDispatch::RemoteIp::TRUSTED_PROXIES = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:18 +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 ::ActionDispatch::PermissionsPolicy::Request + include ::Rack::Request::Env + include ::ActionDispatch::RequestCookieMethods + extend ::ActionDispatch::Http::Parameters::ClassMethods + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:60 + def initialize(env); end + + # Override Rack's GET method to support indifferent access. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:388 + def GET; end + + # Override Rack's POST method to support indifferent access. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:404 + def POST; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def accept; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def accept_charset; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def accept_encoding; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def accept_language; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def auth_type; end + + # Returns the authorization header regardless of whether it was specified directly or through one of the + # proxy alternatives. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:420 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:349 + def body; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:370 + def body_stream; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def cache_control; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def client_ip; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:70 + def commit_cookie_jar!; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:452 + def commit_csrf_token; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:441 + def commit_flash; end + + # Returns the content length of the request as an integer. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:285 + def content_length; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:79 + def controller_class; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:85 + def controller_class_for(name); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:182 + def controller_instance; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:186 + def controller_instance=(controller); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:168 + def engine_script_name(_routes); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:172 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:366 + def form_data?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + 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" + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:264 + def fullpath; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def gateway_interface; end + + # Provides access to the request's HTTP headers, for example: + # + # request.headers["Content-Type"] # => "text/plain" + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:225 + def headers; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:190 + def http_auth_salt; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:21 + def ignore_accept_header; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:21 + def ignore_accept_header=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:444 + def inspect; end + + # Returns the IP address of client as a +String+. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:299 + def ip; end + + # Returns true if the request has a header matching the given key parameter. + # + # request.key? :ip_spoofing_check # => true + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:106 + def key?(key); end + + # True if the request came from localhost, 127.0.0.1, or ::1. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:428 + def local?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:437 + def logger; end + + # The +String+ MIME type of the request. + # + # # get "/articles" + # request.media_type # => "application/x-www-form-urlencoded" + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:280 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:205 + def method(*args, **); end + + # Returns a symbol form of the #method. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:218 + def method_symbol; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def negotiate; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + 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' + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:253 + def original_fullpath; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + 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" + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:272 + def original_url; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def path_translated; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def pragma; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:401 + def query_parameters; end + + # Read the request \body. This is useful for web services that need to + # work with raw requests directly. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:339 + def raw_post; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:136 + def raw_request_method; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def remote_addr; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def remote_host; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def remote_ident; end + + # Returns the IP address of client as a +String+, + # usually set by the RemoteIp middleware. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:305 + def remote_ip; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:309 + def remote_ip=(remote_ip); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:322 + def request_id; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:326 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:144 + def request_method; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:176 + def request_method=(request_method); end + + # Returns a symbol form of the #request_method. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:195 + def request_method_symbol; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:416 + def request_parameters; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:432 + def request_parameters=(params); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:448 + def reset_csrf_token; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:374 + def reset_session; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:21 + def return_only_media_type_on_content_type; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:21 + def return_only_media_type_on_content_type=(value); 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)" + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:152 + def route_uri_pattern; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:156 + def route_uri_pattern=(pattern); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:160 + def routes; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:164 + 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\n; rel=preload") + # + # If you are using +javascript_include_tag+ or +stylesheet_link_tag+ the + # Early Hints headers are included by default if supported. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:240 + def send_early_hints(links); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def server_name; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def server_protocol; end + + # Returns the lowercase name of the HTTP server software. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:333 + def server_software; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:379 + def session=(session); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:383 + def session_options=(options); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:330 + def uuid; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def version; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def x_csrf_token; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def x_forwarded_for; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def x_forwarded_host; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:48 + def x_request_id; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:296 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:293 + def xml_http_request?; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:457 + def check_method(name); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:465 + def default_session; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:469 + def read_body_stream; end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:56 + def empty; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:21 + def ignore_accept_header; end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:21 + def ignore_accept_header=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:22 + def parameter_parsers; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:314 +ActionDispatch::Request::ACTION_DISPATCH_REQUEST_ID = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:34 +ActionDispatch::Request::ENV_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:127 +ActionDispatch::Request::HTTP_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:129 +ActionDispatch::Request::HTTP_METHOD_LOOKUP = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:32 +ActionDispatch::Request::LOCALHOST = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:73 +class ActionDispatch::Request::PASS_NOT_FOUND + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:74 + def action(_); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:76 + def action_encoding_template(action); end + + # pkg:gem/actionpack#lib/action_dispatch/http/request.rb:75 + def call(_); end + end +end + +# HTTP methods from {RFC 2518: HTTP Extensions for Distributed Authoring -- WEBDAV}[https://www.ietf.org/rfc/rfc2518.txt] +# +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:113 +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] +# +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:111 +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] +# +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:115 +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] +# +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:117 +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] +# +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:119 +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] +# +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:123 +ActionDispatch::Request::RFC4791 = T.let(T.unsafe(nil), Array) + +# HTTP methods from {RFC 5323: WebDAV SEARCH}[https://www.ietf.org/rfc/rfc5323.txt] +# +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:121 +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] +# +# pkg:gem/actionpack#lib/action_dispatch/http/request.rb:125 +ActionDispatch::Request::RFC5789 = T.let(T.unsafe(nil), Array) + +# Session is responsible for lazily loading the session from store. +# +# pkg:gem/actionpack#lib/action_dispatch/request/session.rb:8 +class ActionDispatch::Request::Session + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:74 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:112 + def [](key); end + + # Writes given value to given key of the session. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:152 + def []=(key, value); end + + # Clears the session. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:158 + def clear; end + + # Deletes given key from the session. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:191 + def delete(key); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:97 + def destroy; end + + # Returns the nested value specified by the sequence of keys, returning + # +nil+ if any intermediate step is +nil+. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:125 + def dig(*keys); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:242 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:237 + def empty?; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:89 + def enabled?; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:227 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:210 + def fetch(key, default = T.unsafe(nil), &block); end + + # Returns true if the session has the given key or false. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:132 + def has_key?(key); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:85 + def id; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:246 + def id_was; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:137 + def include?(key); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:219 + def inspect; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:136 + def key?(key); end + + # Returns keys of the session as Array. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:140 + def keys; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:233 + def loaded?; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:188 + def merge!(hash); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:93 + def options; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:168 + def to_h; end + + # Returns the session as Hash. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:164 + 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"} + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:180 + def update(hash); end + + # Returns values of the session as Array. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:146 + def values; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:268 + def load!; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:264 + def load_for_delete!; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:252 + def load_for_read!; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:256 + def load_for_write!; end + + class << self + # Creates a session hash, merging the properties of the previous session if any. + # + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:17 + def create(store, req, default_options); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:41 + def delete(req); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:27 + def disabled(req); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:33 + def find(req); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:37 + def set(req, session); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/request/session.rb:9 +class ActionDispatch::Request::Session::DisabledSessionError < ::StandardError; end + +# pkg:gem/actionpack#lib/action_dispatch/request/session.rb:10 +ActionDispatch::Request::Session::ENV_SESSION_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/request/session.rb:11 +ActionDispatch::Request::Session::ENV_SESSION_OPTIONS_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/request/session.rb:45 +class ActionDispatch::Request::Session::Options + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:54 + def initialize(by, default_options); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:59 + def [](key); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:69 + def []=(k, v); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:63 + def id(req); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:70 + def to_hash; end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:71 + def values_at(*args); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:50 + def find(req); end + + # pkg:gem/actionpack#lib/action_dispatch/request/session.rb:46 + def set(req, options); end + end +end + +# Singleton object used to determine if an optional param wasn't specified. +# +# pkg:gem/actionpack#lib/action_dispatch/request/session.rb:14 +ActionDispatch::Request::Session::Unspecified = T.let(T.unsafe(nil), Object) + +# pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:7 +class ActionDispatch::Request::Utils + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:8 + def perform_deep_munge; end + + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:8 + def perform_deep_munge=(val); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:29 + def check_param_encoding(params); end + + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:10 + def each_param_value(params, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:21 + def normalize_encode_params(params); end + + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:8 + def perform_deep_munge; end + + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:8 + def perform_deep_munge=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:44 + def set_binary_encoding(request, params, controller, action); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:83 +class ActionDispatch::Request::Utils::CustomParamEncoder + class << self + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:99 + def action_encoding_template(request, controller, action); end + + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:84 + def encode(request, params, controller, action); end + end +end + +# Remove nils from the params hash. +# +# pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:75 +class ActionDispatch::Request::Utils::NoNilParamEncoder < ::ActionDispatch::Request::Utils::ParamEncoder + class << self + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:76 + def handle_array(params); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:48 +class ActionDispatch::Request::Utils::ParamEncoder + class << self + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:69 + def handle_array(params); end + + # Convert nested Hash to HashWithIndifferentAccess. + # + # pkg:gem/actionpack#lib/action_dispatch/request/utils.rb:50 + def normalize_encode_params(params); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:10 +module ActionDispatch::RequestCookieMethods + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:48 + def authenticated_encrypted_cookie_salt; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:11 + def cookie_jar; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:28 + def cookie_jar=(jar); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:76 + def cookies_digest; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:80 + def cookies_rotations; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:72 + def cookies_same_site_protection; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:68 + def cookies_serializer; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:56 + def encrypted_cookie_cipher; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:40 + def encrypted_cookie_salt; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:44 + def encrypted_signed_cookie_salt; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:24 + def have_cookie_jar?; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:32 + def key_generator; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:64 + def secret_key_base; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:60 + def signed_cookie_digest; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:36 + def signed_cookie_salt; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:52 + def use_authenticated_cookie_encryption; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/cookies.rb:84 + def use_cookies_with_metadata; end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:6 +class ActionDispatch::RequestEncoder + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:18 + def initialize(mime_name, param_encoder, response_parser); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:34 + def accept_header; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:30 + def content_type; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:38 + def encode_params(params); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:16 + def response_parser; end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:47 + def encoder(name); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:42 + def parser(content_type); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:51 + def register_encoder(mime_name, param_encoder: T.unsafe(nil), response_parser: T.unsafe(nil)); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:7 +class ActionDispatch::RequestEncoder::IdentityEncoder + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:9 + def accept_header; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:8 + def content_type; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:10 + def encode_params(params); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/request_encoder.rb:11 + def response_parser; 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. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/request_id.rb:19 +class ActionDispatch::RequestId + # pkg:gem/actionpack#lib/action_dispatch/middleware/request_id.rb:20 + def initialize(app, header:); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/request_id.rb:25 + def call(env); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/request_id.rb:40 + def internal_request_id; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/request_id.rb:32 + 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 +# +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:36 +class ActionDispatch::Response + include ::Rack::Response::Helpers + include ::ActionDispatch::Http::FilterRedirect + include ::ActionDispatch::Http::Cache::Response + include ::MonitorMixin + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:169 + def initialize(status = T.unsafe(nil), headers = T.unsafe(nil), body = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:73 + def [](*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:73 + def []=(*, **, &); end + + # Aliasing these off because AD::Http::Cache::Response defines them. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:91 + def _cache_control; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:92 + def _cache_control=(v); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:382 + def abort; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:195 + def await_commit; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:201 + def await_sent; end + + # Returns the content of the response as a string. This contains the contents + # of any calls to render. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:316 + def body; end + + # Allows you to manually set or override the response body. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:325 + def body=(body); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:369 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:286 + 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' + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:275 + def charset=(charset); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:378 + def close; end + + # Returns a string to ensure compatibility with +Net::HTTPResponse+. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:297 + def code; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:205 + def commit!; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:229 + def committed?; end + + # Content type of response. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:255 + 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/plain" + # + # 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. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:245 + def content_type=(content_type); end + + # Returns the response cookies, converted to a Hash of (name => value) pairs + # + # assert_equal 'AuthorOfNewPage', r.cookies['author'] + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:406 + def cookies; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:86 + def default_charset; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:86 + def default_charset=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:87 + def default_headers; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:87 + def default_headers=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:193 + def delete_header(key); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:75 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:191 + def get_header(key); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:190 + def has_header?(key); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:71 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:69 + def headers; end + + # Media type of response. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:260 + 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" + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:309 + def message; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:401 + def prepare!; end + + # The location header we'll be responding with. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:376 + def redirect_url; end + + # The request that the response is responding to. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:51 + def request; end + + # The request that the response is responding to. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:51 + def request=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:365 + def reset_body!; end + + # The response code of the request. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:292 + def response_code; end + + # Send the file stored at +path+ as the response body. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:360 + def send_file(path); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:213 + def sending!; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:228 + def sending?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:264 + def sending_file=(v); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:221 + def sent!; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:230 + def sent?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:192 + def set_header(key, v); end + + # The HTTP status code. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:54 + def status; end + + # Sets the HTTP status code. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:233 + def status=(status); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:312 + def status_message; end + + # The underlying body, as a streamable object. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:167 + def stream; end + + # Turns the Response into a Rack-compatible array of the status, headers, + # and body. Allows explicit splatting: + # + # status, headers, body = *response + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:397 + def to_a; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:320 + def write(string); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:477 + def assign_default_content_type_and_charset!; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:450 + def before_committed; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:458 + def before_sending; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:469 + def build_buffer(response, body); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:527 + def handle_no_content!; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:473 + def munge_body_object(body); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:430 + def parse_content_type(content_type); end + + # Small internal convenience method to get the parsed version of the current + # content type header. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:440 + def parsed_content_type_header; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:534 + def rack_response(status, headers); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:444 + def set_content_type(content_type, charset); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:157 + def create(status = T.unsafe(nil), headers = T.unsafe(nil), body = T.unsafe(nil), default_headers: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:86 + def default_charset; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:86 + def default_charset=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:87 + def default_headers; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:87 + def default_headers=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:162 + def merge_default_headers(original, default); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:98 +class ActionDispatch::Response::Buffer + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:99 + def initialize(response, buf); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:127 + def <<(string); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:139 + def abort; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:112 + def body; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:142 + def close; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:147 + def closed?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:129 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:106 + def to_ary; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:120 + def write(string); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:152 + def each_chunk(&block); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:82 +ActionDispatch::Response::CONTENT_TYPE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:424 +ActionDispatch::Response::CONTENT_TYPE_PARSER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:421 +class ActionDispatch::Response::ContentTypeHeader < ::Struct + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:421 + def charset; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:421 + def charset=(_); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:421 + def mime_type; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:421 + def mime_type=(_); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:421 + def [](*_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:421 + def inspect; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:421 + def keyword_init?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:421 + def members; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:421 + 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. +# +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:338 +class ActionDispatch::Response::FileBody + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:341 + def initialize(path); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:345 + def body; end + + # Stream the file's contents if Rack::Sendfile isn't present. + # + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:350 + def each; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:339 + def to_path; end +end + +# To be deprecated: +# +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:48 +ActionDispatch::Response::Header = Rack::Utils::HeaderHash + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:44 +ActionDispatch::Response::Headers = Rack::Utils::HeaderHash + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:84 +ActionDispatch::Response::NO_CONTENT_CODES = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:422 +ActionDispatch::Response::NullContentTypeHeader = T.let(T.unsafe(nil), ActionDispatch::Response::ContentTypeHeader) + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:485 +class ActionDispatch::Response::RackBody + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:486 + def initialize(response); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:496 + def body; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:518 + def call(*arguments, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:490 + def close; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:514 + def each(*args, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:502 + def respond_to?(method, include_private = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:510 + def to_ary; end + + # pkg:gem/actionpack#lib/action_dispatch/http/response.rb:522 + def to_path; end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:500 +ActionDispatch::Response::RackBody::BODY_METHODS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/response.rb:83 +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. +# +# pkg:gem/actionpack#lib/action_dispatch/routing.rb:246 +module ActionDispatch::Routing + extend ::ActiveSupport::Autoload +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:153 +module ActionDispatch::Routing::ConsoleFormatter; end + +# pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:154 +class ActionDispatch::Routing::ConsoleFormatter::Base + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:155 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:169 + def header(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:172 + def no_routes(routes, filter); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:159 + def result; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:166 + def section(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:163 + def section_title(title); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:226 +class ActionDispatch::Routing::ConsoleFormatter::Expanded < ::ActionDispatch::Routing::ConsoleFormatter::Base + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:227 + def initialize(width: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:236 + def section(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:232 + def section_title(title); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:241 + def draw_expanded_section(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:256 + def route_header(index:); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:190 +class ActionDispatch::Routing::ConsoleFormatter::Sheet < ::ActionDispatch::Routing::ConsoleFormatter::Base + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:199 + def header(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:195 + def section(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:191 + def section_title(title); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:213 + def draw_header(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:204 + def draw_section(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:219 + def widths(routes); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:261 +class ActionDispatch::Routing::ConsoleFormatter::Unused < ::ActionDispatch::Routing::ConsoleFormatter::Sheet + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:262 + def header(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:270 + def no_routes(routes, filter); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/endpoint.rb:5 +class ActionDispatch::Routing::Endpoint + # pkg:gem/actionpack#lib/action_dispatch/routing/endpoint.rb:9 + def app; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/endpoint.rb:6 + def dispatcher?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/endpoint.rb:12 + def engine?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/endpoint.rb:8 + def matches?(req); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/endpoint.rb:10 + def rack_app; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/endpoint.rb:7 + def redirect?; end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing.rb:258 +ActionDispatch::Routing::HTTP_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:283 +class ActionDispatch::Routing::HtmlTableFormatter + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:284 + def initialize(view); end + + # The header is part of the HTML page, so we don't construct it here. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:298 + def header(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:301 + def no_routes(*); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:314 + def result; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:293 + def section(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:289 + def section_title(title); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:12 +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 + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2313 + def initialize(set); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:16 + def backtrace_cleaner; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:16 + def backtrace_cleaner=(val); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:392 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:375 + def normalize_path(path); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:15 + def route_source_locations; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:15 + def route_source_locations=(val); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:396 +module ActionDispatch::Routing::Mapper::Base + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:632 + def default_url_options(options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:629 + def default_url_options=(options); end + + # Query if the following named route was already defined. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:641 + 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' => 'photos#show', via: :get + # 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] + # The route's controller. + # + # [:action] + # The route's action. + # + # [:param] + # Overrides the default resource identifier +:id+ (name of the + # dynamic 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] + # The path prefix for the routes. + # + # [:module] + # The namespace for :controller. + # + # match 'path', to: 'c#a', module: 'sekret', controller: 'posts', via: :get + # # => Sekret::PostsController + # + # See Scoping#namespace for its scope equivalent. + # + # [:as] + # The name used to generate routing helpers. + # + # [:via] + # Allowed HTTP verb(s) for route. + # + # match 'path', to: 'c#a', via: :get + # match 'path', to: 'c#a', via: [:get, :post] + # match 'path', to: 'c#a', via: :all + # + # [:to] + # Points to a +Rack+ endpoint. Can be an object that responds to + # +call+ or a 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] + # Shorthand for wrapping routes in a specific RESTful context. Valid + # values 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] + # Constrains parameters with a hash of regular expressions + # or an object that 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 defaults for parameters + # + # # 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] + # Boolean to anchor a match pattern. Default is true. When set to + # false, 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] + # Allows you to specify the default value for optional +format+ + # segment or disable it by supplying +false+. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:577 + def match(path, options = T.unsafe(nil)); end + + # Mount a Rack-based application to be used within the application. + # + # mount SomeRackApp, at: "some_route" + # + # Alternatively: + # + # mount(SomeRackApp => "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 => "some_route", as: "exciting") + # + # This will generate the +exciting_path+ and +exciting_url+ helpers + # which can be used to navigate to this mounted app. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:599 + def mount(app, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:634 + def with_default_scope(scope, &block); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:650 + def app_name(app, rails_app); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:659 + def define_generate_prefix(app, name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:646 + 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 +# +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2025 +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. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2082 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2098 + def concerns(*args); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:18 +class ActionDispatch::Routing::Mapper::Constraints < ::ActionDispatch::Routing::Endpoint + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:24 + def initialize(app, constraints, strategy); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:19 + def app; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:19 + def constraints; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:39 + def dispatcher?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:41 + def matches?(req); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:48 + def serve(req); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:55 + def constraint_args(constraint, request); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:22 +ActionDispatch::Routing::Mapper::Constraints::CALL = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:21 +ActionDispatch::Routing::Mapper::Constraints::SERVE = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2110 +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. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2158 + 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+ 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+ 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. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2210 + def resolve(*args, &block); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:693 +module ActionDispatch::Routing::Mapper::HttpHelpers + # Define a route that only recognizes HTTP DELETE. + # For supported arguments, see match[rdoc-ref:Base#match] + # + # delete 'broccoli', to: 'food#broccoli' + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:730 + def delete(*args, &block); end + + # Define a route that only recognizes HTTP GET. + # For supported arguments, see match[rdoc-ref:Base#match] + # + # get 'bacon', to: 'food#bacon' + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:698 + def get(*args, &block); end + + # Define a route that only recognizes HTTP OPTIONS. + # For supported arguments, see match[rdoc-ref:Base#match] + # + # options 'carrots', to: 'food#carrots' + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:738 + def options(*args, &block); end + + # Define a route that only recognizes HTTP PATCH. + # For supported arguments, see match[rdoc-ref:Base#match] + # + # patch 'bacon', to: 'food#bacon' + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:714 + def patch(*args, &block); end + + # Define a route that only recognizes HTTP POST. + # For supported arguments, see match[rdoc-ref:Base#match] + # + # post 'bacon', to: 'food#bacon' + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:706 + def post(*args, &block); end + + # Define a route that only recognizes HTTP PUT. + # For supported arguments, see match[rdoc-ref:Base#match] + # + # put 'bacon', to: 'food#bacon' + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:722 + def put(*args, &block); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:743 + def map_method(method, args, &block); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:72 +class ActionDispatch::Routing::Mapper::Mapping + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:121 + def initialize(set:, ast:, controller:, default_action:, to:, formatted:, via:, options_constraints:, anchor:, scope_params:, options:); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:179 + def application; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:76 + def ast; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:183 + def conditions; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:76 + def default_action; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:76 + def default_controller; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:76 + def defaults; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:172 + def make_route(name, precedence); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:76 + def path; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:76 + def required_defaults; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:76 + def requirements; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:76 + def scope_options; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:76 + def to; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:318 + def add_controller_module(controller, modyoule); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:279 + def app(blocks); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:337 + def blocks(callable_constraint); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:187 + def build_conditions(current_conditions, request_class); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:291 + def check_controller_and_action(path_params, controller, action); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:306 + def check_part(name, part, path_params, hash); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:344 + def constraints(options, path_params); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:358 + def dispatcher(raise_on_name_error); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:202 + def intern(object); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:275 + def normalize_defaults(options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:243 + def normalize_format(formatted); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:206 + def normalize_options!(options, path_params, modyoule); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:196 + def request_method; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:362 + def route_source_location; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:237 + def split_constraints(path_params, constraints); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:330 + def translate_controller(controller); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:259 + def verify_regexp_requirements(requirements, wildcard_options); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:79 + def build(scope, set, ast, controller, default_action, to, via, formatted, options_constraints, anchor, options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:93 + def check_via(via); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:105 + def normalize_path(path, format); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:117 + def optional_format?(path, format); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:73 +ActionDispatch::Routing::Mapper::Mapping::ANCHOR_CHARACTERS_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:170 +ActionDispatch::Routing::Mapper::Mapping::JOINED_SEPARATORS = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:74 +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+. +# +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1133 +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. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1511 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1621 + def draw(name); end + + # Matches a URL pattern to one or more routes. + # For more information, see match[rdoc-ref:Base#match]. + # + # match 'path' => 'controller#action', via: :patch + # match 'path', to: 'controller#action', via: :post + # match 'path', 'otherpath', on: :member, via: :get + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1643 + def match(path, *rest, &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. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1532 + def member(&block); end + + # See ActionDispatch::Routing::Mapper::Scoping#namespace. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1579 + def namespace(path, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1558 + def nested(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1548 + 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] + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1303 + def resource(*resources, &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] + # Allows you to change the segment component of the +edit+ and +new+ 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] + # Allows you to change the path prefix for the resource. + # + # resources :posts, path: 'postings' + # + # The resource and all segments will now route to /postings instead of /posts. + # + # [:only] + # Only generate routes for the given actions. + # + # resources :cows, only: :show + # resources :cows, only: [:show, :index] + # + # [:except] + # Generate all routes except for the given actions. + # + # resources :cows, except: :show + # resources :cows, except: [:show, :index] + # + # [:shallow] + # Generates shallow routes for nested resource(s). When placed on a parent 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] + # Prefixes nested shallow routes with the specified 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] + # Prefixes nested shallow route names with specified 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] + # Allows you to specify the default value for optional +format+ + # segment or disable it by supplying +false+. + # + # [:param] + # Allows you to override the default param name of +:id+ in the URL. + # + # === Examples + # + # # routes call +Admin::PostsController+ + # resources :posts, module: "admin" + # + # # resource actions are at /admin/posts. + # resources :posts, path: "admin/posts" + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1469 + def resources(*resources, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1268 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1690 + def root(path, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1587 + def shallow; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1594 + def shallow?; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1754 + def action_options?(options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1836 + def action_path(name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1972 + def add_route(action, controller, options, _path, to, via, formatted, anchor, options_constraints); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1890 + def api_only?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1749 + def apply_action_options(options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1715 + def apply_common_behavior_for(method, resources, options, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1812 + def canonical_action?(action); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1957 + def decomposed_match(path, controller, options, _path, to, via, formatted, anchor, options_constraints); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1942 + def get_to_from_path(path, to, action); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1901 + def map_match(paths, options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1999 + def match_root_route(options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1852 + def name_for_action(as, action); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1789 + def nested_options; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1770 + def nested_scope?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1808 + def param_constraint; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1804 + def param_constraint?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1711 + def parent_resource; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1826 + def path_for_action(action, path); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1894 + def path_scope(path); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1840 + def prefix_name_for_action(as, action); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1766 + def resource_method_scope?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1781 + def resource_scope(resource, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1762 + def resource_scope?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1758 + def scope_action_options; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1878 + def set_member_mappings_for_resource; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1798 + def shallow_nesting_depth; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1816 + def shallow_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1953 + def using_match_shorthand?(path); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1774 + def with_scope_level(kind); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1138 +ActionDispatch::Routing::Mapper::Resources::CANONICAL_ACTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1137 +ActionDispatch::Routing::Mapper::Resources::RESOURCE_OPTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1140 +class ActionDispatch::Routing::Mapper::Resources::Resource + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1143 + def initialize(entities, api_only, shallow, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1168 + def actions; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1176 + def available_actions; end + + # Checks for uncountable plurals, and appends "_index" if the plural + # and singular form are the same. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1200 + def collection_name; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1208 + def collection_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1141 + def controller; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1160 + def default_actions; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1196 + def member_name; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1210 + def member_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1184 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1220 + def nested_param; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1224 + def nested_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1216 + def new_scope(new_path); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1141 + def param; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1141 + def path; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1188 + def plural; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1204 + def resource_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1228 + def shallow?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1214 + def shallow_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1232 + def singleton?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1192 + def singular; end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1235 +class ActionDispatch::Routing::Mapper::Resources::SingletonResource < ::ActionDispatch::Routing::Mapper::Resources::Resource + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1236 + def initialize(entities, api_only, shallow, options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1260 + def collection_name; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1243 + def default_actions; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1259 + def member_name; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1262 + def member_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1263 + def nested_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1251 + def plural; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1265 + def singleton?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1255 + def singular; 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. +# +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1136 +ActionDispatch::Routing::Mapper::Resources::VALID_ON_OPTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2224 +class ActionDispatch::Routing::Mapper::Scope + include ::Enumerable + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2234 + def initialize(hash, parent = T.unsafe(nil), scope_level = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2293 + def [](key); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2260 + def action_name(name_prefix, prefix, collection_name, member_name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2300 + def each; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2308 + def frame; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2240 + def nested?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2285 + def new(hash); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2289 + def new_level(level); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2244 + def null?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2281 + def options; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2232 + def parent; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2256 + def resource_method_scope?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2277 + def resource_scope?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2252 + def resources?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2248 + def root?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2232 + def scope_level; end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2310 +ActionDispatch::Routing::Mapper::Scope::NULL = T.let(T.unsafe(nil), ActionDispatch::Routing::Mapper::Scope) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2225 +ActionDispatch::Routing::Mapper::Scope::OPTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2230 +ActionDispatch::Routing::Mapper::Scope::RESOURCE_METHOD_SCOPES = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:2229 +ActionDispatch::Routing::Mapper::Scope::RESOURCE_SCOPES = T.let(T.unsafe(nil), Array) + +# 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 +# +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:805 +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 + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1010 + def constraints(constraints = T.unsafe(nil), &block); end + + # Scopes routes to a specific controller + # + # controller "food" do + # match "bacon", action: :bacon, via: :get + # end + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:895 + 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'. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1019 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:940 + def namespace(path, options = T.unsafe(nil), &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 + # + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:836 + def scope(*args); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1051 + def merge_action_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1035 + def merge_as_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1075 + def merge_blocks_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1067 + def merge_constraints_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1047 + def merge_controller_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1071 + def merge_defaults_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1059 + def merge_format_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1043 + def merge_module_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1081 + def merge_options_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1063 + def merge_path_names_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1027 + def merge_path_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1031 + def merge_shallow_path_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1039 + def merge_shallow_prefix_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1085 + def merge_shallow_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1089 + def merge_to_scope(parent, child); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:1055 + def merge_via_scope(parent, child); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:888 +ActionDispatch::Routing::Mapper::Scoping::POISON = T.let(T.unsafe(nil), Object) + +# pkg:gem/actionpack#lib/action_dispatch/routing/mapper.rb:13 +ActionDispatch::Routing::Mapper::URL_OPTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:112 +class ActionDispatch::Routing::OptionRedirect < ::ActionDispatch::Routing::Redirect + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:141 + def inspect; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:113 + def options; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:115 + def path(params, request); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:87 +class ActionDispatch::Routing::PathRedirect < ::ActionDispatch::Routing::Redirect + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:102 + def inspect; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:90 + def path(params, request); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:107 + def interpolation_required?(string, params); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:88 +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_for(@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_for([blog, @post]) # => "/blog/posts/1" +# +# pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:59 +module ActionDispatch::Routing::PolymorphicRoutes + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:149 + def edit_polymorphic_path(record_or_hash, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:149 + def edit_polymorphic_url(record_or_hash, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:149 + def new_polymorphic_path(record_or_hash, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:149 + def new_polymorphic_url(record_or_hash, options = T.unsafe(nil)); end + + # Returns the path component of a URL for the given record. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:126 + 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() + # + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:103 + def polymorphic_url(record_or_hash_or_array, options = T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:170 + def polymorphic_mapping(record); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:166 + def polymorphic_path_for_action(action, record_or_hash, options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:162 + def polymorphic_url_for_action(action, record_or_hash, options); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:178 +class ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:241 + def initialize(key_strategy, prefix, suffix); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:255 + def handle_class(klass); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:259 + def handle_class_call(target, klass); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:286 + def handle_list(list); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:263 + def handle_model(record); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:277 + def handle_model_call(target, record); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:247 + def handle_string(record); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:251 + def handle_string_call(target, str); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:239 + def prefix; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:239 + def suffix; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:340 + def get_method_for_class(klass); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:345 + def get_method_for_string(str); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:332 + def polymorphic_mapping(target, record); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:189 + def build(action, type); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:181 + def get(action, type); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:187 + def path; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:203 + def plural(prefix, suffix); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:207 + def polymorphic_method(recipient, record_or_hash_or_array, action, type, options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:199 + def singular(prefix, suffix); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:186 + def url; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/polymorphic_routes.rb:179 +ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder::CACHE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:10 +class ActionDispatch::Routing::Redirect < ::ActionDispatch::Routing::Endpoint + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:13 + def initialize(status, block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:11 + def block; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:33 + def build_response(req); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:20 + def call(env); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:65 + def inspect; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:61 + def path(params, request); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:18 + def redirect?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:11 + def status; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:74 + def escape(params); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:78 + def escape_fragment(params); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:82 + def escape_path(params); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:70 + def relative_path?(path); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:146 +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')) + # + # pkg:gem/actionpack#lib/action_dispatch/routing/redirection.rb:199 + def redirect(*args, &block); end +end + +# :stopdoc: +# +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:14 +class ActionDispatch::Routing::RouteSet + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:366 + def initialize(config = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:649 + def add_polymorphic_mapping(klass, options, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:618 + def add_route(mapping, name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:653 + def add_url_helper(name, options, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:396 + def api_only?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:435 + def append(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:879 + def call(env); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:459 + def clear!; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:409 + def default_env; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:336 + def default_scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:336 + def default_scope=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:338 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:338 + def default_url_options=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:481 + def define_mounted_helper(name, script_namer = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:337 + def disable_clear_and_finalize; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:337 + def disable_clear_and_finalize=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:428 + def draw(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:338 + def draw_paths; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:338 + def draw_paths=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:386 + def eager_load!; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:614 + def empty?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:339 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:794 + def extra_keys(options, recall = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:453 + def finalize!; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:822 + def find_script_name(options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:336 + def formatter; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:336 + def formatter=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:798 + def generate_extras(options, recall = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:508 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:19 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:477 + def mounted_helpers; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:336 + def named_routes; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:336 + def named_routes=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:818 + def optimize_routes_generation?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:826 + def path_for(options, route_name = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:339 + def polymorphic_mappings; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:439 + def prepend(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:885 + def recognize_path(path, environment = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:900 + def recognize_path_with_request(req, path, extras, raise_on_missing: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:392 + def relative_url_root; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:400 + def request_class; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:337 + def resources_path_names; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:337 + def resources_path_names=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:336 + def router; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:336 + def router=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:341 + def routes; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:336 + def set; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:336 + def set=(_arg0); end + + # The +options+ argument must be a hash whose keys are *symbols*. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:831 + def url_for(options, route_name = T.unsafe(nil), url_strategy = T.unsafe(nil), method_name = T.unsafe(nil), reserved = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:500 + def url_helpers(supports_path = T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:443 + def eval_block(block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:809 + def generate(route_name, options, recall = T.unsafe(nil), method_name = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:404 + def make_request(env); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:343 + def default_resources_path_names; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:347 + def new_with_config(config); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:362 +class ActionDispatch::Routing::RouteSet::Config < ::Struct + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:362 + def api_only; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:362 + def api_only=(_); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:362 + def relative_url_root; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:362 + def relative_url_root=(_); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:362 + def [](*_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:362 + def inspect; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:362 + def keyword_init?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:362 + def members; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:362 + def new(*_arg0); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:657 +class ActionDispatch::Routing::RouteSet::CustomUrlHelper + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:660 + def initialize(name, defaults, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:658 + def block; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:666 + def call(t, args, only_path = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:658 + def defaults; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:658 + def name; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:678 + def eval_block(t, args, options); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:682 + def merge_defaults(options); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:364 +ActionDispatch::Routing::RouteSet::DEFAULT_CONFIG = T.let(T.unsafe(nil), ActionDispatch::Routing::RouteSet::Config) + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:21 +class ActionDispatch::Routing::RouteSet::Dispatcher < ::ActionDispatch::Routing::Endpoint + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:22 + def initialize(raise_on_name_error); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:26 + def dispatcher?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:28 + def serve(req); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:42 + def controller(req); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:48 + def dispatch(controller, action, req, res); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:687 +class ActionDispatch::Routing::RouteSet::Generator + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:690 + def initialize(named_route, options, recall, set); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:702 + def controller; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:706 + def current_controller; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:777 + def different_controller?; end + + # Generates a path from routes, returns a RouteWithParams or MissingRoute. + # MissingRoute will raise ActionController::UrlGenerationError. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:773 + def generate; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:688 + def named_route; end + + # Remove leading slashes from controllers + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:761 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:743 + def normalize_controller_action_id!; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:718 + def normalize_options!; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:688 + def options; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:688 + def recall; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:688 + def set; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:710 + 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" + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:751 + def use_relative_controller!; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:783 + def named_route_exists?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:787 + def segment_keys; end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:468 +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. +# +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:66 +class ActionDispatch::Routing::RouteSet::NamedRouteCollection + include ::Enumerable + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:71 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:131 + def [](name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:130 + def []=(name, route); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:102 + def add(name, route); end + + # Given a +name+, defines name_path and name_url helpers. + # Used by 'direct', 'resolve', and 'polymorphic' route helpers. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:149 + def add_url_helper(name, defaults, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:132 + def clear; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:88 + def clear!; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:134 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:121 + def get(name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:84 + def helper_names; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:125 + def key?(name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:143 + def length; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:139 + def names; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:68 + def path_helpers_module; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:79 + def route_defined?(name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:68 + 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') + # + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:317 + def define_url_helper(mod, name, helper, url_strategy); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:68 + def routes; end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:172 +class ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:255 + def initialize(route, options, route_name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:262 + def call(t, method_name, args, inner_options, url_strategy); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:274 + def handle_positional_args(controller_options, inner_options, args, result, path_params); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:185 + def route_name; end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:173 + def create(route, options, route_name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:181 + def optimize_helper?(route); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:187 +class ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper::OptimizedUrlHelper < ::ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:190 + def initialize(route, options, route_name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:188 + def arg_size; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:196 + def call(t, method_name, args, inner_options, url_strategy); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:227 + def optimize_routes_generation?(t); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:219 + def optimized_helper(args); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:231 + def parameterize_args(args); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:242 + def raise_generation_error(args); end +end + +# strategy for building URLs to send to the client +# +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:333 +ActionDispatch::Routing::RouteSet::PATH = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:814 +ActionDispatch::Routing::RouteSet::RESERVED_OPTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:53 +class ActionDispatch::Routing::RouteSet::StaticDispatcher < ::ActionDispatch::Routing::RouteSet::Dispatcher + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:54 + def initialize(controller_class); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:60 + def controller(_); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/route_set.rb:334 +ActionDispatch::Routing::RouteSet::UNKNOWN = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:8 +class ActionDispatch::Routing::RouteWrapper < ::SimpleDelegator + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:54 + def action; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:26 + def constraints; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:50 + def controller; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:15 + def endpoint; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:62 + def engine?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:58 + def internal?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:9 + def matches_filter?(filter, value); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:38 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:34 + def path; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:30 + def rack_app; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:42 + def reqs; 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. +# +# pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:71 +class ActionDispatch::Routing::RoutesInspector + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:72 + def initialize(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:77 + def format(formatter, filter = T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:141 + def collect_engine_routes(route); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:127 + def collect_routes(routes); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:116 + def filter_routes(filter); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/inspector.rb:97 + def normalize_filter(filter); end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:7 +class ActionDispatch::Routing::RoutesProxy + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:13 + def initialize(routes, scope, helpers, script_namer = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:11 + def _routes; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:8 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:8 + def default_url_options=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:8 + def default_url_options?; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:10 + def routes; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:10 + def routes=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:10 + def scope; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:10 + def scope=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:19 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:53 + def merge_script_names(previous_script_name, new_script_name); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:30 + def method_missing(method, *args); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:26 + def respond_to_missing?(method, _); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:8 + def default_url_options; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:8 + def default_url_options=(value); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/routes_proxy.rb:8 + def default_url_options?; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/routing.rb:257 +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" +# +# pkg:gem/actionpack#lib/action_dispatch/routing/url_for.rb:89 +module ActionDispatch::Routing::UrlFor + include ::ActionDispatch::Routing::PolymorphicRoutes + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + # pkg:gem/actionpack#lib/action_dispatch/routing/url_for.rb:108 + def initialize(*, **, &); end + + # pkg:gem/actionpack#lib/action_dispatch/routing/url_for.rb:177 + 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" + # + # pkg:gem/actionpack#lib/action_dispatch/routing/url_for.rb:217 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/url_for.rb:173 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/routing/url_for.rb:116 + def url_options; end + + protected + + # pkg:gem/actionpack#lib/action_dispatch/routing/url_for.rb:222 + def optimize_routes_generation?; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/routing/url_for.rb:234 + def _routes_context; end + + # pkg:gem/actionpack#lib/action_dispatch/routing/url_for.rb:227 + 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 +# (e.g. redirect: { host: "secure.widgets.com", port: 8080 }), or set +# redirect: false to disable this feature. +# +# Requests can opt-out of redirection with +exclude+: +# +# config.ssl_options = { redirect: { exclude: -> request { /healthcheck/.match?(request.path) } } } +# +# Cookies will not be flagged as secure for excluded requests. +# +# 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 }. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:51 +class ActionDispatch::SSL + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:63 + def initialize(app, redirect: T.unsafe(nil), hsts: T.unsafe(nil), secure_cookies: T.unsafe(nil), ssl_default_redirect_status: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:75 + def call(env); end + + private + + # https://tools.ietf.org/html/rfc6797#section-6.1 + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:109 + def build_hsts_header(hsts); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:116 + def flag_cookies_as_secure!(headers); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:157 + def https_location_for(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:94 + def normalize_hsts_options(options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:140 + def redirect_to_https(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:147 + def redirection_status(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:90 + def set_hsts_header!(headers); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:59 + def default_hsts_options; end + end +end + +# Default to 2 years as recommended on hstspreload.org. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:55 +ActionDispatch::SSL::HSTS_EXPIRES_IN = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/ssl.rb:57 +ActionDispatch::SSL::PERMANENT_REDIRECT_REQUEST_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:6 +class ActionDispatch::ServerTiming + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:50 + def initialize(app); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:56 + def call(env); end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:46 + def unsubscribe; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:7 +class ActionDispatch::ServerTiming::Subscriber + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:11 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:15 + def call(event); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:21 + def collect_events; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:30 + def ensure_subscribed; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:38 + def unsubscribe; end + + class << self + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:8 + def allocate; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:8 + def new(*_arg0); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/server_timing.rb:9 +ActionDispatch::ServerTiming::Subscriber::KEY = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/actionpack#lib/action_dispatch.rb:106 +module ActionDispatch::Session + class << self + # pkg:gem/actionpack#lib/action_dispatch.rb:113 + def resolve_store(session_store); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:95 +class ActionDispatch::Session::AbstractSecureStore < ::Rack::Session::Abstract::PersistedSecure + include ::ActionDispatch::Session::Compatibility + include ::ActionDispatch::Session::StaleSessionCheck + include ::ActionDispatch::Session::SessionObject + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:100 + def generate_sid; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:105 + def set_cookie(request, response, cookie); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:84 +class ActionDispatch::Session::AbstractStore < ::Rack::Session::Abstract::Persisted + include ::ActionDispatch::Session::Compatibility + include ::ActionDispatch::Session::StaleSessionCheck + include ::ActionDispatch::Session::SessionObject + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:90 + 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. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/cache_store.rb:17 +class ActionDispatch::Session::CacheStore < ::ActionDispatch::Session::AbstractSecureStore + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cache_store.rb:18 + def initialize(app, options = T.unsafe(nil)); end + + # Remove a session from the cache. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cache_store.rb:44 + def delete_session(env, sid, options); end + + # Get a session from the cache. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cache_store.rb:25 + def find_session(env, sid); end + + # Set a session in the cache. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cache_store.rb:33 + def write_session(env, sid, session, options); end + + private + + # Turn the session id into a cache key. + # + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cache_store.rb:52 + def cache_key(id); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cache_store.rb:56 + def get_session_with_fallback(sid); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:20 +module ActionDispatch::Session::Compatibility + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:21 + def initialize(app, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:26 + def generate_sid; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:33 + def initialize_sid; end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:38 + 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. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:51 +class ActionDispatch::Session::CookieStore < ::ActionDispatch::Session::AbstractSecureStore + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:63 + def initialize(app, options = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:69 + def delete_session(req, session_id, options); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:76 + def load_session(req); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:123 + def cookie_jar(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:85 + def extract_session_id(req); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:119 + def get_cookie(req); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:104 + def persistent_session_id!(data, sid = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:115 + def set_cookie(request, session_id, cookie); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:92 + def unpacked_cookie_data(req); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:110 + def write_session(req, sid, session_data, options); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:61 +ActionDispatch::Session::CookieStore::DEFAULT_SAME_SITE = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:52 +class ActionDispatch::Session::CookieStore::SessionId + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:55 + def initialize(session_id, cookie_value = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/cookie_store.rb:53 + def cookie_value; end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:69 +module ActionDispatch::Session::SessionObject + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:70 + def commit_session(req, res); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:79 + def loaded_session?(session); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:75 + def prepare_session(req); end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:11 +class ActionDispatch::Session::SessionRestoreError < ::StandardError + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:12 + def initialize; end +end + +# pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:43 +module ActionDispatch::Session::StaleSessionCheck + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:48 + def extract_session_id(env); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:44 + def load_session(env); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/session/abstract_store.rb:52 + 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. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/show_exceptions.rb:24 +class ActionDispatch::ShowExceptions + # pkg:gem/actionpack#lib/action_dispatch/middleware/show_exceptions.rb:25 + def initialize(app, exceptions_app); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/show_exceptions.rb:30 + def call(env); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/middleware/show_exceptions.rb:64 + def fallback_to_html_format_if_invalid_mime_type(request); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/show_exceptions.rb:73 + def pass_response(status); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/show_exceptions.rb:44 + 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. +# +# pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:18 +class ActionDispatch::Static + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:19 + def initialize(app, path, index: T.unsafe(nil), headers: T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/middleware/static.rb:24 + def call(env); 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. +# +# pkg:gem/actionpack#lib/action_dispatch/system_test_case.rb:112 +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 + + # pkg:gem/actionpack#lib/action_dispatch/system_test_case.rb:120 + def initialize(*); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/system_test_case.rb:181 + def method_missing(name, *args, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/system_test_case.rb:189 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/system_test_case.rb:163 + 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 + # + # pkg:gem/actionpack#lib/action_dispatch/system_test_case.rb:156 + def driven_by(driver, using: T.unsafe(nil), screen_size: T.unsafe(nil), options: T.unsafe(nil), &capabilities); end + + # pkg:gem/actionpack#lib/action_dispatch/system_test_case.rb:136 + def driver; end + + # pkg:gem/actionpack#lib/action_dispatch/system_test_case.rb:136 + def driver=(value); end + + # pkg:gem/actionpack#lib/action_dispatch/system_test_case.rb:136 + def driver?; end + + # pkg:gem/actionpack#lib/action_dispatch/system_test_case.rb:126 + def start_application; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/system_test_case.rb:118 +ActionDispatch::SystemTestCase::DEFAULT_HOST = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/system_testing/driver.rb:4 +module ActionDispatch::SystemTesting; end + +# pkg:gem/actionpack#lib/action_dispatch/system_testing/browser.rb:5 +class ActionDispatch::SystemTesting::Browser + # pkg:gem/actionpack#lib/action_dispatch/system_testing/browser.rb:8 + def initialize(name); end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/browser.rb:34 + def configure; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/browser.rb:6 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/browser.rb:24 + def options; end + + # driver_path is lazily initialized by default. Eagerly set it to + # avoid race conditions when using parallel tests. + # + # pkg:gem/actionpack#lib/action_dispatch/system_testing/browser.rb:40 + def preload; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/browser.rb:13 + def type; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/browser.rb:72 + def resolve_driver_path(namespace); end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/browser.rb:50 + def set_default_options; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/browser.rb:59 + def set_headless_chrome_browser_options; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/browser.rb:66 + def set_headless_firefox_browser_options; end +end + +# pkg:gem/actionpack#lib/action_dispatch/system_testing/driver.rb:5 +class ActionDispatch::SystemTesting::Driver + # pkg:gem/actionpack#lib/action_dispatch/system_testing/driver.rb:8 + def initialize(driver_type, **options, &capabilities); end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/driver.rb:6 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/driver.rb:25 + def use; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/driver.rb:49 + def browser_options; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/driver.rb:36 + def register; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/driver.rb:59 + def register_cuprite(app); end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/driver.rb:67 + def register_playwright(app); end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/driver.rb:63 + def register_rack_test(app); end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/driver.rb:53 + def register_selenium(app); end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/driver.rb:32 + def registerable?; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/driver.rb:78 + def setup; end +end + +# pkg:gem/actionpack#lib/action_dispatch/system_testing/server.rb:5 +class ActionDispatch::SystemTesting::Server + # pkg:gem/actionpack#lib/action_dispatch/system_testing/server.rb:12 + def run; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/server.rb:26 + def set_port; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/server.rb:22 + def set_server; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/server.rb:17 + def setup; end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/system_testing/server.rb:7 + def silence_puma; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/server.rb:7 + def silence_puma=(_arg0); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:5 +module ActionDispatch::SystemTesting::TestHelpers; end + +# Screenshot helper for system testing. +# +# pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:7 +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. + # + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:44 + 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)] Only displays the screenshot path. + # This is the default value. + # * [+inline+] Display the screenshot in the terminal using the + # iTerm image protocol (https://iterm2.com/documentation-images.html). + # * [+artifact+] Display the screenshot in the terminal, using the terminal + # artifact format (https://buildkite.github.io/terminal-to-html/inline-images/). + # + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:31 + def take_screenshot(html: T.unsafe(nil), screenshot: T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:52 + def _screenshot_counter; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:52 + def _screenshot_counter=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:97 + def absolute_html_path; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:89 + def absolute_image_path; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:81 + def absolute_path; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:123 + def display_image(html:, screenshot_output:); end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:143 + def failed?; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:54 + def html_from_env?; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:77 + def html_path; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:67 + def image_name; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:73 + def image_path; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:58 + def increment_unique; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:139 + def inline_base64(path); end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:109 + def output_type; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:93 + def relative_image_path; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:101 + def save_html; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:105 + def save_image; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:85 + def screenshots_dir; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:119 + def show(img); end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:147 + def supports_screenshot?; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb:63 + def unique; end +end + +# pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb:6 +module ActionDispatch::SystemTesting::TestHelpers::SetupAndTeardown + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb:13 + def after_teardown; end + + # pkg:gem/actionpack#lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb:7 + def before_teardown; end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/test_process.rb:7 +module ActionDispatch::TestProcess + include ::ActionDispatch::TestProcess::FixtureFile + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_process.rb:31 + def assigns(key = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_process.rb:45 + def cookies; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_process.rb:41 + def flash; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_process.rb:49 + def redirect_to_url; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_process.rb:37 + def session; end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/test_process.rb:8 +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) } + # + # pkg:gem/actionpack#lib/action_dispatch/testing/test_process.rb:19 + def file_fixture_upload(path, mime_type = T.unsafe(nil), binary = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_process.rb:26 + def fixture_file_upload(path, mime_type = T.unsafe(nil), binary = T.unsafe(nil)); end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:7 +class ActionDispatch::TestRequest < ::ActionDispatch::Request + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:66 + def accept=(mime_types); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:46 + def action=(action_name); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:30 + def host=(host); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:50 + def if_modified_since=(last_modified); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:54 + def if_none_match=(etag); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:42 + def path=(path); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:34 + def port=(number); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:58 + def remote_addr=(addr); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:26 + def request_method=(method); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:38 + def request_uri=(uri); end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:62 + def user_agent=(user_agent); end + + class << self + # Create a new test request with default +env+ values. + # + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:15 + def create(env = T.unsafe(nil)); end + + private + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:21 + def default_env; end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/testing/test_request.rb:8 +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. +# +# pkg:gem/actionpack#lib/action_dispatch/testing/test_response.rb:12 +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 + # + # pkg:gem/actionpack#lib/action_dispatch/testing/test_response.rb:49 + def parsed_body; end + + # pkg:gem/actionpack#lib/action_dispatch/testing/test_response.rb:53 + def response_parser; end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/testing/test_response.rb:13 + def from_response(response); end + end +end + +# pkg:gem/actionpack#lib/action_pack/gem_version.rb:3 +module ActionPack + class << self + # Returns the currently loaded version of Action Pack as a +Gem::Version+. + # + # pkg:gem/actionpack#lib/action_pack/gem_version.rb:5 + def gem_version; end + + # Returns the currently loaded version of Action Pack as a +Gem::Version+. + # + # pkg:gem/actionpack#lib/action_pack/version.rb:7 + def version; end + end +end + +# pkg:gem/actionpack#lib/action_pack/gem_version.rb:9 +module ActionPack::VERSION; end + +# pkg:gem/actionpack#lib/action_pack/gem_version.rb:10 +ActionPack::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionpack#lib/action_pack/gem_version.rb:11 +ActionPack::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionpack#lib/action_pack/gem_version.rb:13 +ActionPack::VERSION::PRE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_pack/gem_version.rb:15 +ActionPack::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_pack/gem_version.rb:12 +ActionPack::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +module ActionView::RoutingUrlFor + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionDispatch::Routing::UrlFor +end + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:5 +module Mime + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:49 + def [](type); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:62 + def fetch(type, &block); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:54 + def symbols; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:58 + 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. +# +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:356 +Mime::ALL = T.let(T.unsafe(nil), Mime::AllType) + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:342 +class Mime::AllType < ::Mime::Type + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:345 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:349 + def all?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:350 + def html?; end + + class << self + private + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:343 + def allocate; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:343 + def new(*_arg0); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:45 +Mime::EXTENSION_LOOKUP = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:46 +Mime::LOOKUP = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:6 +class Mime::Mimes + include ::Enumerable + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:11 + def initialize; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:21 + def <<(type); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:28 + def delete_if; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:17 + def each(&block); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:7 + def symbols; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:39 + def valid_symbols?(symbols); end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:358 +class Mime::NullType + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:361 + def nil?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:369 + def ref; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:365 + def to_s; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:376 + def method_missing(method, *args); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:372 + def respond_to_missing?(method, _); end + + class << self + private + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:359 + def allocate; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:359 + def new(*_arg0); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:44 +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 +# +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:81 +class Mime::Type + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:257 + def initialize(string, symbol = T.unsafe(nil), synonyms = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:290 + def ==(mime_type); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:282 + def ===(list); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:304 + def =~(mime_type); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:320 + def all?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:297 + def eql?(other); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:248 + def hash; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:316 + def html?; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:310 + def match?(mime_type); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:278 + def ref; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:82 + def symbol; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:266 + def to_s; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:270 + def to_str; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:274 + def to_sym; end + + protected + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:323 + def string; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:323 + def synonyms; end + + private + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:329 + def method_missing(method, *args); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:337 + def respond_to_missing?(method, include_private = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:327 + def to_a; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:326 + def to_ary; end + + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:164 + def lookup(string); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:169 + def lookup_by_extension(extension); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:193 + 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]]. + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:229 + def parse_data_with_trailing_star(type); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:220 + def parse_trailing_star(accept_header); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:179 + 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. + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:175 + def register_alias(string, symbol, extension_synonyms = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:160 + def register_callback(&block); end + + # This method is opposite of register method. + # + # To unregister a MIME type: + # + # Mime::Type.unregister(:mobile) + # + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:238 + def unregister(symbol); end + end +end + +# A simple helper class used in parsing the accept header. +# +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:87 +class Mime::Type::AcceptItem + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:91 + def initialize(index, name, q = T.unsafe(nil)); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:98 + def <=>(item); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:88 + def index; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:88 + def index=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:88 + def name; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:88 + def name=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:88 + def q; end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:88 + def q=(_arg0); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:89 + def to_s; end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:105 +class Mime::Type::AcceptList + class << self + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:148 + def find_item_by_name(array, name); end + + # pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:106 + def sort!(list); end + end +end + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:255 +class Mime::Type::InvalidMimeType < ::StandardError; end + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:250 +Mime::Type::MIME_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:252 +Mime::Type::MIME_PARAMETER = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:251 +Mime::Type::MIME_PARAMETER_VALUE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionpack#lib/action_dispatch/http/mime_type.rb:253 +Mime::Type::MIME_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionpack#lib/action_dispatch.rb:34 +module Rack; end diff --git a/sorbet/rbi/gems/actiontext@7.1.3.4.rbi b/sorbet/rbi/gems/actiontext@7.1.3.4.rbi new file mode 100644 index 000000000..aefb3ea96 --- /dev/null +++ b/sorbet/rbi/gems/actiontext@7.1.3.4.rbi @@ -0,0 +1,1343 @@ +# 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: actiontext/README.md +# +# pkg:gem/actiontext#lib/action_text/gem_version.rb:3 +module ActionText + extend ::ActiveSupport::Autoload + + class << self + # pkg:gem/actiontext#lib/action_text/deprecator.rb:4 + def deprecator; end + + # Returns the currently loaded version of Action Text as a +Gem::Version+. + # + # pkg:gem/actiontext#lib/action_text/gem_version.rb:5 + def gem_version; end + + # pkg:gem/actiontext#lib/action_text.rb:47 + def html_document_class; end + + # pkg:gem/actiontext#lib/action_text.rb:53 + def html_document_fragment_class; end + + # pkg:gem/actiontext#lib/action_text/engine.rb:12 + def railtie_helpers_paths; end + + # pkg:gem/actiontext#lib/action_text/engine.rb:12 + def railtie_namespace; end + + # pkg:gem/actiontext#lib/action_text/engine.rb:12 + def railtie_routes_url_helpers(include_path_helpers = T.unsafe(nil)); end + + # pkg:gem/actiontext#lib/action_text/engine.rb:12 + def table_name_prefix; end + + # pkg:gem/actiontext#lib/action_text/engine.rb:12 + def use_relative_model_naming?; end + + # Returns the currently loaded version of Action Text as a +Gem::Version+. + # + # pkg:gem/actiontext#lib/action_text/version.rb:7 + 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] +# +# pkg:gem/actiontext#lib/action_text/attachable.rb:16 +module ActionText::Attachable + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionText::Attachable::ClassMethods + + # pkg:gem/actiontext#lib/action_text/attachable.rb:81 + def attachable_content_type; end + + # pkg:gem/actiontext#lib/action_text/attachable.rb:85 + def attachable_filename; end + + # pkg:gem/actiontext#lib/action_text/attachable.rb:89 + def attachable_filesize; end + + # pkg:gem/actiontext#lib/action_text/attachable.rb:93 + 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. + # + # pkg:gem/actiontext#lib/action_text/attachable.rb:77 + def attachable_sgid; end + + # pkg:gem/actiontext#lib/action_text/attachable.rb:97 + 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 + # + # pkg:gem/actiontext#lib/action_text/attachable.rb:125 + def to_attachable_partial_path; end + + # pkg:gem/actiontext#lib/action_text/attachable.rb:129 + 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 + # + # pkg:gem/actiontext#lib/action_text/attachable.rb:111 + def to_trix_content_attachment_partial_path; end + + private + + # pkg:gem/actiontext#lib/action_text/attachable.rb:142 + def attribute_names_for_serialization; end + + # pkg:gem/actiontext#lib/action_text/attachable.rb:146 + def read_attribute_for_serialization(key); end + + class << self + # pkg:gem/actiontext#lib/action_text/attachable.rb:41 + 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 + # + # pkg:gem/actiontext#lib/action_text/attachable.rb:29 + def from_node(node); end + + private + + # pkg:gem/actiontext#lib/action_text/attachable.rb:48 + def attachable_from_sgid(sgid); end + end +end + +# pkg:gem/actiontext#lib/action_text/attachable.rb:55 +module ActionText::Attachable::ClassMethods + # pkg:gem/actiontext#lib/action_text/attachable.rb:56 + def from_attachable_sgid(sgid); end + + # pkg:gem/actiontext#lib/action_text/attachable.rb:70 + def to_missing_attachable_partial_path; end +end + +# pkg:gem/actiontext#lib/action_text/attachable.rb:19 +ActionText::Attachable::LOCATOR_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/actiontext#lib/action_text.rb:30 +module ActionText::Attachables + extend ::ActiveSupport::Autoload +end + +# pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:5 +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 + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def __callbacks; end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def __callbacks?; end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def _run_validate_callbacks(&block); end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def _validate_callbacks; end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def _validators; end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def _validators?; end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:18 + def attachable_plain_text_representation(caption); end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:13 + def content; end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:13 + def content=(_arg0); end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:13 + def content_type; end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:13 + def content_type=(_arg0); end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def model_name(&block); end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def param_delimiter=(_arg0); end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:22 + def to_html; end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:30 + def to_partial_path; end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:26 + def to_s; end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def validation_context; end + + private + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:35 + def content_instance; end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def validation_context=(_arg0); end + + class << self + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def __callbacks; end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def __callbacks=(value); end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def __callbacks?; end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def _validate_callbacks; end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def _validate_callbacks=(value); end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def _validators; end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def _validators=(value); end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def _validators?; end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:8 + def from_node(node); end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def param_delimiter; end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def param_delimiter=(value); end + + # pkg:gem/actiontext#lib/action_text/attachables/content_attachment.rb:6 + def param_delimiter?; end + end +end + +# pkg:gem/actiontext#lib/action_text/attachables/missing_attachable.rb:5 +class ActionText::Attachables::MissingAttachable + extend ::ActiveModel::Naming + + # pkg:gem/actiontext#lib/action_text/attachables/missing_attachable.rb:10 + def initialize(sgid); end + + # pkg:gem/actiontext#lib/action_text/attachables/missing_attachable.rb:22 + def model; end + + # pkg:gem/actiontext#lib/action_text/attachables/missing_attachable.rb:6 + def model_name(&block); end + + # pkg:gem/actiontext#lib/action_text/attachables/missing_attachable.rb:14 + def to_partial_path; end +end + +# pkg:gem/actiontext#lib/action_text/attachables/missing_attachable.rb:8 +ActionText::Attachables::MissingAttachable::DEFAULT_PARTIAL_PATH = T.let(T.unsafe(nil), String) + +# pkg:gem/actiontext#lib/action_text/attachables/remote_image.rb:5 +class ActionText::Attachables::RemoteImage + extend ::ActiveModel::Naming + + # pkg:gem/actiontext#lib/action_text/attachables/remote_image.rb:30 + def initialize(attributes = T.unsafe(nil)); end + + # pkg:gem/actiontext#lib/action_text/attachables/remote_image.rb:37 + def attachable_plain_text_representation(caption); end + + # pkg:gem/actiontext#lib/action_text/attachables/remote_image.rb:28 + def content_type; end + + # pkg:gem/actiontext#lib/action_text/attachables/remote_image.rb:28 + def height; end + + # pkg:gem/actiontext#lib/action_text/attachables/remote_image.rb:6 + def model_name(&block); end + + # pkg:gem/actiontext#lib/action_text/attachables/remote_image.rb:41 + def to_partial_path; end + + # pkg:gem/actiontext#lib/action_text/attachables/remote_image.rb:28 + def url; end + + # pkg:gem/actiontext#lib/action_text/attachables/remote_image.rb:28 + def width; end + + class << self + # pkg:gem/actiontext#lib/action_text/attachables/remote_image.rb:9 + def from_node(node); end + + private + + # pkg:gem/actiontext#lib/action_text/attachables/remote_image.rb:20 + def attributes_from_node(node); end + + # pkg:gem/actiontext#lib/action_text/attachables/remote_image.rb:16 + 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]" + # + # pkg:gem/actiontext#lib/action_text/attachment.rb:108 + def to_plain_text; end + + # pkg:gem/actiontext#lib/action_text/attachment.rb:125 + def to_s; end + + # pkg:gem/actiontext#lib/action_text/attachment.rb:79 + def with_full_attributes; end + + private + + # pkg:gem/actiontext#lib/action_text/attachment.rb:138 + def attachable_attributes; end + + # pkg:gem/actiontext#lib/action_text/attachment.rb:134 + def node_attributes; end + + # pkg:gem/actiontext#lib/action_text/attachment.rb:64 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end + + # pkg:gem/actiontext#lib/action_text/attachment.rb:142 + def sgid_attributes; end + + class << self + # pkg:gem/actiontext#lib/action_text/attachment.rb:25 + def fragment_by_canonicalizing_attachments(content); end + + # pkg:gem/actiontext#lib/action_text/attachment.rb:37 + def from_attachable(attachable, attributes = T.unsafe(nil)); end + + # pkg:gem/actiontext#lib/action_text/attachment.rb:33 + def from_attachables(attachables); end + + # pkg:gem/actiontext#lib/action_text/attachment.rb:43 + def from_attributes(attributes, attachable = T.unsafe(nil)); end + + # pkg:gem/actiontext#lib/action_text/attachment.rb:29 + def from_node(node, attachable = T.unsafe(nil)); end + + # pkg:gem/actiontext#lib/action_text/attachment.rb:20 + def tag_name; end + + # pkg:gem/actiontext#lib/action_text/attachment.rb:20 + def tag_name=(val); end + + private + + # pkg:gem/actiontext#lib/action_text/attachment.rb:50 + def node_from_attributes(attributes); end + + # pkg:gem/actiontext#lib/action_text/attachment.rb:56 + def process_attributes(attributes); end + end +end + +# pkg:gem/actiontext#lib/action_text/attachment.rb:22 +ActionText::Attachment::ATTRIBUTES = T.let(T.unsafe(nil), Array) + +# pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:4 +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 + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:52 + def initialize(node); end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def __callbacks; end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def __callbacks?; end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def _run_validate_callbacks(&block); end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def _validate_callbacks; end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def _validators; end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def _validators?; end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:56 + def attachments; end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:66 + def inspect; end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def model_name(&block); end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:50 + def node; end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def param_delimiter=(_arg0); end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:62 + def size; end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def validation_context; end + + private + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def validation_context=(_arg0); end + + class << self + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def __callbacks; end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def __callbacks=(value); end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def __callbacks?; end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def _validate_callbacks; end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def _validate_callbacks=(value); end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def _validators; end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def _validators=(value); end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def _validators?; end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:41 + def attachment_selector; end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:25 + def find_attachment_gallery_nodes(content); end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:11 + def fragment_by_canonicalizing_attachment_galleries(content); end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:17 + def fragment_by_replacing_attachment_gallery_nodes(content); end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:37 + def from_node(node); end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def param_delimiter; end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def param_delimiter=(value); end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:5 + def param_delimiter?; end + + # pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:45 + def selector; end + end +end + +# pkg:gem/actiontext#lib/action_text/attachment_gallery.rb:7 +ActionText::AttachmentGallery::TAG_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/actiontext#lib/action_text.rb:38 +module ActionText::Attachments + extend ::ActiveSupport::Autoload +end + +# pkg:gem/actiontext#lib/action_text/attachments/caching.rb:5 +module ActionText::Attachments::Caching + # pkg:gem/actiontext#lib/action_text/attachments/caching.rb:6 + def cache_key(*args); end + + private + + # pkg:gem/actiontext#lib/action_text/attachments/caching.rb:11 + def cache_digest; end +end + +# pkg:gem/actiontext#lib/action_text/attachments/minification.rb:5 +module ActionText::Attachments::Minification + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionText::Attachments::Minification::ClassMethods +end + +# pkg:gem/actiontext#lib/action_text/attachments/minification.rb:8 +module ActionText::Attachments::Minification::ClassMethods + # pkg:gem/actiontext#lib/action_text/attachments/minification.rb:9 + def fragment_by_minifying_attachments(content); end +end + +# pkg:gem/actiontext#lib/action_text/attachments/trix_conversion.rb:7 +module ActionText::Attachments::TrixConversion + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionText::Attachments::TrixConversion::ClassMethods + + # pkg:gem/actiontext#lib/action_text/attachments/trix_conversion.rb:22 + def to_trix_attachment(content = T.unsafe(nil)); end + + private + + # pkg:gem/actiontext#lib/action_text/attachments/trix_conversion.rb:29 + def trix_attachment_content; end +end + +# pkg:gem/actiontext#lib/action_text/attachments/trix_conversion.rb:10 +module ActionText::Attachments::TrixConversion::ClassMethods + # pkg:gem/actiontext#lib/action_text/attachments/trix_conversion.rb:11 + def fragment_by_converting_trix_attachments(content); end + + # pkg:gem/actiontext#lib/action_text/attachments/trix_conversion.rb:17 + def from_trix_attachment(trix_attachment); end +end + +# pkg:gem/actiontext#lib/action_text/attribute.rb:4 +module ActionText::Attribute + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionText::Attribute::ClassMethods +end + +# pkg:gem/actiontext#lib/action_text/attribute.rb:7 +module ActionText::Attribute::ClassMethods + # pkg:gem/actiontext#lib/action_text/attribute.rb:37 + def has_rich_text(name, encrypted: T.unsafe(nil), strict_loading: T.unsafe(nil)); end + + # pkg:gem/actiontext#lib/action_text/attribute.rb:66 + def rich_text_association_names; end + + # pkg:gem/actiontext#lib/action_text/attribute.rb:62 + 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!" +# +# pkg:gem/actiontext#lib/action_text/content.rb:22 +class ActionText::Content + include ::ActionText::ContentHelper + include ::ActionText::Serialization + include ::ActionText::Rendering + extend ::ActionText::Serialization::ClassMethods + extend ::ActionText::Rendering::ClassMethods + + # pkg:gem/actiontext#lib/action_text/content.rb:37 + def initialize(content = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actiontext#lib/action_text/content.rb:146 + def ==(other); end + + # pkg:gem/actiontext#lib/action_text/content.rb:90 + def append_attachables(attachables); end + + # pkg:gem/actiontext#lib/action_text/content.rb:138 + def as_json(*); end + + # Extracts +ActionText::Attachable+s from the HTML fragment: + # + # attachable = ActiveStorage::Blob.first + # html = %Q() + # content = ActionText::Content.new(html) + # content.attachables # => [attachable] + # + # pkg:gem/actiontext#lib/action_text/content.rb:84 + def attachables; end + + # pkg:gem/actiontext#lib/action_text/content.rb:68 + def attachment_galleries; end + + # Extracts +ActionText::Attachment+s from the HTML fragment: + # + # attachable = ActiveStorage::Blob.first + # html = %Q() + # content = ActionText::Content.new(html) + # content.attachments # => [# ["http://example.com/"] + # + # pkg:gem/actiontext#lib/action_text/content.rb:52 + def links; end + + # pkg:gem/actiontext#lib/action_text/content.rb:27 + def present?(*, **, &); end + + # pkg:gem/actiontext#lib/action_text/content.rb:23 + def render(*, **, &); end + + # pkg:gem/actiontext#lib/action_text/content.rb:103 + def render_attachment_galleries(&block); end + + # pkg:gem/actiontext#lib/action_text/content.rb:95 + def render_attachments(**options, &block); end + + # pkg:gem/actiontext#lib/action_text/content.rb:122 + def to_html; end + + # pkg:gem/actiontext#lib/action_text/content.rb:130 + def to_partial_path; end + + # Returns the content as plain text with all HTML tags removed. + # + # content = ActionText::Content.new("

Funny times!

") + # content.to_plain_text # => "Funny times!" + # + # pkg:gem/actiontext#lib/action_text/content.rb:114 + def to_plain_text; end + + # pkg:gem/actiontext#lib/action_text/content.rb:126 + def to_rendered_html_with_layout; end + + # pkg:gem/actiontext#lib/action_text/content.rb:134 + def to_s; end + + # pkg:gem/actiontext#lib/action_text/content.rb:118 + def to_trix_html; end + + private + + # pkg:gem/actiontext#lib/action_text/content.rb:163 + def attachment_for_node(node, with_full_attributes: T.unsafe(nil)); end + + # pkg:gem/actiontext#lib/action_text/content.rb:168 + def attachment_gallery_for_node(node); end + + # pkg:gem/actiontext#lib/action_text/content.rb:159 + def attachment_gallery_nodes; end + + # pkg:gem/actiontext#lib/action_text/content.rb:155 + def attachment_nodes; end + + class << self + # pkg:gem/actiontext#lib/action_text/content.rb:30 + def fragment_by_canonicalizing_content(content); end + + # pkg:gem/actiontext#lib/action_text/content.rb:23 + def renderer; end + + # pkg:gem/actiontext#lib/action_text/content.rb:23 + 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 +end + +module ActionText::EncryptedRichText::GeneratedAssociationMethods; end +module ActionText::EncryptedRichText::GeneratedAttributeMethods; end + +# pkg:gem/actiontext#lib/action_text/encryption.rb:4 +module ActionText::Encryption + # pkg:gem/actiontext#lib/action_text/encryption.rb:12 + def decrypt; end + + # pkg:gem/actiontext#lib/action_text/encryption.rb:5 + def encrypt; end + + private + + # pkg:gem/actiontext#lib/action_text/encryption.rb:24 + def decrypt_rich_texts; end + + # pkg:gem/actiontext#lib/action_text/encryption.rb:20 + def encrypt_rich_texts; end + + # pkg:gem/actiontext#lib/action_text/encryption.rb:32 + def encryptable_rich_texts; end + + # pkg:gem/actiontext#lib/action_text/encryption.rb:28 + def has_encrypted_rich_texts?; end +end + +# pkg:gem/actiontext#lib/action_text/engine.rb:11 +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. +# +# pkg:gem/actiontext#lib/action_text/fixture_set.rb:40 +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) %>
+ # + # pkg:gem/actiontext#lib/action_text/fixture_set.rb:61 + def attachment(fixture_set_name, label, column_type: T.unsafe(nil)); end + end +end + +# pkg:gem/actiontext#lib/action_text/fragment.rb:4 +class ActionText::Fragment + # pkg:gem/actiontext#lib/action_text/fragment.rb:24 + def initialize(source); end + + # pkg:gem/actiontext#lib/action_text/fragment.rb:28 + def find_all(selector); end + + # pkg:gem/actiontext#lib/action_text/fragment.rb:37 + def replace(selector); end + + # pkg:gem/actiontext#lib/action_text/fragment.rb:22 + def source; end + + # pkg:gem/actiontext#lib/action_text/fragment.rb:50 + def to_html; end + + # pkg:gem/actiontext#lib/action_text/fragment.rb:46 + def to_plain_text; end + + # pkg:gem/actiontext#lib/action_text/fragment.rb:54 + def to_s; end + + # pkg:gem/actiontext#lib/action_text/fragment.rb:32 + def update; end + + class << self + # pkg:gem/actiontext#lib/action_text/fragment.rb:17 + def from_html(html); end + + # pkg:gem/actiontext#lib/action_text/fragment.rb:6 + def wrap(fragment_or_html); end + end +end + +# pkg:gem/actiontext#lib/action_text/html_conversion.rb:4 +module ActionText::HtmlConversion + extend ::ActionText::HtmlConversion + + # pkg:gem/actiontext#lib/action_text/html_conversion.rb:15 + def create_element(tag_name, attributes = T.unsafe(nil)); end + + # pkg:gem/actiontext#lib/action_text/html_conversion.rb:11 + def fragment_for_html(html); end + + # pkg:gem/actiontext#lib/action_text/html_conversion.rb:7 + def node_to_html(node); end + + private + + # pkg:gem/actiontext#lib/action_text/html_conversion.rb:20 + def document; end +end + +# pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:4 +module ActionText::PlainTextConversion + extend ::ActionText::PlainTextConversion + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:7 + def node_to_plain_text(node); end + + private + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:104 + def break_if_nested_list(node, text); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:81 + def bullet_for_li_node(node, index); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:93 + def indentation_for_li_node(node); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:100 + def list_node_depth_for_node(node); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:89 + def list_node_name_for_li_node(node); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:32 + def plain_text_for_block(node, index = T.unsafe(nil)); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:64 + def plain_text_for_blockquote_node(node, index); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:48 + def plain_text_for_br_node(node, index); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:56 + def plain_text_for_div_node(node, index); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:60 + def plain_text_for_figcaption_node(node, index); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:37 + def plain_text_for_h1_node(node, index = T.unsafe(nil)); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:69 + def plain_text_for_li_node(node, index); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:40 + def plain_text_for_list(node, index); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:12 + def plain_text_for_node(node, index = T.unsafe(nil)); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:20 + def plain_text_for_node_children(node); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:45 + def plain_text_for_ol_node(node, index); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:37 + def plain_text_for_p_node(node, index = T.unsafe(nil)); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:52 + def plain_text_for_text_node(node, index); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:45 + def plain_text_for_ul_node(node, index); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:28 + def plain_text_method_for_node(node); end + + # pkg:gem/actiontext#lib/action_text/plain_text_conversion.rb:77 + def remove_trailing_newlines(text); end +end + +class ActionText::Record < ::ActiveRecord::Base + include ::ActionText::Record::GeneratedAttributeMethods + include ::ActionText::Record::GeneratedAssociationMethods +end + +module ActionText::Record::GeneratedAssociationMethods; end +module ActionText::Record::GeneratedAttributeMethods; end + +# pkg:gem/actiontext#lib/action_text/rendering.rb:7 +module ActionText::Rendering + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionText::Rendering::ClassMethods +end + +# pkg:gem/actiontext#lib/action_text/rendering.rb:15 +module ActionText::Rendering::ClassMethods + # pkg:gem/actiontext#lib/action_text/rendering.rb:16 + def action_controller_renderer; end + + # pkg:gem/actiontext#lib/action_text/rendering.rb:28 + def render(*args, &block); end + + # pkg:gem/actiontext#lib/action_text/rendering.rb:20 + def with_renderer(renderer); end +end + +class ActionText::RichText < ::ActionText::Record + include ::ActionText::RichText::GeneratedAttributeMethods + include ::ActionText::RichText::GeneratedAssociationMethods + + 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?(*, **, &); end + def empty?(*, **, &); end + def nil?(*, **, &); end + def present?(*, **, &); end + def to_plain_text; end + def to_s(*, **, &); end + def to_trix_html; end + def validate_associated_records_for_embeds_attachments(*args); end + def validate_associated_records_for_embeds_blobs(*args); 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 + +# pkg:gem/actiontext#lib/action_text/serialization.rb:4 +module ActionText::Serialization + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActionText::Serialization::ClassMethods + + # pkg:gem/actiontext#lib/action_text/serialization.rb:32 + def _dump(*); end +end + +# pkg:gem/actiontext#lib/action_text/serialization.rb:7 +module ActionText::Serialization::ClassMethods + # pkg:gem/actiontext#lib/action_text/serialization.rb:29 + def _load(content); end + + # pkg:gem/actiontext#lib/action_text/serialization.rb:12 + def dump(content); end + + # pkg:gem/actiontext#lib/action_text/serialization.rb:8 + def load(content); end +end + +# pkg:gem/actiontext#lib/action_text/system_test_helper.rb:4 +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 + # + # Examples: + # + # # + # fill_in_rich_text_area "message_content", with: "Hello world!" + # + # # + # fill_in_rich_text_area "Your message here", with: "Hello world!" + # + # # + # # + # fill_in_rich_text_area "Message content", with: "Hello world!" + # + # # + # fill_in_rich_text_area "Message content", with: "Hello world!" + # + # # + # # + # fill_in_rich_text_area "message[content]", with: "Hello world!" + # + # pkg:gem/actiontext#lib/action_text/system_test_helper.rb:32 + def fill_in_rich_text_area(locator = T.unsafe(nil), with:); end +end + +module ActionText::TagHelper + def rich_text_area_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + class << self + def id; end + def id=(val); end + end +end + +# pkg:gem/actiontext#lib/action_text/trix_attachment.rb:4 +class ActionText::TrixAttachment + # pkg:gem/actiontext#lib/action_text/trix_attachment.rb:51 + def initialize(node); end + + # pkg:gem/actiontext#lib/action_text/trix_attachment.rb:55 + def attributes; end + + # pkg:gem/actiontext#lib/action_text/trix_attachment.rb:49 + def node; end + + # pkg:gem/actiontext#lib/action_text/trix_attachment.rb:59 + def to_html; end + + # pkg:gem/actiontext#lib/action_text/trix_attachment.rb:63 + def to_s; end + + private + + # pkg:gem/actiontext#lib/action_text/trix_attachment.rb:68 + def attachment_attributes; end + + # pkg:gem/actiontext#lib/action_text/trix_attachment.rb:72 + def composed_attributes; end + + # pkg:gem/actiontext#lib/action_text/trix_attachment.rb:80 + def read_json_attribute(name); end + + # pkg:gem/actiontext#lib/action_text/trix_attachment.rb:76 + def read_json_object_attribute(name); end + + class << self + # pkg:gem/actiontext#lib/action_text/trix_attachment.rb:19 + def from_attributes(attributes); end + + private + + # pkg:gem/actiontext#lib/action_text/trix_attachment.rb:33 + def process_attributes(attributes); end + + # pkg:gem/actiontext#lib/action_text/trix_attachment.rb:37 + def transform_attribute_keys(attributes); end + + # pkg:gem/actiontext#lib/action_text/trix_attachment.rb:41 + def typecast_attribute_values(attributes); end + end +end + +# pkg:gem/actiontext#lib/action_text/trix_attachment.rb:9 +ActionText::TrixAttachment::ATTRIBUTES = T.let(T.unsafe(nil), Array) + +# pkg:gem/actiontext#lib/action_text/trix_attachment.rb:10 +ActionText::TrixAttachment::ATTRIBUTE_TYPES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actiontext#lib/action_text/trix_attachment.rb:8 +ActionText::TrixAttachment::COMPOSED_ATTRIBUTES = T.let(T.unsafe(nil), Array) + +# pkg:gem/actiontext#lib/action_text/trix_attachment.rb:6 +ActionText::TrixAttachment::SELECTOR = T.let(T.unsafe(nil), String) + +# pkg:gem/actiontext#lib/action_text/trix_attachment.rb:5 +ActionText::TrixAttachment::TAG_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/actiontext#lib/action_text/gem_version.rb:9 +module ActionText::VERSION; end + +# pkg:gem/actiontext#lib/action_text/gem_version.rb:10 +ActionText::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actiontext#lib/action_text/gem_version.rb:11 +ActionText::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actiontext#lib/action_text/gem_version.rb:13 +ActionText::VERSION::PRE = T.let(T.unsafe(nil), String) + +# pkg:gem/actiontext#lib/action_text/gem_version.rb:15 +ActionText::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/actiontext#lib/action_text/gem_version.rb:12 +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)); 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)); end +end + +module ActionView::Helpers::Tags; end + +class ActionView::Helpers::Tags::ActionText < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Placeholderable + + def dom_id(*, **, &); end + def render; end +end diff --git a/sorbet/rbi/gems/actionview@7.1.3.4.rbi b/sorbet/rbi/gems/actionview@7.1.3.4.rbi new file mode 100644 index 000000000..6ff013ccf --- /dev/null +++ b/sorbet/rbi/gems/actionview@7.1.3.4.rbi @@ -0,0 +1,14493 @@ +# 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 ::ActiveSupport::Deprecation::DeprecatedConstantAccessor + include ::ActionDispatch::Routing::PolymorphicRoutes + include ::ActionController::Head + include ::AbstractController::Caching::ConfigMethods + include ::ActionController::BasicImplicitRender + extend ::AbstractController::Helpers::Resolution +end + +# :include: actionview/README.rdoc +# +# pkg:gem/actionview#lib/action_view/gem_version.rb:3 +module ActionView + extend ::ActiveSupport::Autoload + + class << self + # pkg:gem/actionview#lib/action_view/deprecator.rb:4 + def deprecator; end + + # pkg:gem/actionview#lib/action_view.rb:93 + def eager_load!; end + + # Returns the currently loaded version of Action View as a +Gem::Version+. + # + # pkg:gem/actionview#lib/action_view/gem_version.rb:5 + def gem_version; end + + # Returns the currently loaded version of Action View as a +Gem::Version+. + # + # pkg:gem/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. +# +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:21 +class ActionView::AbstractRenderer + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:24 + def initialize(lookup_context); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:22 + def any_templates?(*, **, &); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:22 + def formats(*, **, &); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:28 + def render; end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:22 + def template_exists?(*, **, &); end + + private + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:182 + def build_rendered_collection(templates, spacer); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:178 + def build_rendered_template(content, template); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:159 + def extract_details(options); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:171 + def prepend_formats(formats); end +end + +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:157 +ActionView::AbstractRenderer::NO_DETAILS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:32 +module ActionView::AbstractRenderer::ObjectRendering + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:37 + def initialize(lookup_context, options); end + + private + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:43 + def local_variable(path); end + + # pkg:gem/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. + # + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:76 + def partial_path(object, view); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:61 + def raise_invalid_identifier(path); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:65 + def raise_invalid_option_as(as); end +end + +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:54 +ActionView::AbstractRenderer::ObjectRendering::IDENTIFIER_ERROR_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:57 +ActionView::AbstractRenderer::ObjectRendering::OPTION_AS_ERROR_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:33 +ActionView::AbstractRenderer::ObjectRendering::PREFIXED_PARTIAL_NAMES = T.let(T.unsafe(nil), Concurrent::Map) + +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:110 +class ActionView::AbstractRenderer::RenderedCollection + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:117 + def initialize(rendered_templates, spacer); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:122 + def body; end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:126 + def format; end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:115 + def rendered_templates; end + + class << self + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:111 + def empty(format); end + end +end + +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:130 +class ActionView::AbstractRenderer::RenderedCollection::EmptyCollection + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:133 + def initialize(format); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:137 + def body; end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:131 + def format; end +end + +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:141 +class ActionView::AbstractRenderer::RenderedTemplate + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:144 + def initialize(body, template); end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:142 + def body; end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:149 + def format; end + + # pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:142 + def template; end +end + +# pkg:gem/actionview#lib/action_view/renderer/abstract_renderer.rb:153 +ActionView::AbstractRenderer::RenderedTemplate::EMPTY_SPACER = T.let(T.unsafe(nil), T.untyped) + +# = Action View Errors +# +# pkg:gem/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. +# +# === 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/jimweirich/builder]. +# +# pkg:gem/actionview#lib/action_view/base.rb:141 +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: + # + # pkg:gem/actionview#lib/action_view/base.rb:228 + def initialize(lookup_context, assigns, controller); end + + # pkg:gem/actionview#lib/action_view/base.rb:165 + def _routes; end + + # pkg:gem/actionview#lib/action_view/base.rb:165 + def _routes=(_arg0); end + + # pkg:gem/actionview#lib/action_view/base.rb:165 + def _routes?; end + + # pkg:gem/actionview#lib/action_view/base.rb:245 + def _run(method, template, locals, buffer, add_to_stack: T.unsafe(nil), has_strict_locals: T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/base.rb:163 + def annotate_rendered_view_with_filenames; end + + # pkg:gem/actionview#lib/action_view/base.rb:163 + def annotate_rendered_view_with_filenames=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:207 + def assign(new_assigns); end + + # pkg:gem/actionview#lib/action_view/base.rb:203 + def assigns; end + + # pkg:gem/actionview#lib/action_view/base.rb:203 + def assigns=(_arg0); end + + # pkg:gem/actionview#lib/action_view/base.rb:160 + def automatically_disable_submit_tag; end + + # pkg:gem/actionview#lib/action_view/base.rb:160 + def automatically_disable_submit_tag=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:270 + def compiled_method_container; end + + # pkg:gem/actionview#lib/action_view/base.rb:203 + def config; end + + # pkg:gem/actionview#lib/action_view/base.rb:203 + def config=(_arg0); end + + # pkg:gem/actionview#lib/action_view/base.rb:142 + def debug_missing_translation; end + + # pkg:gem/actionview#lib/action_view/base.rb:142 + def debug_missing_translation=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:157 + def default_formats; end + + # pkg:gem/actionview#lib/action_view/base.rb:157 + def default_formats=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:145 + def field_error_proc; end + + # pkg:gem/actionview#lib/action_view/base.rb:145 + def field_error_proc=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:205 + def formats(*, **, &); end + + # pkg:gem/actionview#lib/action_view/base.rb:205 + def formats=(arg); end + + # pkg:gem/actionview#lib/action_view/base.rb:278 + def in_rendering_context(options); end + + # pkg:gem/actionview#lib/action_view/base.rb:205 + def locale(*, **, &); end + + # pkg:gem/actionview#lib/action_view/base.rb:205 + def locale=(arg); end + + # pkg:gem/actionview#lib/action_view/base.rb:166 + def logger; end + + # pkg:gem/actionview#lib/action_view/base.rb:166 + def logger=(_arg0); end + + # pkg:gem/actionview#lib/action_view/base.rb:166 + def logger?; end + + # pkg:gem/actionview#lib/action_view/base.rb:202 + def lookup_context; end + + # pkg:gem/actionview#lib/action_view/base.rb:154 + def prefix_partial_path_with_controller_namespace; end + + # pkg:gem/actionview#lib/action_view/base.rb:154 + def prefix_partial_path_with_controller_namespace=(_arg0); end + + # pkg:gem/actionview#lib/action_view/base.rb:154 + def prefix_partial_path_with_controller_namespace?; end + + # pkg:gem/actionview#lib/action_view/base.rb:149 + def streaming_completion_on_exception; end + + # pkg:gem/actionview#lib/action_view/base.rb:149 + def streaming_completion_on_exception=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:205 + def view_paths(*, **, &); end + + # pkg:gem/actionview#lib/action_view/base.rb:205 + def view_paths=(arg); end + + # pkg:gem/actionview#lib/action_view/base.rb:202 + def view_renderer; end + + class << self + # pkg:gem/actionview#lib/action_view/base.rb:165 + def _routes; end + + # pkg:gem/actionview#lib/action_view/base.rb:165 + def _routes=(value); end + + # pkg:gem/actionview#lib/action_view/base.rb:165 + def _routes?; end + + # pkg:gem/actionview#lib/action_view/base.rb:163 + def annotate_rendered_view_with_filenames; end + + # pkg:gem/actionview#lib/action_view/base.rb:163 + def annotate_rendered_view_with_filenames=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:160 + def automatically_disable_submit_tag; end + + # pkg:gem/actionview#lib/action_view/base.rb:160 + def automatically_disable_submit_tag=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:171 + def cache_template_loading; end + + # pkg:gem/actionview#lib/action_view/base.rb:175 + def cache_template_loading=(value); end + + # pkg:gem/actionview#lib/action_view/base.rb:197 + def changed?(other); end + + # pkg:gem/actionview#lib/action_view/base.rb:142 + def debug_missing_translation; end + + # pkg:gem/actionview#lib/action_view/base.rb:142 + def debug_missing_translation=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:297 + def default_form_builder; end + + # pkg:gem/actionview#lib/action_view/base.rb:297 + def default_form_builder=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:157 + def default_formats; end + + # pkg:gem/actionview#lib/action_view/base.rb:157 + def default_formats=(val); end + + # :stopdoc: + # + # pkg:gem/actionview#lib/action_view/base.rb:214 + def empty; end + + # pkg:gem/actionview#lib/action_view/base.rb:169 + def erb_trim_mode=(arg); end + + # pkg:gem/actionview#lib/action_view/base.rb:145 + def field_error_proc; end + + # pkg:gem/actionview#lib/action_view/base.rb:145 + def field_error_proc=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:166 + def logger; end + + # pkg:gem/actionview#lib/action_view/base.rb:166 + def logger=(value); end + + # pkg:gem/actionview#lib/action_view/base.rb:166 + def logger?; end + + # pkg:gem/actionview#lib/action_view/base.rb:154 + def prefix_partial_path_with_controller_namespace; end + + # pkg:gem/actionview#lib/action_view/base.rb:154 + def prefix_partial_path_with_controller_namespace=(value); end + + # pkg:gem/actionview#lib/action_view/base.rb:154 + def prefix_partial_path_with_controller_namespace?; end + + # pkg:gem/actionview#lib/action_view/base.rb:149 + def streaming_completion_on_exception; end + + # pkg:gem/actionview#lib/action_view/base.rb:149 + def streaming_completion_on_exception=(val); end + + # pkg:gem/actionview#lib/action_view/base.rb:222 + def with_context(context, assigns = T.unsafe(nil), controller = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/base.rb:183 + def with_empty_template_cache; end + + # pkg:gem/actionview#lib/action_view/base.rb:218 + def with_view_paths(view_paths, assigns = T.unsafe(nil), controller = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/base.rb:179 + def xss_safe?; end + end +end + +# pkg:gem/actionview#lib/action_view/cache_expiry.rb:4 +module ActionView::CacheExpiry; end + +# pkg:gem/actionview#lib/action_view/cache_expiry.rb:5 +class ActionView::CacheExpiry::ViewReloader + # pkg:gem/actionview#lib/action_view/cache_expiry.rb:6 + def initialize(watcher:, &block); end + + # pkg:gem/actionview#lib/action_view/cache_expiry.rb:22 + def execute; end + + # pkg:gem/actionview#lib/action_view/cache_expiry.rb:18 + def updated?; end + + private + + # pkg:gem/actionview#lib/action_view/cache_expiry.rb:58 + def all_view_paths; end + + # pkg:gem/actionview#lib/action_view/cache_expiry.rb:54 + def dirs_to_watch; end + + # pkg:gem/actionview#lib/action_view/cache_expiry.rb:36 + def rebuild_watcher; end + + # pkg:gem/actionview#lib/action_view/cache_expiry.rb:32 + def reload!; end +end + +# pkg:gem/actionview#lib/action_view/renderer/partial_renderer/collection_caching.rb:6 +module ActionView::CollectionCaching + extend ::ActiveSupport::Concern + + private + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer/collection_caching.rb:20 + def cache_collection_render(instrumentation_payload, view, template, collection); end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer/collection_caching.rb:54 + def callable_cache_key?; end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer/collection_caching.rb:58 + def collection_by_cache_keys(view, template, collection); end + + # pkg:gem/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. + # + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer/collection_caching.rb:91 + def fetch_or_cache_partial(cached_partials, template, order_by:); end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer/collection_caching.rb:16 + def will_cache?(options, view); end +end + +# pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:33 +class ActionView::CollectionRenderer < ::ActionView::PartialRenderer + include ::ActionView::AbstractRenderer::ObjectRendering + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:130 + def render_collection_derive_partial(collection, context, block); end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:112 + def render_collection_with_partial(collection, partial, context, block); end + + private + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:182 + def collection_with_template(view, template, layout, collection); end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:153 + def render_collection(collection, view, path, template, layout, block); end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:148 + def retrieve_variable(path); end +end + +# pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:36 +class ActionView::CollectionRenderer::CollectionIterator + include ::Enumerable + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:39 + def initialize(collection); end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:43 + def each(&blk); end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:51 + def length; end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:55 + def preload!; end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:47 + def size; end +end + +# pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:100 +class ActionView::CollectionRenderer::MixedCollectionIterator < ::ActionView::CollectionRenderer::CollectionIterator + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:101 + def initialize(collection, paths); end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:106 + def each_with_info; end +end + +# pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:78 +class ActionView::CollectionRenderer::PreloadCollectionIterator < ::ActionView::CollectionRenderer::SameCollectionIterator + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:79 + def initialize(collection, path, variables, relation); end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:89 + def each_with_info; end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:85 + def from_collection(collection); end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:95 + def preload!; end +end + +# pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:60 +class ActionView::CollectionRenderer::SameCollectionIterator < ::ActionView::CollectionRenderer::CollectionIterator + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:61 + def initialize(collection, path, variables); end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:71 + def each_with_info; end + + # pkg:gem/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). +# +# pkg:gem/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. + # + # pkg:gem/actionview#lib/action_view/context.rb:27 + def _layout_for(name = T.unsafe(nil)); end + + # Prepares the context by setting the appropriate instance variables. + # + # pkg:gem/actionview#lib/action_view/context.rb:18 + def _prepare_context; end + + # pkg:gem/actionview#lib/action_view/context.rb:15 + def output_buffer; end + + # pkg:gem/actionview#lib/action_view/context.rb:15 + def output_buffer=(_arg0); end + + # pkg:gem/actionview#lib/action_view/context.rb:15 + def view_flow; end + + # pkg:gem/actionview#lib/action_view/context.rb:15 + def view_flow=(_arg0); end +end + +# pkg:gem/actionview#lib/action_view/dependency_tracker.rb:8 +class ActionView::DependencyTracker + extend ::ActiveSupport::Autoload + + class << self + # pkg:gem/actionview#lib/action_view/dependency_tracker.rb:16 + def find_dependencies(name, template, view_paths = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker.rb:23 + def register_tracker(extension, tracker); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker.rb:34 + def remove_tracker(handler); end + end +end + +# pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:5 +class ActionView::DependencyTracker::ERBTracker + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:72 + def initialize(name, template, view_paths = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:76 + def dependencies; end + + private + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:104 + def add_dependencies(render_dependencies, arguments, pattern); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:112 + def add_dynamic_dependency(dependencies, dependency); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:118 + def add_static_dependency(dependencies, dependency, quote_type); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:88 + def directory; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:145 + def explicit_dependencies; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:80 + def name; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:92 + def render_dependencies; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:133 + def resolve_directories(wildcard_dependencies); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:84 + def source; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:80 + def template; end + + class << self + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:68 + def call(name, template, view_paths = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:64 + def supports_view_paths?; end + end +end + +# pkg:gem/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 +# +# pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:9 +ActionView::DependencyTracker::ERBTracker::IDENTIFIER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/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 +# +# pkg:gem/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 +# +# pkg:gem/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" +# +# pkg:gem/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!" +# +# pkg:gem/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 +# +# pkg:gem/actionview#lib/action_view/dependency_tracker/erb_tracker.rb:16 +ActionView::DependencyTracker::ERBTracker::VARIABLE_OR_METHOD_CHAIN = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionview#lib/action_view/dependency_tracker/ripper_tracker.rb:5 +class ActionView::DependencyTracker::RipperTracker + # pkg:gem/actionview#lib/action_view/dependency_tracker/ripper_tracker.rb:20 + def initialize(name, template, view_paths = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/ripper_tracker.rb:12 + def dependencies; end + + private + + # pkg:gem/actionview#lib/action_view/dependency_tracker/ripper_tracker.rb:38 + def explicit_dependencies; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/ripper_tracker.rb:25 + def name; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/ripper_tracker.rb:27 + def render_dependencies; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/ripper_tracker.rb:46 + def resolve_directories(wildcard_dependencies); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/ripper_tracker.rb:25 + def template; end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/ripper_tracker.rb:25 + def view_paths; end + + class << self + # pkg:gem/actionview#lib/action_view/dependency_tracker/ripper_tracker.rb:8 + def call(name, template, view_paths = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/dependency_tracker/ripper_tracker.rb:16 + def supports_view_paths?; end + end +end + +# pkg:gem/actionview#lib/action_view/dependency_tracker/ripper_tracker.rb:6 +ActionView::DependencyTracker::RipperTracker::EXPLICIT_DEPENDENCY = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/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 + # + # pkg:gem/actionview#lib/action_view/digestor.rb:16 + def digest(name:, finder:, format: T.unsafe(nil), dependencies: T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/digestor.rb:38 + def logger; end + + # Create a dependency tree for template named +name+. + # + # pkg:gem/actionview#lib/action_view/digestor.rb:43 + def tree(name, finder, partial = T.unsafe(nil), seen = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/digestor.rb:71 + def find_template(finder, name, prefixes, partial, keys); end + end +end + +# pkg:gem/actionview#lib/action_view/digestor.rb:121 +class ActionView::Digestor::Injected < ::ActionView::Digestor::Node + # pkg:gem/actionview#lib/action_view/digestor.rb:122 + def digest(finder, _ = T.unsafe(nil)); end +end + +# pkg:gem/actionview#lib/action_view/digestor.rb:117 +class ActionView::Digestor::Missing < ::ActionView::Digestor::Node + # pkg:gem/actionview#lib/action_view/digestor.rb:118 + def digest(finder, _ = T.unsafe(nil)); end +end + +# pkg:gem/actionview#lib/action_view/digestor.rb:78 +class ActionView::Digestor::Node + # pkg:gem/actionview#lib/action_view/digestor.rb:86 + def initialize(name, logical_name, template, children = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/digestor.rb:79 + def children; end + + # pkg:gem/actionview#lib/action_view/digestor.rb:97 + def dependency_digest(finder, stack); end + + # pkg:gem/actionview#lib/action_view/digestor.rb:93 + def digest(finder, stack = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/digestor.rb:79 + def logical_name; end + + # pkg:gem/actionview#lib/action_view/digestor.rb:79 + def name; end + + # pkg:gem/actionview#lib/action_view/digestor.rb:79 + def template; end + + # pkg:gem/actionview#lib/action_view/digestor.rb:110 + def to_dep_map; end + + class << self + # pkg:gem/actionview#lib/action_view/digestor.rb:81 + def create(name, logical_name, template, partial); end + end +end + +# pkg:gem/actionview#lib/action_view/digestor.rb:125 +class ActionView::Digestor::NullLogger + class << self + # pkg:gem/actionview#lib/action_view/digestor.rb:126 + def debug(_); end + + # pkg:gem/actionview#lib/action_view/digestor.rb:127 + def error(_); end + end +end + +# pkg:gem/actionview#lib/action_view/digestor.rb:115 +class ActionView::Digestor::Partial < ::ActionView::Digestor::Node; end + +# pkg:gem/actionview#lib/action_view.rb:35 +ActionView::ENCODING_FLAG = T.let(T.unsafe(nil), String) + +# pkg:gem/actionview#lib/action_view/template/error.rb:11 +class ActionView::EncodingError < ::StandardError; end + +# A resolver that loads files from the filesystem. +# +# pkg:gem/actionview#lib/action_view/template/resolver.rb:93 +class ActionView::FileSystemResolver < ::ActionView::Resolver + # pkg:gem/actionview#lib/action_view/template/resolver.rb:96 + def initialize(path); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:118 + def ==(resolver); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:120 + def all_template_paths; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:129 + def built_templates; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:104 + def clear_cache; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:115 + def eql?(resolver); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:94 + def path; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:113 + def to_path; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:110 + def to_s; end + + private + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:134 + def _find_all(name, prefix, partial, details, key, locals); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:153 + def build_unbound_template(template); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:211 + def escape_entry(entry); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:183 + def filter_and_sort_by_details(templates, requested_details); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:149 + def source_for_template(template); end + + # Safe glob within @path + # + # pkg:gem/actionview#lib/action_view/template/resolver.rb:198 + def template_glob(glob); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:166 + def unbound_templates_from_path(path); end +end + +# pkg:gem/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 + # pkg:gem/actionview#lib/action_view/helpers.rb:35 + def eager_load!; end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:8 +module ActionView::Helpers::ActiveModelHelper; end + +# = Active \Model Instance Tag \Helpers +# +# pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:12 +module ActionView::Helpers::ActiveModelInstanceTag + # pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:20 + def content_tag(type, options, *); end + + # pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:36 + def error_message; end + + # pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:28 + def error_wrapping(html_tag); end + + # pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:13 + def object; end + + # pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:24 + def tag(type, options, *); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:41 + def object_has_errors?; end + + # pkg:gem/actionview#lib/action_view/helpers/active_model_helper.rb:45 + def select_markup_helper?(type); end + + # pkg:gem/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") +# # => +# +# pkg:gem/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 + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:28 + def apply_stylesheet_media_default; end + + # pkg:gem/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) + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:581 + 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"}) + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:259 + def auto_discovery_link_tag(type = T.unsafe(nil), url_options = T.unsafe(nil), tag_options = T.unsafe(nil)); 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' + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:300 + def favicon_link_tag(source = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:26 + def image_decoding; end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:26 + def image_decoding=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:25 + def image_loading; end + + # pkg:gem/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') + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:418 + 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. + # + # 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 + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:111 + 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) + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:479 + 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) + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:343 + def preload_link_tag(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:27 + def preload_links_header; end + + # pkg:gem/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. + # + # ==== 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" + # # => + # # + # + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:193 + 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) + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:549 + def video_tag(*sources); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:622 + def check_for_image_tag_errors(options); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:613 + def extract_dimensions(size); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:586 + def multiple_sources_tag_builder(type, sources); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:603 + def resolve_asset_source(asset_type, source, skip_pipeline); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:628 + def resolve_link_as(extname, mime_type); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:642 + def send_preload_links_header(preload_links, max_header_size: T.unsafe(nil)); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:28 + def apply_stylesheet_media_default; end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:28 + def apply_stylesheet_media_default=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:26 + def image_decoding; end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:26 + def image_decoding=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:25 + def image_loading; end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:25 + def image_loading=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:27 + def preload_links_header; end + + # pkg:gem/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 +# +# pkg:gem/actionview#lib/action_view/helpers/asset_tag_helper.rb:640 +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" +# ) +# +# pkg:gem/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" + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/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). + # + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:333 + def javascript_url(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:219 + def path_to_asset(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:433 + def path_to_audio(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:458 + def path_to_font(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:381 + def path_to_image(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:324 + def path_to_javascript(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:351 + def path_to_stylesheet(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:407 + def path_to_video(source, options = T.unsafe(nil)); end + + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:360 + def stylesheet_url(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:234 + def url_to_asset(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:445 + def url_to_audio(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:470 + def url_to_font(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:393 + def url_to_image(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:336 + def url_to_javascript(source, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:363 + def url_to_stylesheet(source, options = T.unsafe(nil)); end + + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:416 + def video_url(source, options = T.unsafe(nil)); end +end + +# aliased to avoid conflicts with an asset_url named route +# +# pkg:gem/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. +# +# pkg:gem/actionview#lib/action_view/helpers/asset_url_helper.rb:254 +ActionView::Helpers::AssetUrlHelper::ASSET_PUBLIC_DIRECTORIES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/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 +# +# pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:8 +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. + # + # pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:98 + def atom_feed(options = T.unsafe(nil), &block); end +end + +# pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:129 +class ActionView::Helpers::AtomFeedHelper::AtomBuilder + # pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:132 + 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. + # + # pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:140 + 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. + # + # pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:155 + def xhtml_block?(method, arguments); end +end + +# pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:130 +ActionView::Helpers::AtomFeedHelper::AtomBuilder::XHTML_TAG_NAMES = T.let(T.unsafe(nil), Set) + +# pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:163 +class ActionView::Helpers::AtomFeedHelper::AtomFeedBuilder < ::ActionView::Helpers::AtomFeedHelper::AtomBuilder + # pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:164 + 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". + # + # pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:182 + 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. + # + # pkg:gem/actionview#lib/action_view/helpers/atom_feed_helper.rb:169 + def updated(date_or_time = T.unsafe(nil)); end +end + +# = Action View Cache \Helpers +# +# pkg:gem/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') + # + # === 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. + # + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:168 + 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. + # + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:240 + 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 %> + # + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:215 + 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 %> + # + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:231 + 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 %> + # + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:188 + def caching?; end + + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:248 + 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 %> + # + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:205 + def uncacheable!; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:270 + def fragment_for(name = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:259 + def fragment_name_with_digest(name, digest_path); end + + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:280 + def read_fragment_for(name, options); end + + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:284 + def write_fragment_for(name, options, &block); end +end + +# pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:289 +module ActionView::Helpers::CacheHelper::CachingRegistry + extend ::ActionView::Helpers::CacheHelper::CachingRegistry + + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:292 + def caching?; end + + # pkg:gem/actionview#lib/action_view/helpers/cache_helper.rb:296 + def track_caching; end +end + +# pkg:gem/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. +# +# pkg:gem/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" + # + # pkg:gem/actionview#lib/action_view/helpers/capture_helper.rb:47 + def capture(*args, &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. + # + # pkg:gem/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 %> + # + # + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/actionview#lib/action_view/helpers/capture_helper.rb:221 + def with_output_buffer(buf = T.unsafe(nil)); end +end + +# pkg:gem/actionview#lib/action_view/helpers/content_exfiltration_prevention_helper.rb:5 +module ActionView::Helpers::ContentExfiltrationPreventionHelper + # pkg:gem/actionview#lib/action_view/helpers/content_exfiltration_prevention_helper.rb:6 + def prepend_content_exfiltration_prevention; end + + # pkg:gem/actionview#lib/action_view/helpers/content_exfiltration_prevention_helper.rb:6 + def prepend_content_exfiltration_prevention=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/content_exfiltration_prevention_helper.rb:61 + def prevent_content_exfiltration(html); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/content_exfiltration_prevention_helper.rb:6 + def prepend_content_exfiltration_prevention; end + + # pkg:gem/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 +# + # + # text_area(:comment, :text, size: "20x30") + # # => + # + # text_area(:application, :notes, cols: 40, rows: 15, class: 'app_input') + # # => + # + # text_area(:entry, :body, size: "20x20", disabled: 'disabled') + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:1275 + 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(:post, :title, size: 20) + # # => + # + # text_field(:post, :title, class: "create_input") + # # => + # + # text_field(:post, :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') + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:1173 + def text_field(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) + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:1475 + def time_field(object_name, method, options = T.unsafe(nil)); end + + # Returns a text_field of type "url". + # + # url_field("user", "homepage") + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:1555 + 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") + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:1546 + def week_field(object_name, method, options = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:464 + def apply_form_for_options!(object, options); end + + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:1620 + def default_form_builder_class; end + + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:1591 + 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 + + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:1606 + def instantiate_builder(record_name, record_object, options); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:480 + def form_with_generates_ids; end + + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:480 + def form_with_generates_ids=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:478 + def form_with_generates_remote_forms; end + + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:478 + def form_with_generates_remote_forms=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:482 + def multiple_file_field_include_hidden; end + + # pkg:gem/actionview#lib/action_view/helpers/form_helper.rb:482 + 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: +# +# +# pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:94 +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_check_boxes(: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_check_boxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| + # b.label { b.check_box } + # 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 check_box also accept + # extra HTML options: + # collection_check_boxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| + # b.label(class: "check_box") { b.check_box(class: "check_box") } + # 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_check_boxes(:post, :author_ids, Author.all, :id, :name_with_initial) do |b| + # b.label(:"data-value" => b.value) { b.check_box + 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. + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:782 + def collection_check_boxes(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.require(:user).permit(...) + # + # 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. + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:698 + def collection_radio_buttons(object, method, collection, value_method, text_method, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # Returns + # + # + # + # + # + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:199 + def collection_select(object, method, collection, value_method, text_method, options = T.unsafe(nil), html_options = T.unsafe(nil)); end + + # Returns + # + # + # + # + # + # + # + # + # + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:258 + 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. + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:462 + 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. + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:358 + 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. + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:401 + 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. + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:159 + 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. + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:579 + 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) + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:292 + 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. + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:611 + 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. + # + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:298 + def weekday_select(object, method, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:809 + def extract_selected_and_disabled(selected); end + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:820 + def extract_values_from_collection(collection, value_method, selected); end + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:787 + def option_html_attributes(element); end + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:795 + def option_text_and_value(option); end + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:805 + def option_value_selected?(value, selected); end + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:834 + def prompt_text(prompt); end + + # pkg:gem/actionview#lib/action_view/helpers/form_options_helper.rb:830 + 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". +# +# pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:19 +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 + # # => + # + # ==== Deprecated: \Rails UJS attributes + # + # Prior to \Rails 7, \Rails shipped with a JavaScript library called @rails/ujs on by default. Following \Rails 7, + # this library is no longer on by default. This library integrated with the following options: + # + # * confirm: 'question?' - If present, the + # unobtrusive JavaScript drivers will provide a prompt with + # the question specified. If the user accepts, the form is + # processed normally, otherwise no action is taken. + # * :disable_with - Value of this parameter will be + # used as the value for a disabled version of the submit + # button when the form is submitted. This feature is provided + # by the unobtrusive JavaScript driver. + # + # button_tag "Save", data: { confirm: "Are you sure?" } + # # => + # + # button_tag "Checkout", data: { disable_with: "Please wait..." } + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:605 + def button_tag(content_or_options = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # :call-seq: + # check_box_tag(name, options = {}) + # check_box_tag(name, value, options = {}) + # check_box_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 + # check_box_tag 'accept' + # # => + # + # check_box_tag 'rock', 'rock music' + # # => + # + # check_box_tag 'receive_email', 'yes', true + # # => + # + # check_box_tag 'tos', 'yes', false, class: 'accept_tos' + # # => + # + # check_box_tag 'eula', 'accepted', false, disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:455 + def check_box_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 + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:703 + 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', '01/01/2014' + # # => + # + # date_field_tag 'date', nil, class: 'special_input' + # # => + # + # date_field_tag 'date', '01/01/2014', class: 'special_input', disabled: true + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:773 + 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). + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:801 + def datetime_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:805 + def datetime_local_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:29 + def default_enforce_utf8; end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:29 + 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 + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:875 + def email_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:26 + def embed_authenticity_token_in_remote_forms; end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:26 + 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). + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:102 + 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) %> + # <%# => %> + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:132 + 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 %> + # # =>

    + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:677 + def field_set_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' + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:347 + 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 + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:78 + 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!')" + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:308 + 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?" }) + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:651 + 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' + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:281 + 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. + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:816 + 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 + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:923 + 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" + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:380 + def password_field_tag(name = T.unsafe(nil), value = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:752 + 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" + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:491 + def radio_button_tag(name, value, *args); end + + # Creates a range form element. + # + # ==== Options + # + # Supports the same options as #number_field_tag. + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:937 + def range_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + # Creates a text field of type "search". + # + # ==== Options + # + # Supports the same options as #text_field_tag. + # + # ==== Examples + # + # search_field_tag 'name' + # # => + # + # 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 + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:726 + 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") + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:201 + 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" + # # => + # + # ==== Deprecated: \Rails UJS attributes + # + # Prior to \Rails 7, \Rails shipped with the JavaScript library called @rails/ujs on by default. Following \Rails 7, + # this library is no longer on by default. This library integrated with the following options: + # + # * confirm: 'question?' - If present the unobtrusive JavaScript + # drivers will provide a prompt with the question specified. If the user accepts, + # the form is processed normally, otherwise no action is taken. + # * :disable_with - Value of this parameter will be used as the value for a + # disabled version of the submit button when the form is submitted. This feature is + # provided by the unobtrusive JavaScript driver. To disable this feature for a single submit tag + # pass :data => { disable_with: false } Defaults to value attribute. + # + # submit_tag "Complete sale", data: { disable_with: "Submitting..." } + # # => + # + # submit_tag "Save", data: { confirm: "Are you sure?" } + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:544 + 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 + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:749 + 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 + # text_area_tag 'post' + # # => + # + # text_area_tag 'bio', @user.bio + # # => + # + # text_area_tag 'body', nil, rows: 10, cols: 25 + # # => + # + # text_area_tag 'body', nil, size: "25x10" + # # => + # + # text_area_tag 'description', "Description goes here.", disabled: true + # # => + # + # text_area_tag 'comment', nil, class: 'comment_input' + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:413 + 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" + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:263 + def text_field_tag(name, value = 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). + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:787 + 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 + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:852 + 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. + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:943 + 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. + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:829 + def week_field_tag(name, value = T.unsafe(nil), options = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:1040 + def convert_direct_upload_option_to_url(options); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:978 + def extra_tags_for_form(html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:1008 + def form_tag_html(html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:1014 + def form_tag_with_body(html_options, content); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:951 + def html_options_for_form(url_for_options, options); end + + # see http://www.w3.org/TR/html4/types.html#type-name + # + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:1021 + def sanitize_to_id(name); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:1025 + def set_default_disable_with(value, tag_options); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:29 + def default_enforce_utf8; end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:29 + def default_enforce_utf8=(val); end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:26 + def embed_authenticity_token_in_remote_forms; end + + # pkg:gem/actionview#lib/action_view/helpers/form_tag_helper.rb:26 + def embed_authenticity_token_in_remote_forms=(val); end + end +end + +# = Action View JavaScript \Helpers +# +# pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:6 +module ActionView::Helpers::JavaScriptHelper + # 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' %>'); + # + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:28 + def escape_javascript(javascript); end + + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:38 + def j(javascript); end + + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:91 + 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 -%> + # + # pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:75 + def javascript_tag(content_or_options_with_block = T.unsafe(nil), html_options = T.unsafe(nil), &block); end +end + +# pkg:gem/actionview#lib/action_view/helpers/javascript_helper.rb:7 +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. +# +# pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:17 +module ActionView::Helpers::NumberHelper + # Delegates to ActiveSupport::NumberHelper#number_to_currency. + # + # 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 + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:51 + def number_to_currency(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_human. + # + # 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 + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:111 + def number_to_human(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_human_size. + # + # 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 + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:99 + def number_to_human_size(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_percentage. + # + # 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 + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:63 + def number_to_percentage(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_phone. + # + # 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 + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:35 + def number_to_phone(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_delimited. + # + # 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 + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:75 + def number_with_delimiter(number, options = T.unsafe(nil)); end + + # Delegates to ActiveSupport::NumberHelper#number_to_rounded. + # + # 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 + # + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:87 + def number_with_precision(number, options = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:116 + def delegate_number_helper_method(method, number, options); end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:135 + def escape_units(units); end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:125 + def escape_unsafe_options(options); end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:158 + def parse_float(number, raise_error); end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:154 + def valid_float?(number); end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:141 + 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+. +# +# pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:20 +class ActionView::Helpers::NumberHelper::InvalidNumberError < ::StandardError + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:22 + def initialize(number); end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:21 + def number; end + + # pkg:gem/actionview#lib/action_view/helpers/number_helper.rb:21 + def number=(_arg0); end +end + +# = Action View Raw Output \Helpers +# +# pkg:gem/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' + # + # pkg:gem/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([raw("

    foo

    "), "

    bar

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

    foo

    <br /><p>bar</p>" + # + # safe_join([raw("

    foo

    "), raw("

    bar

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

    foo


    bar

    " + # + # pkg:gem/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}[https://api.rubyonrails.org/classes/Array.html#method-i-to_sentence]. + # + # pkg:gem/actionview#lib/action_view/helpers/output_safety_helper.rb:43 + 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. +# +# pkg:gem/actionview#lib/action_view/helpers/rendering_helper.rb:10 +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 + # + # + # pkg:gem/actionview#lib/action_view/helpers/rendering_helper.rb:97 + def _layout_for(*args, &block); end + + # Returns the result of a render that's dictated by the options hash. The primary options are: + # + # * :partial - See ActionView::PartialRenderer. + # * :file - Renders an explicit template file (this used to be the old default), add +:locals+ to pass in those. + # * :inline - Renders an inline template similar to how it's done in the controller. + # * :plain - Renders the text passed in out. Setting the content + # type as text/plain. + # * :html - Renders the HTML safe string passed in out, otherwise + # performs HTML escape on the string first. Setting the content type as + # text/html. + # * :body - Renders the text passed in, and inherits the content + # type of text/plain from ActionDispatch::Response object. + # + # If no options hash is passed or if :update is specified, then: + # + # If an object responding to +render_in+ is passed, +render_in+ is called on the object, + # passing in the current view context. + # + # Otherwise, a partial is rendered using the second parameter as the locals hash. + # + # pkg:gem/actionview#lib/action_view/helpers/rendering_helper.rb:30 + 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. +# +# pkg:gem/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. + # + # 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+. + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:111 + def sanitize(html, options = T.unsafe(nil)); end + + # Sanitizes a block of CSS code. Used by #sanitize when it comes across a style attribute. + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:116 + def sanitize_css(style); end + + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:12 + def sanitizer_vendor; end + + # pkg:gem/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 + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:150 + 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 + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:133 + def strip_tags(html); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:12 + def sanitizer_vendor; end + + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:12 + def sanitizer_vendor=(val); end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:154 +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 + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:175 + def full_sanitizer; end + + # 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 + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:155 + 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 + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:185 + def link_sanitizer; 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 + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:155 + 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 + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:195 + def safe_list_sanitizer; 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 + # + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:155 + def safe_list_sanitizer=(_arg0); end + + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:165 + def sanitized_allowed_attributes; end + + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:161 + def sanitized_allowed_tags; end + + # pkg:gem/actionview#lib/action_view/helpers/sanitize_helper.rb:157 + 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. +# +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:15 +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]]> + # + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:386 + def cdata_section(content); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:371 + 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!
    + # + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:346 + 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" + # + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:398 + 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 # =>
    + # + # === 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? }) + # # =>
    + # + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:309 + 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" + # + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:366 + def token_list(*args); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:403 + def build_tag_values(*args); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:423 + def tag_builder; end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:421 + def build_tag_values(*args); end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:32 +ActionView::Helpers::TagHelper::ARIA_PREFIXES = T.let(T.unsafe(nil), Set) + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:19 +ActionView::Helpers::TagHelper::BOOLEAN_ATTRIBUTES = T.let(T.unsafe(nil), Set) + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:33 +ActionView::Helpers::TagHelper::DATA_PREFIXES = T.let(T.unsafe(nil), Set) + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:41 +ActionView::Helpers::TagHelper::PRE_CONTENT_STRINGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:35 +ActionView::Helpers::TagHelper::TAG_TYPES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:45 +class ActionView::Helpers::TagHelper::TagBuilder + include ::ActionView::Helpers::CaptureHelper + include ::ActionView::Helpers::OutputSafetyHelper + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:52 + def initialize(view_context); end + + # Transforms a Hash into HTML Attributes, ready to be interpolated into + # ERB. + # + # > + # # => + # + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:61 + def attributes(attributes); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:132 + def boolean_tag_option(key); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:79 + def content_tag_string(name, content, options, escape = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:65 + def p(*arguments, **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:136 + def tag_option(key, value, escape); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:90 + def tag_options(options, escape = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:69 + def tag_string(name, content = T.unsafe(nil), escape: T.unsafe(nil), **options, &block); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:166 + def method_missing(called, *args, **options, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:154 + def prefix_tag_option(prefix, key, value, escape); end + + # pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:162 + def respond_to_missing?(*args); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:49 +ActionView::Helpers::TagHelper::TagBuilder::HTML_VOID_ELEMENTS = T.let(T.unsafe(nil), Set) + +# pkg:gem/actionview#lib/action_view/helpers/tag_helper.rb:50 +ActionView::Helpers::TagHelper::TagBuilder::SVG_SELF_CLOSING_ELEMENTS = T.let(T.unsafe(nil), Set) + +# pkg:gem/actionview#lib/action_view/helpers/tags.rb:5 +module ActionView::Helpers::Tags + extend ::ActiveSupport::Autoload +end + +# pkg:gem/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 + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:11 + def initialize(object_name, method_name, template_object, options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:9 + def object; end + + # This is what child classes implement. + # + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:31 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:96 + def add_default_name_and_id(options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:83 + def add_default_name_and_id_for_value(tag_value, options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:132 + def generate_ids?; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:124 + def name_and_id_index(options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:74 + def retrieve_autoindex(pre_match); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:63 + def retrieve_object(object); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:116 + def sanitized_method_name; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:120 + def sanitized_value(value); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:112 + def tag_id(index = T.unsafe(nil), namespace = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:108 + def tag_name(multiple = T.unsafe(nil), index = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:36 + def value; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:46 + def value_before_type_cast; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/base.rb:58 + def value_came_from_user?; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/check_box.rb:8 +class ActionView::Helpers::Tags::CheckBox < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Checkable + + # pkg:gem/actionview#lib/action_view/helpers/tags/check_box.rb:11 + def initialize(object_name, method_name, template_object, checked_value, unchecked_value, options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/check_box.rb:17 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/check_box.rb:42 + def checked?(value); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/check_box.rb:59 + def hidden_field_for_checkbox(options); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/checkable.rb:6 +module ActionView::Helpers::Tags::Checkable + # pkg:gem/actionview#lib/action_view/helpers/tags/checkable.rb:7 + def input_checked?(options); end +end + +# pkg:gem/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 + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:21 + def render(&block); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:30 + def hidden_field_name; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:26 + def render_component(builder); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:12 +class ActionView::Helpers::Tags::CollectionCheckBoxes::CheckBoxBuilder < ::ActionView::Helpers::Tags::CollectionHelpers::Builder + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_check_boxes.rb:13 + def check_box(extra_html_options = T.unsafe(nil)); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:6 +module ActionView::Helpers::Tags::CollectionHelpers + # pkg:gem/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. + # + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:47 + def default_html_options_for_collection(item, value); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:107 + def hidden_field; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:112 + def hidden_field_name; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:40 + def instantiate_builder(builder_class, item, value, text, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:75 + def render_collection; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:86 + def render_collection_for(builder_class, &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:71 + def sanitize_attribute_name(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:7 +class ActionView::Helpers::Tags::CollectionHelpers::Builder + # pkg:gem/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 + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:22 + def label(label_html_options = T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:8 + def object; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:8 + def text; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_helpers.rb:8 + def value; end +end + +# pkg:gem/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 + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_radio_buttons.rb:20 + def render(&block); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_radio_buttons.rb:25 + def render_component(builder); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/collection_radio_buttons.rb:12 +class ActionView::Helpers::Tags::CollectionRadioButtons::RadioButtonBuilder < ::ActionView::Helpers::Tags::CollectionHelpers::Builder + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_radio_buttons.rb:13 + def radio_button(extra_html_options = T.unsafe(nil)); end +end + +# pkg:gem/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 + + # pkg:gem/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 + + # pkg:gem/actionview#lib/action_view/helpers/tags/collection_select.rb:19 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/color_field.rb:6 +class ActionView::Helpers::Tags::ColorField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/color_field.rb:7 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/color_field.rb:15 + def validate_color_string(string); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/date_field.rb:6 +class ActionView::Helpers::Tags::DateField < ::ActionView::Helpers::Tags::DatetimeField + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/date_field.rb:8 + def format_datetime(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:8 +class ActionView::Helpers::Tags::DateSelect < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::SelectRenderer + + # pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:11 + def initialize(object_name, method_name, template_object, options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:17 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:32 + def datetime_selector(options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:45 + def default_datetime(options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:28 + def select_type; end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/tags/date_select.rb:22 + def select_type; end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/datetime_field.rb:6 +class ActionView::Helpers::Tags::DatetimeField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_field.rb:7 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_field.rb:17 + def datetime_value(value); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_field.rb:25 + def format_datetime(value); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_field.rb:29 + def parse_datetime(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/datetime_local_field.rb:6 +class ActionView::Helpers::Tags::DatetimeLocalField < ::ActionView::Helpers::Tags::DatetimeField + # pkg:gem/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 + + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_local_field.rb:19 + def format_datetime(value); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/tags/datetime_local_field.rb:13 + def field_type; end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/datetime_select.rb:6 +class ActionView::Helpers::Tags::DatetimeSelect < ::ActionView::Helpers::Tags::DateSelect; end + +# pkg:gem/actionview#lib/action_view/helpers/tags/email_field.rb:6 +class ActionView::Helpers::Tags::EmailField < ::ActionView::Helpers::Tags::TextField; end + +# pkg:gem/actionview#lib/action_view/helpers/tags/file_field.rb:6 +class ActionView::Helpers::Tags::FileField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/file_field.rb:7 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/file_field.rb:20 + def hidden_field_for_multiple_file(options); end +end + +# pkg:gem/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 + + # pkg:gem/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 + + # pkg:gem/actionview#lib/action_view/helpers/tags/grouped_collection_select.rb:21 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/hidden_field.rb:6 +class ActionView::Helpers::Tags::HiddenField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/hidden_field.rb:7 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:6 +class ActionView::Helpers::Tags::Label < ::ActionView::Helpers::Tags::Base + # pkg:gem/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 + + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:48 + def render(&block); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:78 + def render_component(builder); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:7 +class ActionView::Helpers::Tags::Label::LabelBuilder + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:10 + def initialize(template_object, object_name, method_name, object, tag_value); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:8 + def object; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:29 + def to_s; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/label.rb:18 + def translation; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/month_field.rb:6 +class ActionView::Helpers::Tags::MonthField < ::ActionView::Helpers::Tags::DatetimeField + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/month_field.rb:8 + def format_datetime(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/number_field.rb:6 +class ActionView::Helpers::Tags::NumberField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/number_field.rb:7 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/password_field.rb:6 +class ActionView::Helpers::Tags::PasswordField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/password_field.rb:7 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/placeholderable.rb:6 +module ActionView::Helpers::Tags::Placeholderable + # pkg:gem/actionview#lib/action_view/helpers/tags/placeholderable.rb:7 + def initialize(*); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/radio_button.rb:8 +class ActionView::Helpers::Tags::RadioButton < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Checkable + + # pkg:gem/actionview#lib/action_view/helpers/tags/radio_button.rb:11 + def initialize(object_name, method_name, template_object, tag_value, options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/radio_button.rb:16 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/radio_button.rb:26 + def checked?(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/range_field.rb:6 +class ActionView::Helpers::Tags::RangeField < ::ActionView::Helpers::Tags::NumberField; end + +# pkg:gem/actionview#lib/action_view/helpers/tags/search_field.rb:6 +class ActionView::Helpers::Tags::SearchField < ::ActionView::Helpers::Tags::TextField + # pkg:gem/actionview#lib/action_view/helpers/tags/search_field.rb:7 + def render; end +end + +# pkg:gem/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 + + # pkg:gem/actionview#lib/action_view/helpers/tags/select.rb:10 + def initialize(object_name, method_name, template_object, choices, options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/select.rb:19 + def render; end + + private + + # Grouped choices look like this: + # + # [nil, []] + # { nil => [] } + # + # pkg:gem/actionview#lib/action_view/helpers/tags/select.rb:39 + def grouped_choices?; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/select_renderer.rb:6 +module ActionView::Helpers::Tags::SelectRenderer + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/select_renderer.rb:36 + def add_options(option_tags, options, value = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/select_renderer.rb:31 + def placeholder_required?(html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/select_renderer.rb:8 + def select_content_tag(option_tags, options, html_options); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/tel_field.rb:6 +class ActionView::Helpers::Tags::TelField < ::ActionView::Helpers::Tags::TextField; end + +# pkg:gem/actionview#lib/action_view/helpers/tags/text_area.rb:8 +class ActionView::Helpers::Tags::TextArea < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Placeholderable + + # pkg:gem/actionview#lib/action_view/helpers/tags/text_area.rb:11 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/text_field.rb:8 +class ActionView::Helpers::Tags::TextField < ::ActionView::Helpers::Tags::Base + include ::ActionView::Helpers::Tags::Placeholderable + + # pkg:gem/actionview#lib/action_view/helpers/tags/text_field.rb:11 + def render; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/text_field.rb:27 + def field_type; end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/tags/text_field.rb:21 + def field_type; end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/time_field.rb:6 +class ActionView::Helpers::Tags::TimeField < ::ActionView::Helpers::Tags::DatetimeField + # pkg:gem/actionview#lib/action_view/helpers/tags/time_field.rb:7 + def initialize(object_name, method_name, template_object, options = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/time_field.rb:13 + def format_datetime(value); end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/time_select.rb:6 +class ActionView::Helpers::Tags::TimeSelect < ::ActionView::Helpers::Tags::DateSelect; end + +# pkg:gem/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 + + # pkg:gem/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 + + # pkg:gem/actionview#lib/action_view/helpers/tags/time_zone_select.rb:17 + def render; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:6 +class ActionView::Helpers::Tags::Translator + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:7 + def initialize(object, object_name, method_and_value, scope:); end + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:14 + def translate; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:31 + def human_attribute_name; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:22 + def i18n_default; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:20 + def method_and_value; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:20 + def model; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:20 + def object_name; end + + # pkg:gem/actionview#lib/action_view/helpers/tags/translator.rb:20 + def scope; end +end + +# pkg:gem/actionview#lib/action_view/helpers/tags/url_field.rb:6 +class ActionView::Helpers::Tags::UrlField < ::ActionView::Helpers::Tags::TextField; end + +# pkg:gem/actionview#lib/action_view/helpers/tags/week_field.rb:6 +class ActionView::Helpers::Tags::WeekField < ::ActionView::Helpers::Tags::DatetimeField + private + + # pkg:gem/actionview#lib/action_view/helpers/tags/week_field.rb:8 + def format_datetime(value); end +end + +# pkg:gem/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 + + # pkg:gem/actionview#lib/action_view/helpers/tags/weekday_select.rb:10 + def initialize(object_name, method_name, template_object, options, html_options); end + + # pkg:gem/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>

    " +# +# pkg:gem/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 %> + # + # pkg:gem/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 %> + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:454 + 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 %> + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:430 + 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..." + # + # pkg:gem/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, match)) } + # # => "You searched for: rails" + # + # highlight('ruby on rails', 'rails', sanitize: false) + # # => "ruby on rails" + # + # pkg:gem/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" + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:290 + 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 %> + #
    + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:477 + def reset_cycle(name = T.unsafe(nil)); end + + # pkg:gem/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

    " + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:376 + 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" + # + # pkg:gem/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" + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:320 + def word_wrap(text, line_width: T.unsafe(nil), break_sequence: T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:540 + 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. + # + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:522 + def get_cycle(name); end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:527 + def set_cycle(name, cycle_object); end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:532 + def split_paragraphs(text); end +end + +# pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:482 +class ActionView::Helpers::TextHelper::Cycle + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:485 + def initialize(first_value, *values); end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:494 + def current_value; end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:490 + def reset; end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:498 + def to_s; end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:483 + def values; end + + private + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:505 + def next_index; end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:509 + def previous_index; end + + # pkg:gem/actionview#lib/action_view/helpers/text_helper.rb:513 + def step_index(n); end +end + +# = Action View Translation \Helpers +# +# pkg:gem/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 + + # pkg:gem/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. + # + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:116 + def localize(object, **options); end + + # pkg:gem/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. + # + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:73 + def translate(key, **options); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:142 + def missing_translation(key, options); end + + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:128 + def scope_key_by_partial(key); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:15 + def raise_on_missing_translations; end + + # pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:15 + def raise_on_missing_translations=(_arg0); end + end +end + +# pkg:gem/actionview#lib/action_view/helpers/translation_helper.rb:122 +ActionView::Helpers::TranslationHelper::MISSING_TRANSLATION = T.let(T.unsafe(nil), Integer) + +# pkg:gem/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. +# +# pkg:gem/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. You can specify a different + # HTTP verb via 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" } %> + # # => "
    + # # + # # + # #
    " + # + # ==== Deprecated: \Rails UJS Attributes + # + # Prior to \Rails 7, \Rails shipped with a JavaScript library called @rails/ujs on by default. Following \Rails 7, + # this library is no longer on by default. This library integrated with the following options: + # + # * :remote - If set to true, will allow @rails/ujs to control the + # submit behavior. By default this behavior is an Ajax submit. + # + # @rails/ujs also integrated with the following +:data+ options: + # + # * confirm: "question?" - This will allow @rails/ujs + # to prompt with the question specified (in this case, the + # resulting text would be question?). If the user accepts, the + # button is processed normally, otherwise no action is taken. + # * :disable_with - Value of this parameter will be + # used as the value for a disabled version of the submit + # button when the form is submitted. + # + # ===== \Rails UJS Examples + # + # <%= button_to "Create", { action: "create" }, remote: true, form: { "data-type" => "json" } %> + # # => "
    + # # + # # + # #
    " + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:357 + def button_to(name = T.unsafe(nil), options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:35 + def button_to_generates_button_tag; end + + # pkg:gem/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 + # + # Let's say we're in the http://www.example.com/products action with method POST in case of invalid product. + # + # current_page?(controller: 'product', action: 'index') + # # => false + # + # We can also pass in the symbol arguments instead of strings. + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:609 + def current_page?(options = T.unsafe(nil), check_parameters: 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 + # + # ==== Deprecated: \Rails UJS Attributes + # + # Prior to \Rails 7, \Rails shipped with a JavaScript library called @rails/ujs on by default. Following \Rails 7, + # this library is no longer on by default. This library integrated with the following options: + # + # * method: symbol of HTTP verb - This modifier will dynamically + # create an HTML form and immediately submit the form for processing using + # the HTTP verb specified. Useful for having links perform a POST operation + # in dangerous actions like deleting a record (which search bots can follow + # while spidering your site). Supported verbs are :post, :delete, :patch, and :put. + # Note that if the user has JavaScript disabled, the request will fall back + # to using GET. If href: '#' is used and the user has JavaScript + # disabled clicking the link will have no effect. If you are relying on the + # POST behavior, you should check for it in your controller's action by using + # the request object's methods for post?, delete?, patch?, or put?. + # * remote: true - This will allow @rails/ujs + # to make an Ajax request to the URL in question instead of following + # the link. + # + # @rails/ujs also integrated with the following +:data+ options: + # + # * confirm: "question?" - This will allow @rails/ujs + # to prompt with the question specified (in this case, the + # resulting text would be question?). If the user accepts, the + # link is processed normally, otherwise no action is taken. + # * :disable_with - Value of this parameter will be used as the + # name for a disabled version of the link. + # + # ===== \Rails UJS Examples + # + # link_to "Remove Profile", profile_path(@profile), method: :delete + # # => Remove Profile + # + # link_to "Visit Other Site", "http://www.rubyonrails.org/", data: { confirm: "Are you sure?" } + # # => Visit Other Site + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:234 + 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 + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:498 + 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 + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:475 + 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 + # %> + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:451 + 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 + # + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:548 + 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: + # + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:743 + 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: + # + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:692 + 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 + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:38 + def url_for(options = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:50 + def _back_url; end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:55 + def _filtered_referrer; end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:786 + def add_method_to_attributes!(html_options, method); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:757 + def convert_options_to_data_attributes(options, html_options); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:780 + def link_to_remote_options?(options); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:797 + def method_for_options(options); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:815 + def method_not_get_method?(method); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:834 + def method_tag(method); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:880 + 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'}] + # + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:854 + def to_form_params(attribute, namespace = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:820 + def token_tag(token = T.unsafe(nil), form_options: T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:772 + def url_target(name, options); end + + class << self + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:35 + def button_to_generates_button_tag; end + + # pkg:gem/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. +# +# pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:23 +ActionView::Helpers::UrlHelper::BUTTON_TAG_METHOD_VERBS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:29 +module ActionView::Helpers::UrlHelper::ClassMethods + # pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:30 + def _url_for_modules; end +end + +# pkg:gem/actionview#lib/action_view/helpers/url_helper.rb:807 +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. +# +# pkg:gem/actionview#lib/action_view/rendering.rb:8 +class ActionView::I18nProxy < ::I18n::Config + # pkg:gem/actionview#lib/action_view/rendering.rb:11 + def initialize(original_config, lookup_context); end + + # pkg:gem/actionview#lib/action_view/rendering.rb:17 + def locale; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:21 + def locale=(value); end + + # pkg:gem/actionview#lib/action_view/rendering.rb:9 + def lookup_context; end + + # pkg:gem/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. +# +# pkg:gem/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 + + # pkg:gem/actionview#lib/action_view/layouts.rb:363 + def initialize(*); end + + # pkg:gem/actionview#lib/action_view/layouts.rb:352 + def _normalize_options(options); end + + # pkg:gem/actionview#lib/action_view/layouts.rb:361 + 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. + # + # pkg:gem/actionview#lib/action_view/layouts.rb:374 + def action_has_layout?; end + + private + + # pkg:gem/actionview#lib/action_view/layouts.rb:379 + 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+) + # + # pkg:gem/actionview#lib/action_view/layouts.rb:417 + def _default_layout(lookup_context, formats, require_layout = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/layouts.rb:432 + def _include_layout?(options); end + + # This will be overwritten by _write_layout_method + # + # pkg:gem/actionview#lib/action_view/layouts.rb:384 + def _layout(*); end + + # Determine the layout for a given name, taking into account the name type. + # + # ==== Parameters + # * name - The name of the template + # + # pkg:gem/actionview#lib/action_view/layouts.rb:390 + def _layout_for_option(name); end + + # pkg:gem/actionview#lib/action_view/layouts.rb:403 + 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; end +end + +# pkg:gem/actionview#lib/action_view/layouts.rb:219 +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. + # + # pkg:gem/actionview#lib/action_view/layouts.rb:285 + def _write_layout_method; end + + # pkg:gem/actionview#lib/action_view/layouts.rb:220 + 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. + # + # pkg:gem/actionview#lib/action_view/layouts.rb:271 + 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 + # + # pkg:gem/actionview#lib/action_view/layouts.rb:347 + 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 +# +# pkg:gem/actionview#lib/action_view/layouts.rb:227 +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. + # + # pkg:gem/actionview#lib/action_view/layouts.rb:235 + def _conditional_layout?; end +end + +# = Action View Log Subscriber +# +# Provides functionality so that \Rails can output logs from Action View. +# +# pkg:gem/actionview#lib/action_view/log_subscriber.rb:9 +class ActionView::LogSubscriber < ::ActiveSupport::LogSubscriber + include ::ActionView::LogSubscriber::Utils + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:12 + def initialize; end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:45 + def render_collection(event); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:37 + def render_layout(event); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:26 + def render_partial(event); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:17 + def render_template(event); end + + private + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:117 + def cache_message(payload); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:109 + def render_count(payload); end + + class << self + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:101 + def attach_to(*); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:24 + def log_levels; end + end +end + +# pkg:gem/actionview#lib/action_view/log_subscriber.rb:76 +class ActionView::LogSubscriber::Start + include ::ActionView::LogSubscriber::Utils + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:97 + def finish(name, id, payload); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:79 + def start(name, id, payload); end +end + +# pkg:gem/actionview#lib/action_view/log_subscriber.rb:57 +module ActionView::LogSubscriber::Utils + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:58 + def logger; end + + private + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:63 + def from_rails_root(string); end + + # pkg:gem/actionview#lib/action_view/log_subscriber.rb:69 + def rails_root; end +end + +# pkg:gem/actionview#lib/action_view/log_subscriber.rb:10 +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. +# +# pkg:gem/actionview#lib/action_view/lookup_context.rb:15 +class ActionView::LookupContext + include ::ActionView::LookupContext::Accessors + include ::ActionView::LookupContext::DetailsCache + include ::ActionView::LookupContext::ViewPaths + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:232 + def initialize(view_paths, details = T.unsafe(nil), prefixes = T.unsafe(nil)); end + + # pkg:gem/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. + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:263 + def formats=(values); end + + # Override locale to return a symbol instead of array. + # + # pkg:gem/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. + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:290 + def locale=(value); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:16 + def prefixes; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:16 + def prefixes=(_arg0); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:246 + def with_prepended_formats(formats); end + + private + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:253 + def initialize_details(target, details); end + + class << self + # pkg:gem/actionview#lib/action_view/lookup_context.rb:21 + def register_detail(name, &block); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:18 + def registered_details; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:18 + def registered_details=(_arg0); end + end +end + +# Holds accessors for the registered details. +# +# pkg:gem/actionview#lib/action_view/lookup_context.rb:39 +module ActionView::LookupContext::Accessors + # pkg:gem/actionview#lib/action_view/lookup_context.rb:25 + def default_formats; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:25 + def default_handlers; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:25 + def default_locale; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:25 + def default_variants; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def formats; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def formats=(value); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def handlers; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def handlers=(value); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def locale; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def locale=(value); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def variants; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:26 + def variants=(value); end +end + +# pkg:gem/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. +# +# pkg:gem/actionview#lib/action_view/lookup_context.rb:98 +module ActionView::LookupContext::DetailsCache + # pkg:gem/actionview#lib/action_view/lookup_context.rb:99 + def cache; end + + # pkg:gem/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. + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:103 + def details_key; end + + # Temporary skip passing the details_key forward. + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:108 + def disable_cache; end + + private + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:116 + def _set_detail(key, value); end +end + +# pkg:gem/actionview#lib/action_view/lookup_context.rb:54 +class ActionView::LookupContext::DetailsKey + # pkg:gem/actionview#lib/action_view/lookup_context.rb:55 + def eql?(_arg0); end + + class << self + # pkg:gem/actionview#lib/action_view/lookup_context.rb:77 + def clear; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:65 + def details_cache_key(details); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:61 + def digest_cache(details); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:86 + def digest_caches; end + + # pkg:gem/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. +# +# pkg:gem/actionview#lib/action_view/lookup_context.rb:125 +module ActionView::LookupContext::ViewPaths + # pkg:gem/actionview#lib/action_view/lookup_context.rb:148 + def any?(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:153 + def any_templates?(name, prefixes = T.unsafe(nil), partial = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:155 + def append_view_paths(paths); end + + # pkg:gem/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 + + # pkg:gem/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 + + # pkg:gem/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 + + # pkg:gem/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 + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:126 + def html_fallback_for_js; end + + # pkg:gem/actionview#lib/action_view/lookup_context.rb:159 + def prepend_view_paths(paths); end + + # pkg:gem/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 + + # pkg:gem/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. + # + # pkg:gem/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). + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:175 + def detail_args_for(options); end + + # pkg:gem/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 + # + # pkg:gem/actionview#lib/action_view/lookup_context.rb:209 + def normalize_name(name, prefixes); end +end + +# pkg:gem/actionview#lib/action_view/template/error.rb:30 +class ActionView::MissingTemplate < ::ActionView::ActionViewError + include ::DidYouMean::Correctable + + # pkg:gem/actionview#lib/action_view/template/error.rb:33 + def initialize(paths, path, prefixes, partial, details, *); 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. + # + # pkg:gem/actionview#lib/action_view/template/error.rb:93 + def corrections; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:31 + def partial; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:31 + def path; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:31 + def paths; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:31 + def prefixes; end +end + +# pkg:gem/actionview#lib/action_view/template/error.rb:60 +class ActionView::MissingTemplate::Results + # pkg:gem/actionview#lib/action_view/template/error.rb:63 + def initialize(size); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:80 + def add(path, score); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:72 + def should_record?(score); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:68 + def to_a; end +end + +# pkg:gem/actionview#lib/action_view/template/error.rb:61 +class ActionView::MissingTemplate::Results::Result < ::Struct + # pkg:gem/actionview#lib/action_view/template/error.rb:61 + def path; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:61 + def path=(_); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:61 + def score; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:61 + def score=(_); end + + class << self + # pkg:gem/actionview#lib/action_view/template/error.rb:61 + def [](*_arg0); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:61 + def inspect; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:61 + def keyword_init?; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:61 + def members; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:61 + def new(*_arg0); end + end +end + +# pkg:gem/actionview#lib/action_view/model_naming.rb:4 +module ActionView::ModelNaming + # Converts the given object to an Active Model compliant one. + # + # pkg:gem/actionview#lib/action_view/model_naming.rb:6 + def convert_to_model(object); end + + # pkg:gem/actionview#lib/action_view/model_naming.rb:10 + def model_name_from_record_or_class(record_or_class); end +end + +# pkg:gem/actionview#lib/action_view/renderer/object_renderer.rb:4 +class ActionView::ObjectRenderer < ::ActionView::PartialRenderer + include ::ActionView::AbstractRenderer::ObjectRendering + + # pkg:gem/actionview#lib/action_view/renderer/object_renderer.rb:7 + def initialize(lookup_context, options); end + + # pkg:gem/actionview#lib/action_view/renderer/object_renderer.rb:19 + def render_object_derive_partial(object, context, block); end + + # pkg:gem/actionview#lib/action_view/renderer/object_renderer.rb:13 + def render_object_with_partial(object, partial, context, block); end + + private + + # pkg:gem/actionview#lib/action_view/renderer/object_renderer.rb:29 + def render_partial_template(view, locals, template, layout, block); end + + # pkg:gem/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" +# +# pkg:gem/actionview#lib/action_view/buffers.rb:21 +class ActionView::OutputBuffer + # pkg:gem/actionview#lib/action_view/buffers.rb:22 + def initialize(buffer = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:42 + def <<(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:81 + def ==(other); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:54 + def append=(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def blank?(*, **, &); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:72 + def capture(*args); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:53 + def concat(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def empty?(*, **, &); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def encode!(*, **, &); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def encoding(*, **, &); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def force_encoding(*, **, &); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:32 + def html_safe; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:38 + def html_safe?; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:27 + def length(*, **, &); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:85 + def raw; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:89 + def raw_buffer; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:60 + def safe_append=(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:56 + def safe_concat(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:62 + def safe_expr_append=(val); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:29 + def to_s; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:34 + def to_str; end + + private + + # pkg:gem/actionview#lib/action_view/buffers.rb:68 + def initialize_copy(other); end +end + +# pkg:gem/actionview#lib/action_view/flows.rb:6 +class ActionView::OutputFlow + # pkg:gem/actionview#lib/action_view/flows.rb:9 + def initialize; end + + # Called by content_for + # + # pkg:gem/actionview#lib/action_view/flows.rb:24 + def append(key, value); end + + # pkg:gem/actionview#lib/action_view/flows.rb:27 + def append!(key, value); end + + # pkg:gem/actionview#lib/action_view/flows.rb:7 + def content; end + + # Called by _layout_for to read stored values. + # + # pkg:gem/actionview#lib/action_view/flows.rb:14 + def get(key); end + + # Called by each renderer object to set the layout contents. + # + # pkg:gem/actionview#lib/action_view/flows.rb:19 + def set(key, value); end +end + +# pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:6 +class ActionView::PartialIteration + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:13 + def initialize(size); end + + # Check if this is the first iteration of the partial. + # + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:19 + def first?; end + + # The current iteration of the partial. + # + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:11 + def index; end + + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:28 + def iterate!; end + + # Check if this is the last iteration of the partial. + # + # pkg:gem/actionview#lib/action_view/renderer/collection_renderer.rb:24 + def last?; end + + # The number of iterations that will be done by the partial. + # + # pkg:gem/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 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. +# +# pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:220 +class ActionView::PartialRenderer < ::ActionView::AbstractRenderer + include ::ActionView::CollectionCaching + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:223 + def initialize(lookup_context, options); end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:221 + def collection_cache; end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:221 + def collection_cache=(val); end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:230 + def render(partial, context, block); end + + private + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:262 + def find_template(path, locals); end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:245 + def render_partial_template(view, locals, template, layout, block); end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:241 + def template_keys(_); end + + class << self + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:221 + def collection_cache; end + + # pkg:gem/actionview#lib/action_view/renderer/partial_renderer.rb:221 + def collection_cache=(val); end + end +end + +# pkg:gem/actionview#lib/action_view/path_registry.rb:4 +module ActionView::PathRegistry + class << self + # pkg:gem/actionview#lib/action_view/path_registry.rb:53 + def all_file_system_resolvers; end + + # pkg:gem/actionview#lib/action_view/path_registry.rb:47 + def all_resolvers; end + + # pkg:gem/actionview#lib/action_view/path_registry.rb:22 + def cast_file_system_resolvers(paths); end + + # pkg:gem/actionview#lib/action_view/path_registry.rb:11 + def file_system_resolver_hooks; end + + # pkg:gem/actionview#lib/action_view/path_registry.rb:14 + def get_view_paths(klass); end + + # pkg:gem/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. +# +# pkg:gem/actionview#lib/action_view/path_set.rb:11 +class ActionView::PathSet + include ::Enumerable + + # pkg:gem/actionview#lib/action_view/path_set.rb:18 + def initialize(paths = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:35 + def +(other); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:16 + def [](*, **, &); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:31 + def compact; end + + # pkg:gem/actionview#lib/action_view/path_set.rb:16 + def each(*, **, &); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:53 + def exists?(path, prefixes, partial, details, details_key, locals); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:40 + def find(path, prefixes, partial, details, details_key, locals); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:45 + def find_all(path, prefixes, partial, details, details_key, locals); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:16 + def include?(*, **, &); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:14 + def paths; end + + # pkg:gem/actionview#lib/action_view/path_set.rb:16 + def size(*, **, &); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:27 + def to_ary; end + + private + + # pkg:gem/actionview#lib/action_view/path_set.rb:22 + def initialize_copy(other); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:58 + def search_combinations(prefixes); end + + # pkg:gem/actionview#lib/action_view/path_set.rb:67 + def typecast(paths); end +end + +# = Action View Railtie +# +# pkg:gem/actionview#lib/action_view/railtie.rb:8 +class ActionView::Railtie < ::Rails::Engine; end + +# pkg:gem/actionview#lib/action_view/buffers.rb:92 +class ActionView::RawOutputBuffer + # pkg:gem/actionview#lib/action_view/buffers.rb:93 + def initialize(buffer); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:97 + def <<(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:103 + def raw; end +end + +# pkg:gem/actionview#lib/action_view/buffers.rb:150 +class ActionView::RawStreamingBuffer + # pkg:gem/actionview#lib/action_view/buffers.rb:151 + def initialize(buffer); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:155 + def <<(value); end + + # pkg:gem/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_for(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 +# +# pkg:gem/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" + # + # pkg:gem/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" + # + # pkg:gem/actionview#lib/action_view/record_identifier.rb:93 + def dom_id(record_or_class, prefix = T.unsafe(nil)); 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. + # + # pkg:gem/actionview#lib/action_view/record_identifier.rb:113 + def record_key_for_dom_id(record); end +end + +# pkg:gem/actionview#lib/action_view/record_identifier.rb:66 +ActionView::RecordIdentifier::JOIN = T.let(T.unsafe(nil), String) + +# pkg:gem/actionview#lib/action_view/record_identifier.rb:67 +ActionView::RecordIdentifier::NEW = T.let(T.unsafe(nil), String) + +# pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:6 +class ActionView::RenderParser + # pkg:gem/actionview#lib/action_view/render_parser.rb:7 + def initialize(name, code); end + + # pkg:gem/actionview#lib/action_view/render_parser.rb:13 + def render_calls; end + + private + + # pkg:gem/actionview#lib/action_view/render_parser.rb:22 + def directory; end + + # pkg:gem/actionview#lib/action_view/render_parser.rb:184 + def layout_to_virtual_path(layout_path); end + + # Convert + # render("foo", ...) + # into either + # render(template: "foo", ...) + # or + # render(partial: "foo", ...) + # + # pkg:gem/actionview#lib/action_view/render_parser.rb:40 + def normalize_args(string, options_hash); end + + # pkg:gem/actionview#lib/action_view/render_parser.rb:72 + def parse_hash(node); end + + # pkg:gem/actionview#lib/action_view/render_parser.rb:76 + def parse_hash_to_symbols(node); end + + # pkg:gem/actionview#lib/action_view/render_parser.rb:48 + def parse_render(node); end + + # pkg:gem/actionview#lib/action_view/render_parser.rb:95 + def parse_render_from_options(options_hash); end + + # pkg:gem/actionview#lib/action_view/render_parser.rb:155 + def parse_str(node); end + + # pkg:gem/actionview#lib/action_view/render_parser.rb:159 + def parse_sym(node); end + + # pkg:gem/actionview#lib/action_view/render_parser.rb:176 + def partial_to_virtual_path(render_type, partial_path); end + + # pkg:gem/actionview#lib/action_view/render_parser.rb:164 + def render_template_with_layout?(render_type, options_hash); end + + # pkg:gem/actionview#lib/action_view/render_parser.rb:170 + def render_template_with_spacer?(options_hash); end + + # pkg:gem/actionview#lib/action_view/render_parser.rb:26 + def resolve_path_directory(path); end +end + +# pkg:gem/actionview#lib/action_view/render_parser.rb:90 +ActionView::RenderParser::ALL_KNOWN_KEYS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionview#lib/action_view/render_parser.rb:92 +ActionView::RenderParser::RENDER_TYPE_KEYS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:7 +module ActionView::RenderParser::RipperASTParser + extend ::ActionView::RenderParser::RipperASTParser + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:188 + def parse_render_nodes(code); end +end + +# pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:8 +class ActionView::RenderParser::RipperASTParser::Node < ::Array + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:11 + def initialize(type, arr, opts = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:35 + def argument_nodes; end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:57 + def call?; end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:65 + def call_method_name; end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:16 + def children; end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:25 + def fcall?; end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:29 + def fcall_named?(name); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:74 + def hash?; end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:88 + def hash_from_body(body); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:20 + def inspect; end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:45 + def string?; end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:96 + def symbol?; end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:78 + def to_hash; end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:69 + def to_string; end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:100 + def to_symbol; end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:9 + def type; end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:61 + def variable_name; end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:49 + def variable_reference?; end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:53 + def vcall?; end +end + +# pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:111 +class ActionView::RenderParser::RipperASTParser::NodeParser < ::Ripper + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_BEGIN(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_CHAR(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_END(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on___end__(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_alias(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_alias_error(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_aref(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_aref_field(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_arg_ambiguous(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_arg_paren(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_args_add(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_args_add_block(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_args_add_star(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_args_forward(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:115 + def on_args_new(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_array(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_aryptn(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_assign(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_assign_error(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_assoc_new(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_assoc_splat(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_assoclist_from_args(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_backref(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_backtick(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_bare_assoc_hash(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_begin(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_binary(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_block_var(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_blockarg(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_bodystmt(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_brace_block(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_break(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_call(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_case(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_class(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_class_name_error(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_comma(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_command(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_command_call(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_comment(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_const(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_const_path_field(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_const_path_ref(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_const_ref(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_cvar(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_def(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_defined(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_defs(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_do_block(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_dot2(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_dot3(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_dyna_symbol(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_else(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_elsif(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_embdoc(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_embdoc_beg(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_embdoc_end(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_embexpr_beg(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_embexpr_end(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_embvar(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_ensure(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_excessed_comma(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_fcall(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_field(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_float(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_fndptn(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_for(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_gvar(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_hash(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_heredoc_beg(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_heredoc_dedent(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_heredoc_end(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_hshptn(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_ident(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_if(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_if_mod(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_ifop(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_ignored_nl(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_ignored_sp(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_imaginary(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_in(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_int(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_ivar(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_kw(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_kwrest_param(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_label(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_label_end(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_lambda(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_lbrace(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_lbracket(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_lparen(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_magic_comment(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_massign(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_method_add_arg(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_method_add_block(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_mlhs_add(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_mlhs_add_post(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_mlhs_add_star(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:115 + def on_mlhs_new(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_mlhs_paren(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_module(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_mrhs_add(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_mrhs_add_star(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:115 + def on_mrhs_new(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_mrhs_new_from_args(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_next(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_nl(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_nokw_param(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_op(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_opassign(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_operator_ambiguous(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_param_error(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_params(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_paren(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_parse_error(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_period(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_program(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_qsymbols_add(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_qsymbols_beg(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:115 + def on_qsymbols_new(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_qwords_add(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_qwords_beg(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:115 + def on_qwords_new(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_rational(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_rbrace(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_rbracket(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_redo(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_regexp_add(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_regexp_beg(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_regexp_end(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_regexp_literal(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:115 + def on_regexp_new(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_rescue(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_rescue_mod(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_rest_param(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_retry(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_return(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_return0(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_rparen(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_sclass(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_semicolon(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_sp(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_stmts_add(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:115 + def on_stmts_new(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_string_add(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_string_concat(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_string_content(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_string_dvar(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_string_embexpr(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_string_literal(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_super(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_symbeg(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_symbol(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_symbol_literal(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_symbols_add(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_symbols_beg(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:115 + def on_symbols_new(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_tlambda(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_tlambeg(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_top_const_field(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_top_const_ref(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_tstring_beg(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_tstring_content(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_tstring_end(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_unary(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_undef(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_unless(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_unless_mod(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_until(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_until_mod(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_var_alias(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_var_field(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_var_ref(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_vcall(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_void_stmt(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_when(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_while(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_while_mod(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_word_add(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:115 + def on_word_new(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_words_add(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_words_beg(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:115 + def on_words_new(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:139 + def on_words_sep(tok); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:121 + def on_xstring_add(list, item); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_xstring_literal(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:115 + def on_xstring_new(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_yield(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_yield0(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:129 + def on_zsuper(*args); end +end + +# pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:147 +class ActionView::RenderParser::RipperASTParser::RenderCallExtractor < ::ActionView::RenderParser::RipperASTParser::NodeParser + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:152 + def initialize(*args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:148 + def render_calls; end + + private + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:177 + def on_arg_paren(content); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:163 + def on_command(name, *args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:159 + def on_fcall(name, *args); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:181 + def on_paren(content); end + + # pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:167 + def on_render_call(node); end +end + +# pkg:gem/actionview#lib/action_view/ripper_ast_parser.rb:150 +ActionView::RenderParser::RipperASTParser::RenderCallExtractor::METHODS_TO_PARSE = 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. +# +# pkg:gem/actionview#lib/action_view/renderer/renderer.rb:15 +class ActionView::Renderer + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:18 + def initialize(lookup_context); end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:58 + def cache_hits; end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:16 + def lookup_context; end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:16 + def lookup_context=(_arg0); end + + # Main render entry point shared by Action View and Action Controller. + # + # pkg:gem/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. + # + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:40 + def render_body(context, options); end + + # Direct access to partial rendering. + # + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:54 + def render_partial(context, options, &block); end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:66 + def render_partial_to_object(context, options, &block); end + + # Direct access to template rendering. + # + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:49 + def render_template(context, options); end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:62 + def render_template_to_object(context, options); end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:27 + def render_to_object(context, options); end + + private + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:109 + def collection_from_object(object); end + + # pkg:gem/actionview#lib/action_view/renderer/renderer.rb:102 + def collection_from_options(options); end +end + +# pkg:gem/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 + + # pkg:gem/actionview#lib/action_view/rendering.rb:32 + def initialize; end + + # Override process to set up I18n proxy. + # + # pkg:gem/actionview#lib/action_view/rendering.rb:38 + def process(*, **, &); end + + # pkg:gem/actionview#lib/action_view/rendering.rb:119 + def render_to_body(options = T.unsafe(nil)); end + + # pkg:gem/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. + # + # pkg:gem/actionview#lib/action_view/rendering.rb:109 + def view_context; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:95 + def view_context_class; end + + # Returns an object that is able to render templates. + # + # pkg:gem/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". + # + # pkg:gem/actionview#lib/action_view/rendering.rb:152 + def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil)); end + + # Normalize options. + # + # pkg:gem/actionview#lib/action_view/rendering.rb:176 + def _normalize_options(options); end + + # Assign the rendered format to look up context. + # + # pkg:gem/actionview#lib/action_view/rendering.rb:145 + def _process_format(format); end + + # Find and render a template based on the options given. + # + # pkg:gem/actionview#lib/action_view/rendering.rb:126 + def _render_template(options); end +end + +# pkg:gem/actionview#lib/action_view/rendering.rb:45 +module ActionView::Rendering::ClassMethods + # pkg:gem/actionview#lib/action_view/rendering.rb:49 + def _helpers; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:46 + def _routes; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:59 + def build_view_context_class(klass, supports_path, routes, helpers); end + + # pkg:gem/actionview#lib/action_view/rendering.rb:76 + def eager_load!; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:52 + def inherit_view_context_class?; end + + # pkg:gem/actionview#lib/action_view/rendering.rb:82 + def view_context_class; end +end + +# = Action View Resolver +# +# pkg:gem/actionview#lib/action_view/template/resolver.rb:12 +class ActionView::Resolver + include ::ActiveSupport::Deprecation::DeprecatedConstantAccessor + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:72 + def all_template_paths; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:67 + def built_templates; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:53 + def caching; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:53 + def caching=(val); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:82 + def caching?(&block); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:59 + def clear_cache; end + + # Normalizes the arguments and passes it on to find_templates. + # + # pkg:gem/actionview#lib/action_view/template/resolver.rb:63 + 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 + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:78 + 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. + # + # pkg:gem/actionview#lib/action_view/template/resolver.rb:87 + def find_templates(name, prefix, partial, details, locals = T.unsafe(nil)); end + + class << self + # pkg:gem/actionview#lib/action_view/template/resolver.rb:53 + def caching; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:53 + def caching=(val); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:56 + def caching?; end + end +end + +# pkg:gem/actionview#lib/action_view/template/resolver.rb:15 +class ActionView::Resolver::PathParser + # pkg:gem/actionview#lib/action_view/template/resolver.rb:18 + def build_path_regex; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:39 + def parse(path); end +end + +# pkg:gem/actionview#lib/action_view/template/resolver.rb:16 +class ActionView::Resolver::PathParser::ParsedPath < ::Struct + # pkg:gem/actionview#lib/action_view/template/resolver.rb:16 + def details; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:16 + def details=(_); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:16 + def path; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:16 + def path=(_); end + + class << self + # pkg:gem/actionview#lib/action_view/template/resolver.rb:16 + def [](*_arg0); end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:16 + def inspect; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:16 + def keyword_init?; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:16 + def members; end + + # pkg:gem/actionview#lib/action_view/template/resolver.rb:16 + def new(*_arg0); end + end +end + +# pkg:gem/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 + # + # pkg:gem/actionview#lib/action_view/routing_url_for.rb:82 + def url_for(options = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/routing_url_for.rb:124 + def url_options; end + + private + + # pkg:gem/actionview#lib/action_view/routing_url_for.rb:139 + def _generate_paths_by_default; end + + # pkg:gem/actionview#lib/action_view/routing_url_for.rb:130 + def _routes_context; end + + # pkg:gem/actionview#lib/action_view/routing_url_for.rb:143 + def ensure_only_path_option(options); end + + # pkg:gem/actionview#lib/action_view/routing_url_for.rb:134 + def optimize_routes_generation?; end +end + +# pkg:gem/actionview#lib/action_view/buffers.rb:108 +class ActionView::StreamingBuffer + # pkg:gem/actionview#lib/action_view/buffers.rb:109 + def initialize(block); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:113 + def <<(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:119 + def append=(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:147 + def block; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:126 + def capture; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:118 + def concat(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:139 + def html_safe; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:135 + def html_safe?; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:143 + def raw; end + + # pkg:gem/actionview#lib/action_view/buffers.rb:124 + def safe_append=(value); end + + # pkg:gem/actionview#lib/action_view/buffers.rb:121 + def safe_concat(value); end +end + +# pkg:gem/actionview#lib/action_view/flows.rb:30 +class ActionView::StreamingFlow < ::ActionView::OutputFlow + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/actionview#lib/action_view/flows.rb:43 + def get(key); end + + private + + # pkg:gem/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 +# +# pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:13 +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. + # + # pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:45 + def render_template(view, template, layout_name = T.unsafe(nil), locals = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:57 + 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. +# +# pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:14 +class ActionView::StreamingTemplateRenderer::Body + # pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:15 + def initialize(&start); end + + # pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:19 + def each(&block); end + + private + + # This is the same logging logic as in ShowExceptions middleware. + # + # pkg:gem/actionview#lib/action_view/renderer/streaming_template_renderer.rb:31 + def log_error(exception); end +end + +# pkg:gem/actionview#lib/action_view/template/error.rb:245 +class ActionView::SyntaxErrorInTemplate < ::ActionView::Template::Error + # pkg:gem/actionview#lib/action_view/template/error.rb:246 + def initialize(template, offending_code_string); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:257 + def annotated_source_code; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:251 + def message; end +end + +# = Action View \Template +# +# pkg:gem/actionview#lib/action_view/template.rb:8 +class ActionView::Template + extend ::ActiveSupport::Autoload + extend ::ActionView::Template::Handlers + + # pkg:gem/actionview#lib/action_view/template.rb:186 + 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. + # + # pkg:gem/actionview#lib/action_view/template.rb:297 + def encode!; end + + # pkg:gem/actionview#lib/action_view/template.rb:182 + def format; end + + # pkg:gem/actionview#lib/action_view/template.rb:181 + def handler; end + + # pkg:gem/actionview#lib/action_view/template.rb:181 + def identifier; end + + # pkg:gem/actionview#lib/action_view/template.rb:276 + def inspect; end + + # The locals this template has been or will be compiled for, or nil if this + # is a strict locals template. + # + # pkg:gem/actionview#lib/action_view/template.rb:210 + 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. + # + # pkg:gem/actionview#lib/action_view/template.rb:363 + def marshal_dump; end + + # pkg:gem/actionview#lib/action_view/template.rb:367 + def marshal_load(array); end + + # pkg:gem/actionview#lib/action_view/template.rb:372 + 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. + # + # pkg:gem/actionview#lib/action_view/template.rb:248 + def render(view, locals, buffer = T.unsafe(nil), implicit_locals: T.unsafe(nil), add_to_stack: T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/template.rb:272 + def short_identifier; end + + # pkg:gem/actionview#lib/action_view/template.rb:280 + def source; end + + # pkg:gem/actionview#lib/action_view/template.rb:218 + 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 acceps 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. + # + # pkg:gem/actionview#lib/action_view/template.rb:342 + def strict_locals!; end + + # Returns whether a template is using strict locals. + # + # pkg:gem/actionview#lib/action_view/template.rb:356 + def strict_locals?; end + + # Returns whether the underlying handler supports streaming. If so, + # a streaming buffer *may* be passed when it starts rendering. + # + # pkg:gem/actionview#lib/action_view/template.rb:238 + def supports_streaming?; end + + # Translate an error location returned by ErrorHighlight to the correct + # source location inside the template. + # + # pkg:gem/actionview#lib/action_view/template.rb:228 + def translate_location(backtrace_location, spot); end + + # pkg:gem/actionview#lib/action_view/template.rb:268 + def type; end + + # pkg:gem/actionview#lib/action_view/template.rb:182 + def variable; end + + # pkg:gem/actionview#lib/action_view/template.rb:182 + def variant; end + + # pkg:gem/actionview#lib/action_view/template.rb:182 + 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. + # + # pkg:gem/actionview#lib/action_view/template.rb:472 + def compile(mod); end + + # Compile a template. This method ensures a template is compiled + # just once and removes the source after it is compiled. + # + # pkg:gem/actionview#lib/action_view/template.rb:394 + 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. + # + # pkg:gem/actionview#lib/action_view/template.rb:419 + def compiled_source; end + + # pkg:gem/actionview#lib/action_view/template.rb:381 + def find_node_by_id(node, node_id); end + + # pkg:gem/actionview#lib/action_view/template.rb:518 + def handle_render_error(view, e); end + + # pkg:gem/actionview#lib/action_view/template.rb:540 + def identifier_method_name; end + + # pkg:gem/actionview#lib/action_view/template.rb:544 + def instrument(action, &block); end + + # pkg:gem/actionview#lib/action_view/template.rb:552 + def instrument_payload; end + + # pkg:gem/actionview#lib/action_view/template.rb:548 + def instrument_render_template(&block); end + + # pkg:gem/actionview#lib/action_view/template.rb:527 + def locals_code; end + + # pkg:gem/actionview#lib/action_view/template.rb:510 + def offset; end + + class << self + # pkg:gem/actionview#lib/action_view/template.rb:167 + def frozen_string_literal; end + + # pkg:gem/actionview#lib/action_view/template.rb:167 + def frozen_string_literal=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template.rb:171 + 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. +# +# pkg:gem/actionview#lib/action_view/template/error.rb:154 +class ActionView::Template::Error < ::ActionView::ActionViewError + # pkg:gem/actionview#lib/action_view/template/error.rb:162 + def initialize(template); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:220 + def annotated_source_code; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:171 + def backtrace; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:175 + def backtrace_locations; end + + # Override to prevent #cause resetting during re-raise. + # + # pkg:gem/actionview#lib/action_view/template/error.rb:158 + def cause; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:179 + def file_name; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:212 + def line_number; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:192 + def source_extract(indentation = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:183 + def sub_template_message; end + + # pkg:gem/actionview#lib/action_view/template/error.rb:207 + def sub_template_of(template_path); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:160 + def template; end + + private + + # pkg:gem/actionview#lib/action_view/template/error.rb:233 + def formatted_code_for(source_code, line_counter, indent); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:225 + def source_location; end +end + +# pkg:gem/actionview#lib/action_view/template/error.rb:155 +ActionView::Template::Error::SOURCE_CODE_RADIUS = T.let(T.unsafe(nil), Integer) + +# = Action View HTML Template +# +# pkg:gem/actionview#lib/action_view/template/html.rb:6 +class ActionView::Template::HTML + # pkg:gem/actionview#lib/action_view/template/html.rb:9 + def initialize(string, type); end + + # pkg:gem/actionview#lib/action_view/template/html.rb:28 + def format; end + + # pkg:gem/actionview#lib/action_view/template/html.rb:14 + def identifier; end + + # pkg:gem/actionview#lib/action_view/template/html.rb:18 + def inspect; end + + # pkg:gem/actionview#lib/action_view/template/html.rb:24 + def render(*args); end + + # pkg:gem/actionview#lib/action_view/template/html.rb:20 + def to_str; end + + # pkg:gem/actionview#lib/action_view/template/html.rb:7 + def type; end +end + +# = Action View Template Handlers +# +# pkg:gem/actionview#lib/action_view/template/handlers.rb:6 +module ActionView::Template::Handlers + # pkg:gem/actionview#lib/action_view/template/handlers.rb:61 + def handler_for_extension(extension); end + + # pkg:gem/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. + # + # pkg:gem/actionview#lib/action_view/template/handlers.rb:31 + def register_template_handler(*extensions, handler); end + + # pkg:gem/actionview#lib/action_view/template/handlers.rb:52 + def registered_template_handler(extension); end + + # pkg:gem/actionview#lib/action_view/template/handlers.rb:48 + def template_handler_extensions; end + + # Opposite to register_template_handler. + # + # pkg:gem/actionview#lib/action_view/template/handlers.rb:40 + def unregister_template_handler(*extensions); end + + class << self + # pkg:gem/actionview#lib/action_view/template/handlers.rb:12 + def extended(base); end + + # pkg:gem/actionview#lib/action_view/template/handlers.rb:23 + def extensions; end + end +end + +# pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:5 +class ActionView::Template::Handlers::Builder + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:8 + def call(template, source); end + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def default_format; end + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def default_format=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def default_format?; end + + private + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:17 + def require_engine; end + + class << self + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def default_format; end + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def default_format=(value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/builder.rb:6 + def default_format?; end + end +end + +# pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:9 +class ActionView::Template::Handlers::ERB + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:61 + def call(template, source); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def erb_implementation; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def erb_implementation=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def erb_implementation?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def erb_trim_mode; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def erb_trim_mode=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def erb_trim_mode?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def escape_ignore_list; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def escape_ignore_list=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def escape_ignore_list?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:37 + def handles_encoding?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def strip_trailing_newlines; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def strip_trailing_newlines=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def strip_trailing_newlines?; end + + # pkg:gem/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. + # + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:43 + def translate_location(spot, backtrace_location, source); end + + private + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:108 + def find_offset(compiled, source_tokens, error_column); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:93 + def valid_encoding(string, encoding); end + + class << self + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:29 + def call(template, source); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def erb_implementation; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def erb_implementation=(value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:17 + def erb_implementation?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def erb_trim_mode; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def erb_trim_mode=(value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:14 + def erb_trim_mode?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def escape_ignore_list; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def escape_ignore_list=(value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:20 + def escape_ignore_list?; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def strip_trailing_newlines; end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def strip_trailing_newlines=(value); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:23 + def strip_trailing_newlines?; end + end +end + +# pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:25 +ActionView::Template::Handlers::ERB::ENCODING_TAG = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:9 +class ActionView::Template::Handlers::ERB::Erubi < ::Erubi::Engine + # pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:11 + def initialize(input, properties = T.unsafe(nil)); end + + private + + # pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:65 + def add_code(code); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:47 + def add_expression(indicator, code); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:70 + def add_postamble(_); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:30 + def add_text(text); end + + # pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:75 + def flush_newline_if_pending(src); end +end + +# pkg:gem/actionview#lib/action_view/template/handlers/erb/erubi.rb:45 +ActionView::Template::Handlers::ERB::Erubi::BLOCK_EXPR = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionview#lib/action_view/template/handlers/erb.rb:27 +class ActionView::Template::Handlers::ERB::LocationParsingError < ::StandardError; end + +# pkg:gem/actionview#lib/action_view/template/handlers/html.rb:5 +class ActionView::Template::Handlers::Html < ::ActionView::Template::Handlers::Raw + # pkg:gem/actionview#lib/action_view/template/handlers/html.rb:6 + def call(template, source); end +end + +# pkg:gem/actionview#lib/action_view/template/handlers/raw.rb:5 +class ActionView::Template::Handlers::Raw + # pkg:gem/actionview#lib/action_view/template/handlers/raw.rb:6 + def call(template, source); end +end + +# pkg:gem/actionview#lib/action_view/template/inline.rb:7 +class ActionView::Template::Inline < ::ActionView::Template + # pkg:gem/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. +# +# pkg:gem/actionview#lib/action_view/template/inline.rb:8 +ActionView::Template::Inline::Finalizer = T.let(T.unsafe(nil), Proc) + +# pkg:gem/actionview#lib/action_view/template.rb:284 +ActionView::Template::LEADING_ENCODING_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/actionview#lib/action_view/template.rb:184 +ActionView::Template::NONE = T.let(T.unsafe(nil), Object) + +# = Action View RawFile Template +# +# pkg:gem/actionview#lib/action_view/template/raw_file.rb:6 +class ActionView::Template::RawFile + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:9 + def initialize(filename); end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:7 + def format; end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:7 + def format=(_arg0); end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:16 + def identifier; end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:20 + def render(*args); end + + # pkg:gem/actionview#lib/action_view/template/raw_file.rb:7 + def type; end + + # pkg:gem/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 +# +# pkg:gem/actionview#lib/action_view/template/renderable.rb:6 +class ActionView::Template::Renderable + # pkg:gem/actionview#lib/action_view/template/renderable.rb:7 + def initialize(renderable); end + + # pkg:gem/actionview#lib/action_view/template/renderable.rb:19 + def format; end + + # pkg:gem/actionview#lib/action_view/template/renderable.rb:11 + def identifier; end + + # pkg:gem/actionview#lib/action_view/template/renderable.rb:15 + def render(context, *args); end +end + +# pkg:gem/actionview#lib/action_view/template.rb:11 +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. +# +# pkg:gem/actionview#lib/action_view/template/types.rb:9 +class ActionView::Template::SimpleType + # pkg:gem/actionview#lib/action_view/template/types.rb:29 + def initialize(symbol); end + + # pkg:gem/actionview#lib/action_view/template/types.rb:43 + def ==(type); end + + # pkg:gem/actionview#lib/action_view/template/types.rb:38 + def ref; end + + # pkg:gem/actionview#lib/action_view/template/types.rb:27 + def symbol; end + + # pkg:gem/actionview#lib/action_view/template/types.rb:33 + def to_s; end + + # pkg:gem/actionview#lib/action_view/template/types.rb:36 + def to_str; end + + # pkg:gem/actionview#lib/action_view/template/types.rb:41 + def to_sym; end + + class << self + # pkg:gem/actionview#lib/action_view/template/types.rb:14 + def [](type); end + + # pkg:gem/actionview#lib/action_view/template/types.rb:12 + def symbols; end + + # pkg:gem/actionview#lib/action_view/template/types.rb:22 + def valid_symbols?(symbols); end + end +end + +# pkg:gem/actionview#lib/action_view/template/sources.rb:5 +module ActionView::Template::Sources + extend ::ActiveSupport::Autoload +end + +# pkg:gem/actionview#lib/action_view/template/sources/file.rb:6 +class ActionView::Template::Sources::File + # pkg:gem/actionview#lib/action_view/template/sources/file.rb:7 + def initialize(filename); end + + # pkg:gem/actionview#lib/action_view/template/sources/file.rb:11 + def to_s; end +end + +# = Action View Text Template +# +# pkg:gem/actionview#lib/action_view/template/text.rb:6 +class ActionView::Template::Text + # pkg:gem/actionview#lib/action_view/template/text.rb:9 + def initialize(string); end + + # pkg:gem/actionview#lib/action_view/template/text.rb:27 + def format; end + + # pkg:gem/actionview#lib/action_view/template/text.rb:13 + def identifier; end + + # pkg:gem/actionview#lib/action_view/template/text.rb:17 + def inspect; end + + # pkg:gem/actionview#lib/action_view/template/text.rb:23 + def render(*args); end + + # pkg:gem/actionview#lib/action_view/template/text.rb:19 + def to_str; end + + # pkg:gem/actionview#lib/action_view/template/text.rb:7 + def type; end + + # pkg:gem/actionview#lib/action_view/template/text.rb:7 + def type=(_arg0); end +end + +# pkg:gem/actionview#lib/action_view/template.rb:176 +ActionView::Template::Types = Mime + +# pkg:gem/actionview#lib/action_view/template_details.rb:4 +class ActionView::TemplateDetails + # pkg:gem/actionview#lib/action_view/template_details.rb:35 + def initialize(locale, handler, format, variant); end + + # pkg:gem/actionview#lib/action_view/template_details.rb:33 + def format; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:62 + def format_or_default; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:33 + def handler; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:58 + def handler_class; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:33 + def locale; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:42 + def matches?(requested); end + + # pkg:gem/actionview#lib/action_view/template_details.rb:49 + def sort_key_for(requested); end + + # pkg:gem/actionview#lib/action_view/template_details.rb:33 + def variant; end +end + +# pkg:gem/actionview#lib/action_view/template_details.rb:5 +class ActionView::TemplateDetails::Requested + # pkg:gem/actionview#lib/action_view/template_details.rb:11 + def initialize(locale:, handlers:, formats:, variants:); end + + # pkg:gem/actionview#lib/action_view/template_details.rb:6 + def formats; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:7 + def formats_idx; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:6 + def handlers; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:7 + def handlers_idx; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:6 + def locale; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:7 + def locale_idx; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:6 + def variants; end + + # pkg:gem/actionview#lib/action_view/template_details.rb:7 + def variants_idx; end + + private + + # pkg:gem/actionview#lib/action_view/template_details.rb:28 + def build_idx_hash(arr); end +end + +# pkg:gem/actionview#lib/action_view/template_details.rb:9 +ActionView::TemplateDetails::Requested::ANY_HASH = T.let(T.unsafe(nil), Hash) + +# pkg:gem/actionview#lib/action_view/template/error.rb:243 +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. +# +# pkg:gem/actionview#lib/action_view/template_path.rb:11 +class ActionView::TemplatePath + # pkg:gem/actionview#lib/action_view/template_path.rb:47 + def initialize(name, prefix, partial, virtual); end + + # pkg:gem/actionview#lib/action_view/template_path.rb:64 + def ==(other); end + + # pkg:gem/actionview#lib/action_view/template_path.rb:61 + def eql?(other); end + + # pkg:gem/actionview#lib/action_view/template_path.rb:57 + def hash; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:12 + def name; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:12 + def partial; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:13 + def partial?; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:12 + def prefix; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:55 + def to_s; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:54 + def to_str; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:12 + def virtual; end + + # pkg:gem/actionview#lib/action_view/template_path.rb:14 + def virtual_path; end + + class << self + # Convert name, prefix, and partial into a TemplatePath + # + # pkg:gem/actionview#lib/action_view/template_path.rb:43 + def build(name, prefix, partial); end + + # Build a TemplatePath form a virtual path + # + # pkg:gem/actionview#lib/action_view/template_path.rb:28 + def parse(virtual); end + + # Convert name, prefix, and partial into a virtual path string + # + # pkg:gem/actionview#lib/action_view/template_path.rb:17 + def virtual(name, prefix, partial); end + end +end + +# pkg:gem/actionview#lib/action_view/renderer/template_renderer.rb:4 +class ActionView::TemplateRenderer < ::ActionView::AbstractRenderer + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/actionview#lib/action_view/renderer/template_renderer.rb:58 + def render_template(view, template, layout_name, locals); end + + # pkg:gem/actionview#lib/action_view/renderer/template_renderer.rb:71 + def render_with_layout(view, template, path, locals); end + + # pkg:gem/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. +# +# pkg:gem/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 ::ActiveSupport::Deprecation::DeprecatedConstantAccessor + 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 + + # pkg:gem/actionview#lib/action_view/test_case.rb:449 + def _helper_methods; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:449 + def _helper_methods=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:449 + def _helper_methods?; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:449 + def debug_missing_translation; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:449 + def debug_missing_translation=(val); end + + class << self + # pkg:gem/actionview#lib/action_view/test_case.rb:203 + def __callbacks; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:449 + def _helper_methods; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:449 + def _helper_methods=(value); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:449 + def _helper_methods?; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:449 + def _helpers; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:201 + def content_class; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:201 + def content_class=(value); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:201 + def content_class?; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:449 + def debug_missing_translation; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:449 + def debug_missing_translation=(val); end + end +end + +# pkg:gem/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 + + # pkg:gem/actionview#lib/action_view/test_case.rb:298 + def _routes; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:233 + def config; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:63 + def controller; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:63 + def controller=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:62 + def lookup_context(*, **, &); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:63 + def output_buffer; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:63 + def output_buffer=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:237 + 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 + # + # pkg:gem/actionview#lib/action_view/test_case.rb:294 + def rendered; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:243 + def rendered_views; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:63 + def request; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:63 + def request=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:221 + def setup_with_controller; end + + private + + # pkg:gem/actionview#lib/action_view/test_case.rb:405 + def _user_defined_ivars; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:368 + def _view; end + + # Need to experiment if this priority is the best one: rendered => output_buffer + # + # pkg:gem/actionview#lib/action_view/test_case.rb:333 + def document_root_element; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:419 + def method_missing(selector, *args, **); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:436 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end + + # The instance of ActionView::Base that is used by +render+. + # + # pkg:gem/actionview#lib/action_view/test_case.rb:357 + 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. + # + # pkg:gem/actionview#lib/action_view/test_case.rb:413 + 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 + +# pkg:gem/actionview#lib/action_view/test_case.rb:65 +module ActionView::TestCase::Behavior::ClassMethods + # pkg:gem/actionview#lib/action_view/test_case.rb:164 + def determine_default_helper_class(name); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:184 + def helper_class; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:182 + def helper_class=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:170 + def helper_method(*methods); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:66 + def inherited(descendant); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:188 + def new(*); 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 + # + # pkg:gem/actionview#lib/action_view/test_case.rb:148 + def register_parser(format, callable = T.unsafe(nil), &block); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:155 + def tests(helper_class); end + + private + + # pkg:gem/actionview#lib/action_view/test_case.rb:194 + def include_helper_modules!; end +end + +# pkg:gem/actionview#lib/action_view/test_case.rb:370 +ActionView::TestCase::Behavior::INTERNAL_IVARS = T.let(T.unsafe(nil), Array) + +# pkg:gem/actionview#lib/action_view/test_case.rb:337 +module ActionView::TestCase::Behavior::Locals + # pkg:gem/actionview#lib/action_view/test_case.rb:340 + def render(options = T.unsafe(nil), local_assigns = T.unsafe(nil)); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:338 + def rendered_views; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:338 + def rendered_views=(_arg0); end +end + +# pkg:gem/actionview#lib/action_view/test_case.rb:302 +class ActionView::TestCase::Behavior::RenderedViewContent < ::String + # pkg:gem/actionview#lib/action_view/test_case.rb:150 + def html; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:150 + def json; end +end + +# Need to experiment if this priority is the best one: rendered => output_buffer +# +# pkg:gem/actionview#lib/action_view/test_case.rb:306 +class ActionView::TestCase::Behavior::RenderedViewsCollection + # pkg:gem/actionview#lib/action_view/test_case.rb:307 + def initialize; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:311 + def add(view, locals); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:316 + def locals_for(view); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:320 + def rendered_views; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:324 + def view_rendered?(view, expected_locals); end +end + +# pkg:gem/actionview#lib/action_view/test_case.rb:449 +module ActionView::TestCase::HelperMethods + # pkg:gem/actionview#lib/action_view/test_case.rb:215 + def _test_case; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:211 + def protect_against_forgery?; end +end + +# pkg:gem/actionview#lib/action_view/test_case.rb:16 +class ActionView::TestCase::TestController < ::ActionController::Base + include ::ActionDispatch::TestProcess::FixtureFile + include ::ActionDispatch::TestProcess + + # pkg:gem/actionview#lib/action_view/test_case.rb:34 + def initialize; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:26 + def controller_path=(path); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:19 + def params; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:19 + def params=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:19 + def request; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:19 + def request=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:19 + def response; end + + # pkg:gem/actionview#lib/action_view/test_case.rb:19 + def response=(_arg0); end + + private + + # pkg:gem/actionview#lib/action_view/test_case.rb:16 + def _layout(lookup_context, formats); end + + class << self + # pkg:gem/actionview#lib/action_view/test_case.rb:30 + def controller_name; end + + # Overrides AbstractController::Base#controller_path + # + # pkg:gem/actionview#lib/action_view/test_case.rb:23 + def controller_path; end + + # Overrides AbstractController::Base#controller_path + # + # pkg:gem/actionview#lib/action_view/test_case.rb:23 + def controller_path=(_arg0); end + + # pkg:gem/actionview#lib/action_view/test_case.rb:16 + def middleware_stack; end + end +end + +# pkg:gem/actionview#lib/action_view/unbound_template.rb:6 +class ActionView::UnboundTemplate + # pkg:gem/actionview#lib/action_view/unbound_template.rb:10 + def initialize(source, identifier, details:, virtual_path:); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:20 + def bind_locals(locals); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:44 + def built_templates; end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:7 + def details; end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:8 + def format(*, **, &); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:8 + def handler(*, **, &); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:8 + def locale(*, **, &); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:8 + def variant(*, **, &); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:7 + def virtual_path; end + + private + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:49 + def build_template(locals); end + + # pkg:gem/actionview#lib/action_view/unbound_template.rb:63 + def normalize_locals(locals); end +end + +# pkg:gem/actionview#lib/action_view/gem_version.rb:9 +module ActionView::VERSION; end + +# pkg:gem/actionview#lib/action_view/gem_version.rb:10 +ActionView::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionview#lib/action_view/gem_version.rb:11 +ActionView::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/actionview#lib/action_view/gem_version.rb:13 +ActionView::VERSION::PRE = T.let(T.unsafe(nil), String) + +# pkg:gem/actionview#lib/action_view/gem_version.rb:15 +ActionView::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/actionview#lib/action_view/gem_version.rb:12 +ActionView::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +# pkg:gem/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. + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:81 + def _prefixes; end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def any_templates?(*, **, &); 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) + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:103 + def append_view_path(path); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:93 + def details_for_lookup; end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def formats(*, **, &); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def formats=(arg); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def locale(*, **, &); end + + # pkg:gem/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. + # + # pkg:gem/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) + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:113 + def prepend_view_path(path); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def template_exists?(*, **, &); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:11 + def view_paths(*, **, &); end +end + +# pkg:gem/actionview#lib/action_view/view_paths.rb:14 +module ActionView::ViewPaths::ClassMethods + # pkg:gem/actionview#lib/action_view/view_paths.rb:31 + def _build_view_paths(paths); end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:23 + def _prefixes; end + + # pkg:gem/actionview#lib/action_view/view_paths.rb:15 + def _view_paths; end + + # pkg:gem/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) + # + # pkg:gem/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) + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/actionview#lib/action_view/view_paths.rb:75 + def local_prefixes; end +end + +# pkg:gem/actionview#lib/action_view/template/error.rb:14 +class ActionView::WrongEncodingError < ::ActionView::EncodingError + # pkg:gem/actionview#lib/action_view/template/error.rb:15 + def initialize(string, encoding); end + + # pkg:gem/actionview#lib/action_view/template/error.rb:19 + def message; end +end diff --git a/sorbet/rbi/gems/activejob@7.1.3.4.rbi b/sorbet/rbi/gems/activejob@7.1.3.4.rbi new file mode 100644 index 000000000..bf4a91e6e --- /dev/null +++ b/sorbet/rbi/gems/activejob@7.1.3.4.rbi @@ -0,0 +1,2641 @@ +# 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: activejob/README.md +# +# pkg:gem/activejob#lib/active_job/gem_version.rb:3 +module ActiveJob + extend ::ActiveSupport::Autoload + + class << self + # pkg:gem/activejob#lib/active_job/queue_adapter.rb:7 + def adapter_name(adapter); end + + # pkg:gem/activejob#lib/active_job/deprecator.rb:4 + def deprecator; end + + # Returns the currently loaded version of Active Job as a +Gem::Version+. + # + # pkg:gem/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. + # + # pkg:gem/activejob#lib/active_job/enqueuing.rb:16 + def perform_all_later(*jobs); end + + # pkg:gem/activejob#lib/active_job.rb:53 + def use_big_decimal_serializer; end + + # pkg:gem/activejob#lib/active_job.rb:53 + def use_big_decimal_serializer=(_arg0); end + + # pkg:gem/activejob#lib/active_job.rb:61 + def verbose_enqueue_logs; end + + # pkg:gem/activejob#lib/active_job.rb:61 + def verbose_enqueue_logs=(_arg0); end + + # Returns the currently loaded version of Active Job as a +Gem::Version+. + # + # pkg:gem/activejob#lib/active_job/version.rb:7 + def version; end + + private + + # pkg:gem/activejob#lib/active_job/instrumentation.rb:6 + def instrument_enqueue_all(queue_adapter, jobs); end + end +end + +# pkg:gem/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. + # + # pkg:gem/activejob#lib/active_job/arguments.rb:42 + 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. + # + # pkg:gem/activejob#lib/active_job/arguments.rb:34 + def serialize(arguments); end + + private + + # pkg:gem/activejob#lib/active_job/arguments.rb:201 + def convert_to_global_id_hash(argument); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:148 + def custom_serialized?(hash); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:119 + def deserialize_argument(argument); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:144 + def deserialize_global_id(hash); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:158 + def deserialize_hash(serialized_hash); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:71 + def serialize_argument(argument); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:152 + def serialize_hash(argument); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:171 + def serialize_hash_key(key); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:182 + def serialize_indifferent_hash(indifferent_hash); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:140 + def serialized_global_id?(hash); end + + # pkg:gem/activejob#lib/active_job/arguments.rb:188 + def transform_symbol_keys(hash, symbol_keys); end +end + +# pkg:gem/activejob#lib/active_job/arguments.rb:50 +ActiveJob::Arguments::GLOBALID_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/activejob#lib/active_job/arguments.rb:58 +ActiveJob::Arguments::OBJECT_SERIALIZER_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/activejob#lib/active_job/arguments.rb:61 +ActiveJob::Arguments::RESERVED_KEYS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activejob#lib/active_job/arguments.rb:54 +ActiveJob::Arguments::RUBY2_KEYWORDS_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/activejob#lib/active_job/arguments.rb:52 +ActiveJob::Arguments::SYMBOL_KEYS_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/activejob#lib/active_job/arguments.rb:56 +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 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. +# +# pkg:gem/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::Timezones + include ::ActiveJob::Translation + 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::TestHelper::TestQueueAdapter::ClassMethods + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def __callbacks; end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def __callbacks?; end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def _enqueue_callbacks; end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def _perform_callbacks; end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def _run_enqueue_callbacks(&block); end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def _run_perform_callbacks(&block); end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def after_discard_procs; end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def after_discard_procs=(_arg0); end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def after_discard_procs?; end + + # pkg:gem/activejob#lib/active_job/base.rb:73 + def logger; end + + # pkg:gem/activejob#lib/active_job/base.rb:73 + def logger=(val); end + + # pkg:gem/activejob#lib/active_job/base.rb:65 + def queue_adapter(&block); end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name_prefix; end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name_prefix=(_arg0); end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name_prefix?; end + + # pkg:gem/activejob#lib/active_job/base.rb:69 + def rescue_handlers; end + + # pkg:gem/activejob#lib/active_job/base.rb:69 + def rescue_handlers=(_arg0); end + + # pkg:gem/activejob#lib/active_job/base.rb:69 + def rescue_handlers?; end + + class << self + # pkg:gem/activejob#lib/active_job/base.rb:70 + def __callbacks; end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def __callbacks=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def __callbacks?; end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def _enqueue_callbacks; end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def _enqueue_callbacks=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def _perform_callbacks; end + + # pkg:gem/activejob#lib/active_job/base.rb:70 + def _perform_callbacks=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:65 + def _queue_adapter; end + + # pkg:gem/activejob#lib/active_job/base.rb:65 + def _queue_adapter=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:65 + def _queue_adapter_name; end + + # pkg:gem/activejob#lib/active_job/base.rb:65 + def _queue_adapter_name=(value); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:19 + def _test_adapter; end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:19 + def _test_adapter=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def after_discard_procs; end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def after_discard_procs=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def after_discard_procs?; end + + # pkg:gem/activejob#lib/active_job/base.rb:73 + def log_arguments; end + + # pkg:gem/activejob#lib/active_job/base.rb:73 + def log_arguments=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:73 + def log_arguments?; end + + # pkg:gem/activejob#lib/active_job/base.rb:73 + def logger; end + + # pkg:gem/activejob#lib/active_job/base.rb:73 + def logger=(val); end + + # pkg:gem/activejob#lib/active_job/base.rb:67 + def priority; end + + # pkg:gem/activejob#lib/active_job/base.rb:67 + def priority=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:67 + def priority?; end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name; end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name?; end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name_delimiter; end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name_delimiter=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name_delimiter?; end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name_prefix; end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name_prefix=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:66 + def queue_name_prefix?; end + + # pkg:gem/activejob#lib/active_job/base.rb:69 + def rescue_handlers; end + + # pkg:gem/activejob#lib/active_job/base.rb:69 + def rescue_handlers=(value); end + + # pkg:gem/activejob#lib/active_job/base.rb:69 + def rescue_handlers?; end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def retry_jitter; end + + # pkg:gem/activejob#lib/active_job/base.rb:71 + def retry_jitter=(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 +# +# NOTE: Calling the same callback multiple times will overwrite previous callback definitions. +# +# pkg:gem/activejob#lib/active_job/callbacks.rb:21 +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 + # pkg:gem/activejob#lib/active_job/callbacks.rb:26 + def __callbacks; end + + # pkg:gem/activejob#lib/active_job/callbacks.rb:26 + def __callbacks?; end + + # pkg:gem/activejob#lib/active_job/callbacks.rb:27 + def _execute_callbacks; end + + # pkg:gem/activejob#lib/active_job/callbacks.rb:27 + def _run_execute_callbacks(&block); end + end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def __callbacks?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def __callbacks?; end + end +end + +# These methods will be included into any Active Job object, adding +# callbacks for +perform+ and +enqueue+ methods. +# +# pkg:gem/activejob#lib/active_job/callbacks.rb:37 +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 + # + # pkg:gem/activejob#lib/active_job/callbacks.rb:144 + 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 + # + # pkg:gem/activejob#lib/active_job/callbacks.rb:72 + 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 + # + # pkg:gem/activejob#lib/active_job/callbacks.rb:165 + 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 + # + # pkg:gem/activejob#lib/active_job/callbacks.rb:105 + 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 + # + # pkg:gem/activejob#lib/active_job/callbacks.rb:124 + 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 + # + # pkg:gem/activejob#lib/active_job/callbacks.rb:53 + def before_perform(*filters, &blk); end +end + +# pkg:gem/activejob#lib/active_job/configured_job.rb:4 +class ActiveJob::ConfiguredJob + # pkg:gem/activejob#lib/active_job/configured_job.rb:5 + def initialize(job_class, options = T.unsafe(nil)); end + + # pkg:gem/activejob#lib/active_job/configured_job.rb:18 + def perform_all_later(multi_args); end + + # pkg:gem/activejob#lib/active_job/configured_job.rb:14 + def perform_later(*, **, &); end + + # pkg:gem/activejob#lib/active_job/configured_job.rb:10 + def perform_now(*, **, &); end +end + +# = Active Job \Core +# +# Provides general behavior that will be included into every Active Job +# object that inherits from ActiveJob::Base. +# +# pkg:gem/activejob#lib/active_job/core.rb:8 +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. + # + # pkg:gem/activejob#lib/active_job/core.rb:95 + def initialize(*arguments, **); end + + # pkg:gem/activejob#lib/active_job/core.rb:18 + def _scheduled_at_time; end + + # Job arguments + # + # pkg:gem/activejob#lib/active_job/core.rb:12 + def arguments; end + + # Job arguments + # + # pkg:gem/activejob#lib/active_job/core.rb:12 + 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 + # + # pkg:gem/activejob#lib/active_job/core.rb:153 + def deserialize(job_data); end + + # Track any exceptions raised by the backend so callers can inspect the errors. + # + # pkg:gem/activejob#lib/active_job/core.rb:58 + def enqueue_error; end + + # Track any exceptions raised by the backend so callers can inspect the errors. + # + # pkg:gem/activejob#lib/active_job/core.rb:58 + def enqueue_error=(_arg0); end + + # Track when a job was enqueued + # + # pkg:gem/activejob#lib/active_job/core.rb:48 + def enqueued_at; end + + # Track when a job was enqueued + # + # pkg:gem/activejob#lib/active_job/core.rb:48 + 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. + # + # pkg:gem/activejob#lib/active_job/core.rb:39 + 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. + # + # pkg:gem/activejob#lib/active_job/core.rb:39 + def exception_executions=(_arg0); end + + # Number of times this job has been executed (which increments on every retry, like after an exception). + # + # pkg:gem/activejob#lib/active_job/core.rb:33 + def executions; end + + # Number of times this job has been executed (which increments on every retry, like after an exception). + # + # pkg:gem/activejob#lib/active_job/core.rb:33 + def executions=(_arg0); end + + # Job Identifier + # + # pkg:gem/activejob#lib/active_job/core.rb:21 + def job_id; end + + # Job Identifier + # + # pkg:gem/activejob#lib/active_job/core.rb:21 + def job_id=(_arg0); end + + # I18n.locale to be used during the job. + # + # pkg:gem/activejob#lib/active_job/core.rb:42 + def locale; end + + # I18n.locale to be used during the job. + # + # pkg:gem/activejob#lib/active_job/core.rb:42 + def locale=(_arg0); end + + # Priority that the job will have (lower is more priority). + # + # pkg:gem/activejob#lib/active_job/core.rb:27 + def priority=(_arg0); end + + # ID optionally provided by adapter + # + # pkg:gem/activejob#lib/active_job/core.rb:30 + def provider_job_id; end + + # ID optionally provided by adapter + # + # pkg:gem/activejob#lib/active_job/core.rb:30 + def provider_job_id=(_arg0); end + + # Queue in which the job will reside. + # + # pkg:gem/activejob#lib/active_job/core.rb:24 + def queue_name=(_arg0); end + + # Time when the job should be performed + # + # pkg:gem/activejob#lib/active_job/core.rb:16 + def scheduled_at; end + + # pkg:gem/activejob#lib/active_job/core.rb:177 + def scheduled_at=(value); end + + # Returns a hash with the job data that can safely be passed to the + # queuing adapter. + # + # pkg:gem/activejob#lib/active_job/core.rb:110 + def serialize; end + + # pkg:gem/activejob#lib/active_job/core.rb:13 + def serialized_arguments=(_arg0); end + + # Configures the job with the given options. + # + # pkg:gem/activejob#lib/active_job/core.rb:168 + def set(options = T.unsafe(nil)); end + + # Track whether the adapter received the job successfully. + # + # pkg:gem/activejob#lib/active_job/core.rb:51 + def successfully_enqueued=(_arg0); end + + # pkg:gem/activejob#lib/active_job/core.rb:53 + def successfully_enqueued?; end + + # Timezone to be used during the job. + # + # pkg:gem/activejob#lib/active_job/core.rb:45 + def timezone; end + + # Timezone to be used during the job. + # + # pkg:gem/activejob#lib/active_job/core.rb:45 + def timezone=(_arg0); end + + private + + # pkg:gem/activejob#lib/active_job/core.rb:213 + def arguments_serialized?; end + + # pkg:gem/activejob#lib/active_job/core.rb:209 + def deserialize_arguments(serialized_args); end + + # pkg:gem/activejob#lib/active_job/core.rb:198 + def deserialize_arguments_if_needed; end + + # pkg:gem/activejob#lib/active_job/core.rb:205 + def serialize_arguments(arguments); end + + # pkg:gem/activejob#lib/active_job/core.rb:190 + 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. +# +# pkg:gem/activejob#lib/active_job/core.rb:62 +module ActiveJob::Core::ClassMethods + # Creates a new job instance from a hash created with +serialize+ + # + # pkg:gem/activejob#lib/active_job/core.rb:64 + 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) + # + # pkg:gem/activejob#lib/active_job/core.rb:88 + 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+. +# +# pkg:gem/activejob#lib/active_job/arguments.rb:10 +class ActiveJob::DeserializationError < ::StandardError + # pkg:gem/activejob#lib/active_job/arguments.rb:11 + def initialize; 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. +# +# pkg:gem/activejob#lib/active_job/enqueuing.rb:10 +class ActiveJob::EnqueueError < ::StandardError; end + +# pkg:gem/activejob#lib/active_job/enqueuing.rb:42 +module ActiveJob::Enqueuing + extend ::ActiveSupport::Concern + + 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 + # + # pkg:gem/activejob#lib/active_job/enqueuing.rb:89 + def enqueue(options = T.unsafe(nil)); end +end + +# Includes the +perform_later+ method for job initialization. +# +# pkg:gem/activejob#lib/active_job/enqueuing.rb:46 +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. + # + # pkg:gem/activejob#lib/active_job/enqueuing.rb:58 + def perform_later(*, **, &); end + + private + + # pkg:gem/activejob#lib/active_job/enqueuing.rb:68 + def job_or_instantiate(*args, **); end +end + +# Provides behavior for retrying and discarding jobs on exceptions. +# +# pkg:gem/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 + # + # pkg:gem/activejob#lib/active_job/exceptions.rb:157 + def retry_job(options = T.unsafe(nil)); end + + private + + # pkg:gem/activejob#lib/active_job/exceptions.rb:167 + def determine_delay(seconds_or_duration_or_algorithm:, executions:, jitter: T.unsafe(nil)); end + + # pkg:gem/activejob#lib/active_job/exceptions.rb:188 + def determine_jitter_for_delay(delay, jitter); end + + # pkg:gem/activejob#lib/active_job/exceptions.rb:193 + def executions_for(exceptions); end + + # pkg:gem/activejob#lib/active_job/exceptions.rb:202 + 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 + +# pkg:gem/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 + # + # pkg:gem/activejob#lib/active_job/exceptions.rb:130 + 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. + # + # 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) do |job, error| + # ExceptionNotifier.caught(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 + # + # pkg:gem/activejob#lib/active_job/exceptions.rb:109 + def discard_on(*exceptions); 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 - Re-enqueues the job the specified number of times (default: 5 attempts) or a symbol reference of :unlimited + # to retry the job until it succeeds + # * :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) + # + # ==== 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) do |job, error| + # ExceptionNotifier.caught(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 + # + # pkg:gem/activejob#lib/active_job/exceptions.rb:62 + def retry_on(*exceptions, wait: T.unsafe(nil), attempts: T.unsafe(nil), queue: T.unsafe(nil), priority: T.unsafe(nil), jitter: T.unsafe(nil)); end +end + +# pkg:gem/activejob#lib/active_job/exceptions.rb:164 +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. +# +# pkg:gem/activejob#lib/active_job/execution.rb:13 +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 + + # pkg:gem/activejob#lib/active_job/execution.rb:61 + def perform(*); 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!" + # + # pkg:gem/activejob#lib/active_job/execution.rb:46 + def perform_now; end + + private + + # pkg:gem/activejob#lib/active_job/execution.rb:66 + 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. +# +# pkg:gem/activejob#lib/active_job/execution.rb:18 +module ActiveJob::Execution::ClassMethods + # pkg:gem/activejob#lib/active_job/execution.rb:27 + def execute(job_data); end + + # Performs the job immediately. + # + # MyJob.perform_now("mike") + # + # pkg:gem/activejob#lib/active_job/execution.rb:23 + def perform_now(*, **, &); end +end + +# pkg:gem/activejob#lib/active_job/instrumentation.rb:16 +module ActiveJob::Instrumentation + extend ::ActiveSupport::Concern + + # pkg:gem/activejob#lib/active_job/instrumentation.rb:25 + def perform_now; end + + private + + # pkg:gem/activejob#lib/active_job/instrumentation.rb:30 + def _perform_job; end + + # pkg:gem/activejob#lib/active_job/instrumentation.rb:47 + def halted_callback_hook(*); end + + # pkg:gem/activejob#lib/active_job/instrumentation.rb:35 + def instrument(operation, payload = T.unsafe(nil), &block); end +end + +# pkg:gem/activejob#lib/active_job/log_subscriber.rb:6 +class ActiveJob::LogSubscriber < ::ActiveSupport::LogSubscriber + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:7 + def backtrace_cleaner; end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:7 + def backtrace_cleaner=(_arg0); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:7 + def backtrace_cleaner?; end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:130 + def discard(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:9 + def enqueue(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:49 + def enqueue_all(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:29 + def enqueue_at(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:105 + def enqueue_retry(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:86 + def perform(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:76 + def perform_start(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:120 + def retry_stopped(event); end + + private + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:145 + def args_info(job); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:203 + def enqueued_jobs_message(adapter, enqueued_jobs); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:183 + def error(progname = T.unsafe(nil), &block); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:199 + def extract_enqueue_source_location(locations); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:154 + def format(arg); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:175 + def info(progname = T.unsafe(nil), &block); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:191 + def log_enqueue_source; end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:171 + def logger; end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:141 + def queue_name(event); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:167 + def scheduled_at(event); end + + class << self + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:7 + def backtrace_cleaner; end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:7 + def backtrace_cleaner=(value); end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:7 + def backtrace_cleaner?; end + + # pkg:gem/activejob#lib/active_job/log_subscriber.rb:27 + def log_levels; end + end +end + +# pkg:gem/activejob#lib/active_job/logging.rb:7 +module ActiveJob::Logging + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + + # pkg:gem/activejob#lib/active_job/logging.rb:17 + def perform_now; end + + private + + # pkg:gem/activejob#lib/active_job/logging.rb:31 + def logger_tagged_by_active_job?; end + + # pkg:gem/activejob#lib/active_job/logging.rb:22 + 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 the +:async+ queue. +# +# pkg:gem/activejob#lib/active_job/queue_adapter.rb:19 +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. +# +# pkg:gem/activejob#lib/active_job/queue_adapter.rb:32 +module ActiveJob::QueueAdapter::ClassMethods + # Returns the backend queue provider. The default queue adapter + # is the +:async+ queue. See QueueAdapters for more information. + # + # pkg:gem/activejob#lib/active_job/queue_adapter.rb:35 + def queue_adapter; end + + # Specify the backend queue provider. The default queue adapter + # is the +:async+ queue. See QueueAdapters for more + # information. + # + # pkg:gem/activejob#lib/active_job/queue_adapter.rb:48 + def queue_adapter=(name_or_adapter); end + + # Returns string denoting the name of the configured queue adapter. + # By default returns "async". + # + # pkg:gem/activejob#lib/active_job/queue_adapter.rb:41 + def queue_adapter_name; end + + private + + # pkg:gem/activejob#lib/active_job/queue_adapter.rb:64 + def assign_adapter(adapter_name, queue_adapter); end + + # pkg:gem/activejob#lib/active_job/queue_adapter.rb:71 + def queue_adapter?(object); end +end + +# pkg:gem/activejob#lib/active_job/queue_adapter.rb:69 +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] +# * {Sucker Punch}[https://github.com/brandonhilkert/sucker_punch] +# * 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 | +# | Sucker Punch | Yes | Yes | Yes | No | No | 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. +# +# pkg:gem/activejob#lib/active_job/queue_adapters.rb:114 +module ActiveJob::QueueAdapters + extend ::ActiveSupport::Autoload + + class << self + # Returns adapter for specified name. + # + # ActiveJob::QueueAdapters.lookup(:sidekiq) + # # => ActiveJob::QueueAdapters::SidekiqAdapter + # + # pkg:gem/activejob#lib/active_job/queue_adapters.rb:137 + def lookup(name); end + end +end + +# pkg:gem/activejob#lib/active_job/queue_adapters.rb:129 +ActiveJob::QueueAdapters::ADAPTER = T.let(T.unsafe(nil), String) + +# = 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. +# +# pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:33 +class ActiveJob::QueueAdapters::AsyncAdapter + # See {Concurrent::ThreadPoolExecutor}[https://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/ThreadPoolExecutor.html] for executor options. + # + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:35 + def initialize(**executor_options); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:39 + def enqueue(job); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:43 + def enqueue_at(job, timestamp); end + + # Used for our test suite. + # + # pkg:gem/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. + # + # pkg:gem/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. +# +# pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:63 +class ActiveJob::QueueAdapters::AsyncAdapter::JobWrapper + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:64 + def initialize(job); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:69 + def perform; end +end + +# pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:74 +class ActiveJob::QueueAdapters::AsyncAdapter::Scheduler + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:86 + def initialize(**options); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:92 + def enqueue(job, queue_name:); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:96 + def enqueue_at(job, timestamp, queue_name:); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:110 + def executor; end + + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:84 + def immediate; end + + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:84 + def immediate=(_arg0); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/async_adapter.rb:105 + def shutdown(wait: T.unsafe(nil)); end +end + +# pkg:gem/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 +# +# pkg:gem/activejob#lib/active_job/queue_adapters/inline_adapter.rb:13 +class ActiveJob::QueueAdapters::InlineAdapter + # pkg:gem/activejob#lib/active_job/queue_adapters/inline_adapter.rb:14 + def enqueue(job); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/inline_adapter.rb:18 + def enqueue_at(*); 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 +# +# pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:14 +class ActiveJob::QueueAdapters::TestAdapter + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def at; end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def at=(_arg0); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:28 + def enqueue(job); end + + # pkg:gem/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. + # + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:19 + def enqueued_jobs; end + + # Provides a store of all the enqueued jobs with the TestAdapter so you can check them. + # + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:16 + def enqueued_jobs=(_arg0); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def filter; end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def filter=(_arg0); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def perform_enqueued_at_jobs; end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def perform_enqueued_at_jobs=(_arg0); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def perform_enqueued_jobs; end + + # pkg:gem/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. + # + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:24 + def performed_jobs; end + + # Provides a store of all the performed jobs with the TestAdapter so you can check them. + # + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:16 + def performed_jobs=(_arg0); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def queue; end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def queue=(_arg0); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def reject; end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:15 + def reject=(_arg0); end + + private + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:79 + def filter_as_proc(filter); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:57 + def filtered?(job); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:71 + def filtered_job_class?(job); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:65 + def filtered_queue?(job); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:61 + def filtered_time?(job); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:39 + def job_to_hash(job, extras = T.unsafe(nil)); end + + # pkg:gem/activejob#lib/active_job/queue_adapters/test_adapter.rb:48 + def perform_or_enqueue(perform, job, job_data); end +end + +# pkg:gem/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. + # + # pkg:gem/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. +# +# pkg:gem/activejob#lib/active_job/queue_name.rb:8 +module ActiveJob::QueueName::ClassMethods + # pkg:gem/activejob#lib/active_job/queue_name.rb:9 + def default_queue_name; end + + # pkg:gem/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 + # + # pkg:gem/activejob#lib/active_job/queue_name.rb:39 + def queue_as(part_name = T.unsafe(nil), &block); end + + # pkg:gem/activejob#lib/active_job/queue_name.rb:47 + def queue_name_from_part(part_name); end + + class << self + # pkg:gem/activejob#lib/active_job/queue_name.rb:9 + def default_queue_name; end + + # pkg:gem/activejob#lib/active_job/queue_name.rb:9 + def default_queue_name=(val); end + end +end + +# pkg:gem/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 + # + # pkg:gem/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. +# +# pkg:gem/activejob#lib/active_job/queue_priority.rb:8 +module ActiveJob::QueuePriority::ClassMethods + # pkg:gem/activejob#lib/active_job/queue_priority.rb:9 + def default_priority; end + + # pkg:gem/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 + # + # pkg:gem/activejob#lib/active_job/queue_priority.rb:39 + def queue_with_priority(priority = T.unsafe(nil), &block); end + + class << self + # pkg:gem/activejob#lib/active_job/queue_priority.rb:9 + def default_priority; end + + # pkg:gem/activejob#lib/active_job/queue_priority.rb:9 + def default_priority=(val); end + end +end + +# = Active Job Railtie +# +# pkg:gem/activejob#lib/active_job/railtie.rb:8 +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. +# +# pkg:gem/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. +# +# pkg:gem/activejob#lib/active_job/serializers.rb:10 +module ActiveJob::Serializers + extend ::ActiveSupport::Autoload + + # pkg:gem/activejob#lib/active_job/serializers.rb:25 + def _additional_serializers; end + + # pkg:gem/activejob#lib/active_job/serializers.rb:25 + def _additional_serializers=(val); end + + class << self + # pkg:gem/activejob#lib/active_job/serializers.rb:25 + def _additional_serializers; end + + # pkg:gem/activejob#lib/active_job/serializers.rb:25 + def _additional_serializers=(val); end + + # Adds new serializers to a list of known serializers. + # + # pkg:gem/activejob#lib/active_job/serializers.rb:57 + def add_serializers(*new_serializers); end + + # Returns deserialized object. + # Will look up through all known serializers. + # If no serializer found will raise ArgumentError. + # + # pkg:gem/activejob#lib/active_job/serializers.rb:41 + 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. + # + # pkg:gem/activejob#lib/active_job/serializers.rb:32 + def serialize(argument); end + + # Returns list of known serializers. + # + # pkg:gem/activejob#lib/active_job/serializers.rb:52 + def serializers; end + end +end + +# pkg:gem/activejob#lib/active_job/serializers/big_decimal_serializer.rb:7 +class ActiveJob::Serializers::BigDecimalSerializer < ::ActiveJob::Serializers::ObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/big_decimal_serializer.rb:12 + def deserialize(hash); end + + # pkg:gem/activejob#lib/active_job/serializers/big_decimal_serializer.rb:8 + def serialize(big_decimal); end + + private + + # pkg:gem/activejob#lib/active_job/serializers/big_decimal_serializer.rb:17 + def klass; end +end + +# pkg:gem/activejob#lib/active_job/serializers/date_serializer.rb:5 +class ActiveJob::Serializers::DateSerializer < ::ActiveJob::Serializers::ObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/date_serializer.rb:10 + def deserialize(hash); end + + # pkg:gem/activejob#lib/active_job/serializers/date_serializer.rb:6 + def serialize(date); end + + private + + # pkg:gem/activejob#lib/active_job/serializers/date_serializer.rb:15 + def klass; end +end + +# pkg:gem/activejob#lib/active_job/serializers/date_time_serializer.rb:5 +class ActiveJob::Serializers::DateTimeSerializer < ::ActiveJob::Serializers::TimeObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/date_time_serializer.rb:6 + def deserialize(hash); end + + private + + # pkg:gem/activejob#lib/active_job/serializers/date_time_serializer.rb:11 + def klass; end +end + +# pkg:gem/activejob#lib/active_job/serializers/duration_serializer.rb:5 +class ActiveJob::Serializers::DurationSerializer < ::ActiveJob::Serializers::ObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/duration_serializer.rb:12 + def deserialize(hash); end + + # pkg:gem/activejob#lib/active_job/serializers/duration_serializer.rb:6 + def serialize(duration); end + + private + + # pkg:gem/activejob#lib/active_job/serializers/duration_serializer.rb:20 + def klass; end +end + +# pkg:gem/activejob#lib/active_job/serializers/module_serializer.rb:5 +class ActiveJob::Serializers::ModuleSerializer < ::ActiveJob::Serializers::ObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/module_serializer.rb:11 + def deserialize(hash); end + + # pkg:gem/activejob#lib/active_job/serializers/module_serializer.rb:6 + def serialize(constant); end + + private + + # pkg:gem/activejob#lib/active_job/serializers/module_serializer.rb:16 + def klass; 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 +# +# private +# +# def klass +# Money +# end +# end +# +# pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:24 +class ActiveJob::Serializers::ObjectSerializer + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # Deserializes an argument from a JSON primitive type. + # + # pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:42 + def deserialize(json); end + + # Serializes an argument to a JSON primitive type. + # + # pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:37 + def serialize(hash); end + + # Determines if an argument should be serialized by a serializer. + # + # pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:32 + def serialize?(argument); end + + private + + # The class of the object that will be serialized. + # + # pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:48 + def klass; end + + class << self + # Deserializes an argument from a JSON primitive type. + # + # pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:28 + def deserialize(*, **, &); end + + # Serializes an argument to a JSON primitive type. + # + # pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:28 + def serialize(*, **, &); end + + # Determines if an argument should be serialized by a serializer. + # + # pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:28 + def serialize?(*, **, &); end + + private + + # pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:25 + def allocate; end + + # pkg:gem/activejob#lib/active_job/serializers/object_serializer.rb:25 + def new(*_arg0); end + end +end + +# pkg:gem/activejob#lib/active_job/serializers/range_serializer.rb:5 +class ActiveJob::Serializers::RangeSerializer < ::ActiveJob::Serializers::ObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/range_serializer.rb:13 + def deserialize(hash); end + + # pkg:gem/activejob#lib/active_job/serializers/range_serializer.rb:8 + def serialize(range); end + + private + + # pkg:gem/activejob#lib/active_job/serializers/range_serializer.rb:18 + def klass; end +end + +# pkg:gem/activejob#lib/active_job/serializers/range_serializer.rb:6 +ActiveJob::Serializers::RangeSerializer::KEYS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activejob#lib/active_job/serializers/symbol_serializer.rb:5 +class ActiveJob::Serializers::SymbolSerializer < ::ActiveJob::Serializers::ObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/symbol_serializer.rb:10 + def deserialize(argument); end + + # pkg:gem/activejob#lib/active_job/serializers/symbol_serializer.rb:6 + def serialize(argument); end + + private + + # pkg:gem/activejob#lib/active_job/serializers/symbol_serializer.rb:15 + def klass; end +end + +# pkg:gem/activejob#lib/active_job/serializers/time_object_serializer.rb:5 +class ActiveJob::Serializers::TimeObjectSerializer < ::ActiveJob::Serializers::ObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/time_object_serializer.rb:8 + def serialize(time); end +end + +# pkg:gem/activejob#lib/active_job/serializers/time_object_serializer.rb:6 +ActiveJob::Serializers::TimeObjectSerializer::NANO_PRECISION = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activejob#lib/active_job/serializers/time_serializer.rb:5 +class ActiveJob::Serializers::TimeSerializer < ::ActiveJob::Serializers::TimeObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/time_serializer.rb:6 + def deserialize(hash); end + + private + + # pkg:gem/activejob#lib/active_job/serializers/time_serializer.rb:11 + def klass; end +end + +# pkg:gem/activejob#lib/active_job/serializers/time_with_zone_serializer.rb:5 +class ActiveJob::Serializers::TimeWithZoneSerializer < ::ActiveJob::Serializers::ObjectSerializer + # pkg:gem/activejob#lib/active_job/serializers/time_with_zone_serializer.rb:15 + def deserialize(hash); end + + # pkg:gem/activejob#lib/active_job/serializers/time_with_zone_serializer.rb:8 + def serialize(time_with_zone); end + + private + + # pkg:gem/activejob#lib/active_job/serializers/time_with_zone_serializer.rb:20 + def klass; end +end + +# pkg:gem/activejob#lib/active_job/serializers/time_with_zone_serializer.rb:6 +ActiveJob::Serializers::TimeWithZoneSerializer::NANO_PRECISION = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activejob#lib/active_job/test_case.rb:6 +class ActiveJob::TestCase < ::ActiveSupport::TestCase + include ::ActiveJob::TestHelper +end + +# Provides helper methods for testing Active Job +# +# pkg:gem/activejob#lib/active_job/test_helper.rb:8 +module ActiveJob::TestHelper + include ::ActiveSupport::Testing::Assertions + + # pkg:gem/activejob#lib/active_job/test_helper.rb:53 + 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 + # + # pkg:gem/activejob#lib/active_job/test_helper.rb:120 + 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 + # + # pkg:gem/activejob#lib/active_job/test_helper.rb:396 + 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 + # + # pkg:gem/activejob#lib/active_job/test_helper.rb:182 + 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 + # + # pkg:gem/activejob#lib/active_job/test_helper.rb:340 + 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 + # + # pkg:gem/activejob#lib/active_job/test_helper.rb:272 + 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 + # + # pkg:gem/activejob#lib/active_job/test_helper.rb:498 + 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 + + # pkg:gem/activejob#lib/active_job/test_helper.rb:41 + def before_setup; end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:9 + def enqueued_jobs(*, **, &); end + + # pkg:gem/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. + # + # pkg:gem/activejob#lib/active_job/test_helper.rb:606 + def perform_enqueued_jobs(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), at: T.unsafe(nil), &block); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:9 + def performed_jobs(*, **, &); end + + # pkg:gem/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 + # + # pkg:gem/activejob#lib/active_job/test_helper.rb:644 + 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. + # + # pkg:gem/activejob#lib/active_job/test_helper.rb:63 + def queue_adapter_for_test; end + + private + + # pkg:gem/activejob#lib/active_job/test_helper.rb:653 + def clear_enqueued_jobs; end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:657 + def clear_performed_jobs; end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:722 + def deserialize_args_for_assertion(job); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:693 + def enqueued_jobs_with(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), at: T.unsafe(nil), &block); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:687 + def filter_as_proc(filter); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:701 + def flush_enqueued_jobs(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), at: T.unsafe(nil)); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:729 + def instantiate_job(payload, skip_deserialize_arguments: T.unsafe(nil)); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:661 + def jobs_with(jobs, only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), at: T.unsafe(nil)); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:697 + def performed_jobs_with(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), &block); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:709 + def prepare_args_for_assertion(args); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:736 + def queue_adapter_changed_jobs; end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:649 + def using_test_adapter?; end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:743 + def validate_option(only: T.unsafe(nil), except: T.unsafe(nil)); end +end + +# pkg:gem/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 + +# pkg:gem/activejob#lib/active_job/test_helper.rb:22 +module ActiveJob::TestHelper::TestQueueAdapter::ClassMethods + # pkg:gem/activejob#lib/active_job/test_helper.rb:27 + def disable_test_adapter; end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:31 + def enable_test_adapter(test_adapter); end + + # pkg:gem/activejob#lib/active_job/test_helper.rb:23 + def queue_adapter; end +end + +# pkg:gem/activejob#lib/active_job/timezones.rb:4 +module ActiveJob::Timezones + extend ::ActiveSupport::Concern +end + +# pkg:gem/activejob#lib/active_job/translation.rb:4 +module ActiveJob::Translation + extend ::ActiveSupport::Concern +end + +# pkg:gem/activejob#lib/active_job/gem_version.rb:9 +module ActiveJob::VERSION; end + +# pkg:gem/activejob#lib/active_job/gem_version.rb:10 +ActiveJob::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activejob#lib/active_job/gem_version.rb:11 +ActiveJob::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activejob#lib/active_job/gem_version.rb:13 +ActiveJob::VERSION::PRE = T.let(T.unsafe(nil), String) + +# pkg:gem/activejob#lib/active_job/gem_version.rb:15 +ActiveJob::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/activejob#lib/active_job/gem_version.rb:12 +ActiveJob::VERSION::TINY = T.let(T.unsafe(nil), Integer) diff --git a/sorbet/rbi/gems/activemodel@7.1.3.4.rbi b/sorbet/rbi/gems/activemodel@7.1.3.4.rbi new file mode 100644 index 000000000..76dba4a7f --- /dev/null +++ b/sorbet/rbi/gems/activemodel@7.1.3.4.rbi @@ -0,0 +1,6144 @@ +# 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: activemodel/README.rdoc +# +# pkg:gem/activemodel#lib/active_model/gem_version.rb:3 +module ActiveModel + extend ::ActiveSupport::Autoload + + class << self + # pkg:gem/activemodel#lib/active_model/deprecator.rb:4 + def deprecator; end + + # pkg:gem/activemodel#lib/active_model.rb:76 + def eager_load!; end + + # Returns the currently loaded version of \Active \Model as a +Gem::Version+. + # + # pkg:gem/activemodel#lib/active_model/gem_version.rb:5 + def gem_version; end + + # Returns the currently loaded version of \Active \Model as a +Gem::Version+. + # + # pkg:gem/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). +# +# pkg:gem/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" + # + # pkg:gem/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 + # + # pkg:gem/activemodel#lib/active_model/api.rb:95 + def persisted?; end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def __callbacks?; 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 __callbacks?; end + def _validators; end + def _validators?; end + def param_delimiter=(value); end + end +end + +# pkg:gem/activemodel#lib/active_model/access.rb:7 +module ActiveModel::Access + # pkg:gem/activemodel#lib/active_model/access.rb:8 + def slice(*methods); end + + # pkg:gem/activemodel#lib/active_model/access.rb:12 + def values_at(*methods); end +end + +# pkg:gem/activemodel#lib/active_model/attribute.rb:6 +class ActiveModel::Attribute + # This method should not be called directly. + # Use #from_database or #from_user + # + # pkg:gem/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 + + # pkg:gem/activemodel#lib/active_model/attribute.rb:115 + def ==(other); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:107 + def came_from_user?; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:66 + def changed?; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:70 + def changed_in_place?; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:135 + def encode_with(coder); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:121 + def eql?(other); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:74 + def forgetting_assignment; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:111 + def has_been_read?; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:123 + def hash; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:127 + def init_with(coder); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:103 + def initialized?; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:29 + def name; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:47 + def original_value; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:143 + def original_value_for_database; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:62 + def serializable?(&block); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:29 + def type; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:99 + def type_cast(*); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:41 + def value; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:29 + def value_before_type_cast; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:55 + def value_for_database; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:87 + def with_cast_value(value); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:91 + def with_type(type); end + + # pkg:gem/activemodel#lib/active_model/attribute/user_provided_default.rb:7 + def with_user_default(value); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:83 + def with_value_from_database(value); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:78 + def with_value_from_user(value); end + + private + + # pkg:gem/activemodel#lib/active_model/attribute.rb:169 + def _original_value_for_database; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:165 + def _value_for_database; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:153 + def assigned?; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:161 + def changed_from_assignment?; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:155 + def initialize_dup(other); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:152 + def original_attribute; end + + class << self + # pkg:gem/activemodel#lib/active_model/attribute.rb:8 + def from_database(name, value_before_type_cast, type, value = T.unsafe(nil)); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:12 + def from_user(name, value_before_type_cast, type, original_attribute = T.unsafe(nil)); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:20 + def null(name); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:24 + def uninitialized(name, type); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:16 + def with_cast_value(name, value_before_type_cast, type); end + end +end + +# pkg:gem/activemodel#lib/active_model/attribute.rb:173 +class ActiveModel::Attribute::FromDatabase < ::ActiveModel::Attribute + # pkg:gem/activemodel#lib/active_model/attribute.rb:178 + def forgetting_assignment; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:174 + def type_cast(value); end + + private + + # pkg:gem/activemodel#lib/active_model/attribute.rb:192 + def _original_value_for_database; end +end + +# pkg:gem/activemodel#lib/active_model/attribute.rb:197 +class ActiveModel::Attribute::FromUser < ::ActiveModel::Attribute + # pkg:gem/activemodel#lib/active_model/attribute.rb:202 + def came_from_user?; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:198 + def type_cast(value); end + + private + + # pkg:gem/activemodel#lib/active_model/attribute.rb:207 + def _value_for_database; end +end + +# pkg:gem/activemodel#lib/active_model/attribute.rb:222 +class ActiveModel::Attribute::Null < ::ActiveModel::Attribute + # pkg:gem/activemodel#lib/active_model/attribute.rb:223 + def initialize(name); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:227 + def type_cast(*); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:239 + def with_cast_value(value); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:231 + def with_type(type); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:235 + def with_value_from_database(value); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:238 + def with_value_from_user(value); end +end + +# pkg:gem/activemodel#lib/active_model/attribute.rb:242 +class ActiveModel::Attribute::Uninitialized < ::ActiveModel::Attribute + # pkg:gem/activemodel#lib/active_model/attribute.rb:245 + def initialize(name, type); end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:266 + def forgetting_assignment; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:262 + def initialized?; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:255 + def original_value; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:249 + def value; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:259 + def value_for_database; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:270 + def with_type(type); end +end + +# pkg:gem/activemodel#lib/active_model/attribute.rb:243 +ActiveModel::Attribute::Uninitialized::UNINITIALIZED_ORIGINAL_VALUE = T.let(T.unsafe(nil), Object) + +# pkg:gem/activemodel#lib/active_model/attribute/user_provided_default.rb:11 +class ActiveModel::Attribute::UserProvidedDefault < ::ActiveModel::Attribute::FromUser + # pkg:gem/activemodel#lib/active_model/attribute/user_provided_default.rb:12 + def initialize(name, value, type, database_default); end + + # pkg:gem/activemodel#lib/active_model/attribute/user_provided_default.rb:29 + def marshal_dump; end + + # pkg:gem/activemodel#lib/active_model/attribute/user_provided_default.rb:40 + def marshal_load(values); end + + # pkg:gem/activemodel#lib/active_model/attribute/user_provided_default.rb:17 + def value_before_type_cast; end + + # pkg:gem/activemodel#lib/active_model/attribute/user_provided_default.rb:25 + def with_type(type); end + + private + + # pkg:gem/activemodel#lib/active_model/attribute/user_provided_default.rb:52 + def user_provided_value; end +end + +# pkg:gem/activemodel#lib/active_model/attribute.rb:212 +class ActiveModel::Attribute::WithCastValue < ::ActiveModel::Attribute + # pkg:gem/activemodel#lib/active_model/attribute.rb:217 + def changed_in_place?; end + + # pkg:gem/activemodel#lib/active_model/attribute.rb:213 + def type_cast(value); end +end + +# pkg:gem/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' + # + # pkg:gem/activemodel#lib/active_model/attribute_assignment.rb:28 + def assign_attributes(new_attributes); end + + # pkg:gem/activemodel#lib/active_model/attribute_assignment.rb:37 + def attributes=(new_attributes); end + + private + + # pkg:gem/activemodel#lib/active_model/attribute_assignment.rb:46 + def _assign_attribute(k, v); end + + # pkg:gem/activemodel#lib/active_model/attribute_assignment.rb:40 + 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 +# +# pkg:gem/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. + # + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:498 + def attribute_missing(match, *args, **, &block); 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. + # + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:484 + def method_missing(method, *args, **, &block); end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:507 + 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+. + # + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:506 + def respond_to_without_attributes?(*_arg0); end + + private + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:535 + def _read_attribute(attr); end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:520 + def attribute_method?(attr_name); end + + # Returns a struct representing the matching attribute method. + # The struct's attributes are prefix, base and suffix. + # + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:526 + def matched_attribute_method(method_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:531 + 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 + +# pkg:gem/activemodel#lib/active_model/attribute_methods.rb:539 +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. + # + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:556 + def define_attribute_accessor_method(owner, attr_name, writer: T.unsafe(nil)); end + end +end + +# pkg:gem/activemodel#lib/active_model/attribute_methods.rb:540 +ActiveModel::AttributeMethods::AttrNames::DEF_SAFE_NAME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activemodel#lib/active_model/attribute_methods.rb:68 +ActiveModel::AttributeMethods::CALL_COMPILABLE_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activemodel#lib/active_model/attribute_methods.rb:76 +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 + # + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:204 + def alias_attribute(new_name, old_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:224 + def alias_attribute_method_definition(code_generator, pattern, new_name, old_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:375 + def aliases_by_attribute_name; end + + # Returns the original name for the alias +name+ + # + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:258 + def attribute_alias(name); end + + # Is +new_name+ an alias? + # + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:253 + 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' + # + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:176 + 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 + # + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:107 + 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 + # + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:141 + 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 + # + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:324 + def define_attribute_method(attr_name, _owner: 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 + # + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:285 + def define_attribute_methods(*attr_names); end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:212 + def eagerly_generate_alias_attribute_methods(new_name, old_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:218 + 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 + # + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:368 + 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). + # + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:408 + def attribute_method_patterns_cache; end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:412 + def attribute_method_patterns_matching(method_name); 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. + # + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:421 + def define_proxy_call(code_generator, name, proxy_target, parameters, *call_args, namespace:); end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:391 + def generated_attribute_methods; end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:380 + def inherited(base); end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:395 + def instance_method_already_implemented?(method_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:387 + def resolve_attribute_name(name); end +end + +# pkg:gem/activemodel#lib/active_model/attribute_methods.rb:448 +class ActiveModel::AttributeMethods::ClassMethods::AttributeMethodPattern + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:453 + def initialize(prefix: T.unsafe(nil), suffix: T.unsafe(nil), parameters: T.unsafe(nil)); end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:462 + def match(method_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:468 + def method_name(attr_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:449 + def parameters; end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:449 + def prefix; end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:449 + def proxy_target; end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:449 + def suffix; end +end + +# pkg:gem/activemodel#lib/active_model/attribute_methods.rb:451 +class ActiveModel::AttributeMethods::ClassMethods::AttributeMethodPattern::AttributeMethod < ::Struct + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:451 + def attr_name; end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:451 + def attr_name=(_); end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:451 + def proxy_target; end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:451 + def proxy_target=(_); end + + class << self + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:451 + def [](*_arg0); end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:451 + def inspect; end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:451 + def keyword_init?; end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:451 + def members; end + + # pkg:gem/activemodel#lib/active_model/attribute_methods.rb:451 + def new(*_arg0); end + end +end + +# pkg:gem/activemodel#lib/active_model/attribute_methods.rb:69 +ActiveModel::AttributeMethods::FORWARD_PARAMETERS = T.let(T.unsafe(nil), String) + +# pkg:gem/activemodel#lib/active_model/attribute_methods.rb:67 +ActiveModel::AttributeMethods::NAME_COMPILABLE_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:7 +class ActiveModel::AttributeMutationTracker + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:10 + def initialize(attributes); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:40 + def any_changes?; end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:34 + def change_to_attribute(attr_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:44 + def changed?(attr_name, from: T.unsafe(nil), to: T.unsafe(nil)); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:14 + def changed_attribute_names; end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:50 + def changed_in_place?(attr_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:18 + def changed_values; end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:26 + def changes; end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:63 + def force_change(attr_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:54 + def forget_change(attr_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:59 + def original_value(attr_name); end + + private + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:74 + def attr_names; end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:78 + def attribute_changed?(attr_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:68 + def attributes; end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:82 + def fetch_value(attr_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:70 + def forced_changes; end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:86 + def type_cast(attr_name, value); end +end + +# pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:8 +ActiveModel::AttributeMutationTracker::OPTION_NOT_GIVEN = T.let(T.unsafe(nil), Object) + +# pkg:gem/activemodel#lib/active_model/attribute_registration.rb:8 +module ActiveModel::AttributeRegistration + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveModel::AttributeRegistration::ClassMethods +end + +# pkg:gem/activemodel#lib/active_model/attribute_registration.rb:11 +module ActiveModel::AttributeRegistration::ClassMethods + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:22 + def _default_attributes; end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:12 + def attribute(name, type = T.unsafe(nil), default: T.unsafe(nil), **options); end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:26 + def attribute_types; end + + private + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:48 + def apply_pending_attributes(attribute_set); end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:58 + def build_default_attributes; end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:43 + def pending_attribute(name); end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:62 + def reset_default_attributes; end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:68 + def resolve_attribute_name(name); end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:72 + def resolve_type_name(name, **options); end +end + +# pkg:gem/activemodel#lib/active_model/attribute_registration.rb:33 +class ActiveModel::AttributeRegistration::ClassMethods::PendingAttribute + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:36 + def apply_to(attribute); end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:34 + def default; end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:34 + def default=(_arg0); end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:34 + def type; end + + # pkg:gem/activemodel#lib/active_model/attribute_registration.rb:34 + def type=(_arg0); end +end + +# pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:6 +class ActiveModel::AttributeSet + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:12 + def initialize(attributes); end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:106 + def ==(other); end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:16 + def [](name); end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:20 + def []=(name, value); end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:93 + def accessed; end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:24 + def cast_types; end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:73 + def deep_dup; end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:10 + def each_value(*, **, &); end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:10 + def except(*, **, &); end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:10 + def fetch(*, **, &); end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:50 + def fetch_value(name, &block); end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:68 + def freeze; end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:44 + def include?(name); end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:41 + def key?(name); end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:46 + def keys; end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:97 + def map(&block); end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:87 + def reset(key); end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:102 + def reverse_merge!(target_attributes); end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:39 + def to_h; end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:36 + def to_hash; end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:28 + def values_before_type_cast; end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:32 + def values_for_database; end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:64 + def write_cast_value(name, value); end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:54 + def write_from_database(name, value); end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:58 + def write_from_user(name, value); end + + protected + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:111 + def attributes; end + + private + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:114 + def default_attribute(name); end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:82 + def initialize_clone(_); end + + # pkg:gem/activemodel#lib/active_model/attribute_set.rb:77 + def initialize_dup(_); end +end + +# pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:7 +class ActiveModel::AttributeSet::Builder + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:10 + def initialize(types, default_attributes = T.unsafe(nil)); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:15 + def build_from_database(values = T.unsafe(nil), additional_types = T.unsafe(nil)); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:8 + def default_attributes; end + + # pkg:gem/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 +# +# pkg:gem/activemodel#lib/active_model/attribute_set/yaml_encoder.rb:7 +class ActiveModel::AttributeSet::YAMLEncoder + # pkg:gem/activemodel#lib/active_model/attribute_set/yaml_encoder.rb:8 + def initialize(default_types); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/yaml_encoder.rb:22 + def decode(coder); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/yaml_encoder.rb:12 + def encode(attribute_set, coder); end + + private + + # pkg:gem/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 +# +# pkg:gem/activemodel#lib/active_model/attributes.rb:30 +module ActiveModel::Attributes + extend ::ActiveSupport::Concern + 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 + + # pkg:gem/activemodel#lib/active_model/attributes.rb:93 + def initialize(*); 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"] + # + # pkg:gem/activemodel#lib/active_model/attributes.rb:133 + 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} + # + # pkg:gem/activemodel#lib/active_model/attributes.rb:118 + def attributes; end + + # pkg:gem/activemodel#lib/active_model/attributes.rb:137 + def freeze; end + + private + + # pkg:gem/activemodel#lib/active_model/attributes.rb:143 + def _write_attribute(attr_name, value); end + + # pkg:gem/activemodel#lib/active_model/attributes.rb:148 + def attribute(attr_name); end + + # pkg:gem/activemodel#lib/active_model/attributes.rb:146 + def attribute=(attr_name, value); end + + # pkg:gem/activemodel#lib/active_model/attributes.rb:98 + 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 + +# pkg:gem/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 + # + # pkg:gem/activemodel#lib/active_model/attributes.rb:59 + def attribute(name, *, **, &); 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"] + # + # pkg:gem/activemodel#lib/active_model/attributes.rb:74 + def attribute_names; end + + private + + # pkg:gem/activemodel#lib/active_model/attributes.rb:79 + def define_method_attribute=(name, owner:); 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. +# +# pkg:gem/activemodel#lib/active_model/validator.rb:179 +class ActiveModel::BlockValidator < ::ActiveModel::EachValidator + # pkg:gem/activemodel#lib/active_model/validator.rb:180 + def initialize(options, &block); end + + private + + # pkg:gem/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: Calling the same callback multiple times will overwrite previous callback definitions. +# +# pkg:gem/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 =. + # + # pkg:gem/activemodel#lib/active_model/callbacks.rb:109 + def define_model_callbacks(*callbacks); end + + private + + # pkg:gem/activemodel#lib/active_model/callbacks.rb:143 + def _define_after_model_callback(klass, callback); end + + # pkg:gem/activemodel#lib/active_model/callbacks.rb:136 + def _define_around_model_callback(klass, callback); end + + # pkg:gem/activemodel#lib/active_model/callbacks.rb:129 + def _define_before_model_callback(klass, callback); end + + class << self + # pkg:gem/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" +# +# pkg:gem/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] + # + # pkg:gem/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. + # + # pkg:gem/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" + # + # pkg:gem/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" + # + # pkg:gem/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 + +# pkg:gem/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. + # + # pkg:gem/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-label:method-i-2A_will_change-21] 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"). +# +# pkg:gem/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 + + # pkg:gem/activemodel#lib/active_model/dirty.rb:258 + def as_json(options = T.unsafe(nil)); end + + # Dispatch target for {*_changed?}[rdoc-label:method-i-2A_changed-3F] attribute methods. + # + # pkg:gem/activemodel#lib/active_model/dirty.rb:293 + def attribute_changed?(attr_name, **options); end + + # pkg:gem/activemodel#lib/active_model/dirty.rb:360 + def attribute_changed_in_place?(attr_name); end + + # Dispatch target for {*_previously_changed?}[rdoc-label:method-i-2A_previously_changed-3F] attribute methods. + # + # pkg:gem/activemodel#lib/active_model/dirty.rb:303 + def attribute_previously_changed?(attr_name, **options); end + + # Dispatch target for {*_previously_was}[rdoc-label:method-i-2A_previously_was] attribute methods. + # + # pkg:gem/activemodel#lib/active_model/dirty.rb:308 + def attribute_previously_was(attr_name); end + + # Dispatch target for {*_was}[rdoc-label:method-i-2A_was] attribute methods. + # + # pkg:gem/activemodel#lib/active_model/dirty.rb:298 + 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"] + # + # pkg:gem/activemodel#lib/active_model/dirty.rb:288 + def changed; end + + # Returns +true+ if any of the attributes has unsaved changes, +false+ otherwise. + # + # person.changed? # => false + # person.name = 'bob' + # person.changed? # => true + # + # pkg:gem/activemodel#lib/active_model/dirty.rb:279 + 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"} + # + # pkg:gem/activemodel#lib/active_model/dirty.rb:336 + 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"] } + # + # pkg:gem/activemodel#lib/active_model/dirty.rb:346 + def changes; end + + # Clears dirty data and moves +changes+ to +previous_changes+ and + # +mutations_from_database+ to +mutations_before_last_save+ respectively. + # + # pkg:gem/activemodel#lib/active_model/dirty.rb:265 + def changes_applied; end + + # pkg:gem/activemodel#lib/active_model/dirty.rb:324 + def clear_attribute_changes(attr_names); end + + # Clears all dirty data: current changes and previous changes. + # + # pkg:gem/activemodel#lib/active_model/dirty.rb:318 + def clear_changes_information; 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"]} + # + # pkg:gem/activemodel#lib/active_model/dirty.rb:356 + def previous_changes; end + + # Restore all previous data of the provided attributes. + # + # pkg:gem/activemodel#lib/active_model/dirty.rb:313 + def restore_attributes(attr_names = T.unsafe(nil)); end + + private + + # Dispatch target for *_change attribute methods. + # + # pkg:gem/activemodel#lib/active_model/dirty.rb:392 + def attribute_change(attr_name); end + + # Dispatch target for *_previous_change attribute methods. + # + # pkg:gem/activemodel#lib/active_model/dirty.rb:397 + def attribute_previous_change(attr_name); end + + # Dispatch target for *_will_change! attribute methods. + # + # pkg:gem/activemodel#lib/active_model/dirty.rb:402 + def attribute_will_change!(attr_name); end + + # pkg:gem/activemodel#lib/active_model/dirty.rb:371 + def clear_attribute_change(attr_name); end + + # pkg:gem/activemodel#lib/active_model/dirty.rb:383 + def forget_attribute_assignments; end + + # pkg:gem/activemodel#lib/active_model/dirty.rb:365 + def init_internals; end + + # pkg:gem/activemodel#lib/active_model/dirty.rb:248 + def initialize_dup(other); end + + # pkg:gem/activemodel#lib/active_model/dirty.rb:387 + def mutations_before_last_save; end + + # pkg:gem/activemodel#lib/active_model/dirty.rb:375 + def mutations_from_database; end + + # Dispatch target for restore_*! attribute methods. + # + # pkg:gem/activemodel#lib/active_model/dirty.rb:407 + 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. +# +# pkg:gem/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. + # + # pkg:gem/activemodel#lib/active_model/validator.rb:140 + def initialize(options); end + + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activemodel#lib/active_model/validator.rb:161 + def validate_each(record, attribute, value); end + + private + + # pkg:gem/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 +# +# pkg:gem/activemodel#lib/active_model/error.rb:9 +class ActiveModel::Error + # pkg:gem/activemodel#lib/active_model/error.rb:103 + def initialize(base, attribute, type = T.unsafe(nil), **options); end + + # pkg:gem/activemodel#lib/active_model/error.rb:190 + def ==(other); end + + # The attribute of +base+ which the error belongs to + # + # pkg:gem/activemodel#lib/active_model/error.rb:121 + def attribute; end + + # The object which the error belongs to + # + # pkg:gem/activemodel#lib/active_model/error.rb:119 + def base; end + + # pkg:gem/activemodel#lib/active_model/error.rb:152 + def detail; end + + # Returns the error details. + # + # error = ActiveModel::Error.new(person, :name, :too_short, count: 5) + # error.details + # # => { error: :too_short, count: 5 } + # + # pkg:gem/activemodel#lib/active_model/error.rb:149 + def details; end + + # pkg:gem/activemodel#lib/active_model/error.rb:193 + 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)" + # + # pkg:gem/activemodel#lib/active_model/error.rb:159 + def full_message; end + + # pkg:gem/activemodel#lib/active_model/error.rb:195 + def hash; end + + # pkg:gem/activemodel#lib/active_model/error.rb:13 + def i18n_customize_full_message; end + + # pkg:gem/activemodel#lib/active_model/error.rb:13 + def i18n_customize_full_message=(_arg0); end + + # pkg:gem/activemodel#lib/active_model/error.rb:13 + def i18n_customize_full_message?; end + + # pkg:gem/activemodel#lib/active_model/error.rb:199 + def inspect; end + + # See if error matches provided +attribute+, +type+, and +options+. + # + # Omitted params are not checked for a match. + # + # pkg:gem/activemodel#lib/active_model/error.rb:166 + 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)" + # + # pkg:gem/activemodel#lib/active_model/error.rb:135 + def message; end + + # The options provided when calling errors#add + # + # pkg:gem/activemodel#lib/active_model/error.rb:128 + def options; end + + # The raw value provided as the second parameter when calling + # errors#add + # + # pkg:gem/activemodel#lib/active_model/error.rb:126 + 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. + # + # pkg:gem/activemodel#lib/active_model/error.rb:184 + def strict_match?(attribute, type, **options); end + + # The type of error, defaults to +:invalid+ unless specified + # + # pkg:gem/activemodel#lib/active_model/error.rb:123 + def type; end + + protected + + # pkg:gem/activemodel#lib/active_model/error.rb:204 + def attributes_for_hash; end + + private + + # pkg:gem/activemodel#lib/active_model/error.rb:111 + def initialize_dup(other); end + + class << self + # pkg:gem/activemodel#lib/active_model/error.rb:15 + def full_message(attribute, message, base); end + + # pkg:gem/activemodel#lib/active_model/error.rb:64 + def generate_message(attribute, type, base, options); end + + # pkg:gem/activemodel#lib/active_model/error.rb:13 + def i18n_customize_full_message; end + + # pkg:gem/activemodel#lib/active_model/error.rb:13 + def i18n_customize_full_message=(value); end + + # pkg:gem/activemodel#lib/active_model/error.rb:13 + def i18n_customize_full_message?; end + end +end + +# pkg:gem/activemodel#lib/active_model/error.rb:10 +ActiveModel::Error::CALLBACKS_OPTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activemodel#lib/active_model/error.rb:11 +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.. +# +# pkg:gem/activemodel#lib/active_model/errors.rb:61 +class ActiveModel::Errors + include ::Enumerable + extend ::Forwardable + + # Pass in the instance of the object that is using the errors object. + # + # class Person + # def initialize + # @errors = ActiveModel::Errors.new(self) + # end + # end + # + # pkg:gem/activemodel#lib/active_model/errors.rb:117 + 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"] + # + # pkg:gem/activemodel#lib/active_model/errors.rb:229 + 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}]} + # + # pkg:gem/activemodel#lib/active_model/errors.rb:342 + 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 + # + # pkg:gem/activemodel#lib/active_model/errors.rb:372 + 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"]} + # + # pkg:gem/activemodel#lib/active_model/errors.rb:247 + 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] + # + # pkg:gem/activemodel#lib/active_model/errors.rb:237 + def attribute_names; end + + # pkg:gem/activemodel#lib/active_model/errors.rb:103 + def clear(*args, **, &block); 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) + # + # pkg:gem/activemodel#lib/active_model/errors.rb:138 + 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] # => [] + # + # pkg:gem/activemodel#lib/active_model/errors.rb:215 + def delete(attribute, type = T.unsafe(nil), **options); end + + # Returns a Hash of attributes with an array of their error details. + # + # pkg:gem/activemodel#lib/active_model/errors.rb:276 + def details; end + + # pkg:gem/activemodel#lib/active_model/errors.rb:103 + def each(*args, **, &block); end + + # pkg:gem/activemodel#lib/active_model/errors.rb:103 + def empty?(*args, **, &block); end + + # The actual array of +Error+ objects + # This method is aliased to objects. + # + # pkg:gem/activemodel#lib/active_model/errors.rb:107 + def errors; end + + # Returns a full message for a given attribute. + # + # person.errors.full_message(:name, 'is invalid') # => "Name is invalid" + # + # pkg:gem/activemodel#lib/active_model/errors.rb:451 + 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"] + # + # pkg:gem/activemodel#lib/active_model/errors.rb:415 + 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"] + # + # pkg:gem/activemodel#lib/active_model/errors.rb:430 + 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 + # + # pkg:gem/activemodel#lib/active_model/errors.rb:479 + 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>]} + # + # pkg:gem/activemodel#lib/active_model/errors.rb:289 + def group_by_attribute; end + + # pkg:gem/activemodel#lib/active_model/errors.rb:207 + 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. + # + # pkg:gem/activemodel#lib/active_model/errors.rb:154 + 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 + # + # pkg:gem/activemodel#lib/active_model/errors.rb:202 + def include?(attribute); end + + # pkg:gem/activemodel#lib/active_model/errors.rb:483 + def inspect; end + + # pkg:gem/activemodel#lib/active_model/errors.rb:208 + 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) + # + # pkg:gem/activemodel#lib/active_model/errors.rb:174 + def merge!(other); end + + # Returns a Hash of attributes with an array of their error messages. + # + # pkg:gem/activemodel#lib/active_model/errors.rb:268 + 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"] + # + # pkg:gem/activemodel#lib/active_model/errors.rb:444 + def messages_for(attribute); end + + # pkg:gem/activemodel#lib/active_model/errors.rb:108 + 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 + # + # pkg:gem/activemodel#lib/active_model/errors.rb:395 + def of_kind?(attribute, type = T.unsafe(nil)); end + + # pkg:gem/activemodel#lib/active_model/errors.rb:103 + def size(*args, **, &block); end + + # pkg:gem/activemodel#lib/active_model/errors.rb:418 + 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"]} + # + # pkg:gem/activemodel#lib/active_model/errors.rb:256 + def to_hash(full_messages = T.unsafe(nil)); end + + # pkg:gem/activemodel#lib/active_model/errors.rb:103 + def uniq!(*args, **, &block); 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 + # + # pkg:gem/activemodel#lib/active_model/errors.rb:189 + def where(attribute, type = T.unsafe(nil), **options); end + + private + + # pkg:gem/activemodel#lib/active_model/errors.rb:122 + def initialize_dup(other); end + + # pkg:gem/activemodel#lib/active_model/errors.rb:490 + def normalize_arguments(attribute, type, **options); end +end + +# pkg:gem/activemodel#lib/active_model/errors.rb:265 +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) +# # => # +# +# pkg:gem/activemodel#lib/active_model/forbidden_attributes_protection.rb:18 +class ActiveModel::ForbiddenAttributesError < ::StandardError; end + +# pkg:gem/activemodel#lib/active_model/forbidden_attributes_protection.rb:21 +module ActiveModel::ForbiddenAttributesProtection + private + + # pkg:gem/activemodel#lib/active_model/forbidden_attributes_protection.rb:23 + def sanitize_for_mass_assignment(attributes); end + + # pkg:gem/activemodel#lib/active_model/forbidden_attributes_protection.rb:31 + def sanitize_forbidden_attributes(attributes); end +end + +# pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:91 +class ActiveModel::ForcedMutationTracker < ::ActiveModel::AttributeMutationTracker + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:92 + def initialize(attributes); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:101 + def change_to_attribute(attr_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:97 + def changed_in_place?(attr_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:125 + def finalize_changes; end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:121 + def force_change(attr_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:109 + def forget_change(attr_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:113 + def original_value(attr_name); end + + private + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:132 + def attr_names; end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:136 + def attribute_changed?(attr_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:144 + def clone_value(attr_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:140 + def fetch_value(attr_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:130 + def finalized_changes; end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:151 + def type_cast(attr_name, value); end +end + +# pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:94 +class ActiveModel::LazyAttributeHash + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:97 + def initialize(types, values, additional_types, default_attributes, delegate_hash = T.unsafe(nil)); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:134 + def ==(other); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:110 + def [](key); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:114 + def []=(key, value); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:118 + def deep_dup; end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:129 + def each_key(&block); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:95 + def each_value(*, **, &); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:95 + def except(*, **, &); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:95 + def fetch(*, **, &); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:106 + def key?(key); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:142 + def marshal_dump; end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:146 + def marshal_load(values); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:95 + def transform_values(*, **, &); end + + protected + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:151 + def materialize; end + + private + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:163 + def additional_types; end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:165 + def assign_default_value(name); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:163 + def default_attributes; end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:163 + def delegate_hash; end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:124 + def initialize_dup(_); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:163 + def types; end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:163 + def values; end +end + +# pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:21 +class ActiveModel::LazyAttributeSet < ::ActiveModel::AttributeSet + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:22 + def initialize(values, types, additional_types, default_attributes, attributes = T.unsafe(nil)); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:41 + def fetch_value(name, &block); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:32 + def key?(name); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:36 + def keys; end + + protected + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:61 + def attributes; end + + private + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:71 + def additional_types; end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:73 + def default_attribute(name, value_present = T.unsafe(nil), value = T.unsafe(nil)); end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:71 + def default_attributes; end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:71 + def types; end + + # pkg:gem/activemodel#lib/active_model/attribute_set/builder.rb:71 + def values; end +end + +# pkg:gem/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+. +# +# pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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". + # + # pkg:gem/activemodel#lib/active_model/lint.rb:58 + def test_to_partial_path; end + + private + + # pkg:gem/activemodel#lib/active_model/lint.rb:113 + def assert_boolean(result, name); end + + # pkg:gem/activemodel#lib/active_model/lint.rb:108 + 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 +# +# pkg:gem/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). +# +# pkg:gem/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 __callbacks?; 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 __callbacks?; end + def _validators; end + def _validators?; end + def param_delimiter=(value); end + end +end + +# pkg:gem/activemodel#lib/active_model/naming.rb:9 +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" + # + # pkg:gem/activemodel#lib/active_model/naming.rb:166 + def initialize(klass, namespace = T.unsafe(nil), name = T.unsafe(nil), locale = T.unsafe(nil)); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:151 + def !~(*, **, &); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:151 + def <=>(*, **, &); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:151 + def ==(arg); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:151 + def ===(arg); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:151 + def =~(*, **, &); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:151 + def as_json(*, **, &); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:16 + def cache_key; end + + # pkg:gem/activemodel#lib/active_model/naming.rb:12 + def collection; end + + # pkg:gem/activemodel#lib/active_model/naming.rb:12 + def collection=(_arg0); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:12 + def element; end + + # pkg:gem/activemodel#lib/active_model/naming.rb:12 + def element=(_arg0); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:151 + def eql?(*, **, &); 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. + # + # pkg:gem/activemodel#lib/active_model/naming.rb:197 + def human(options = T.unsafe(nil)); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:12 + def i18n_key; end + + # pkg:gem/activemodel#lib/active_model/naming.rb:12 + def i18n_key=(_arg0); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:151 + def match?(*, **, &); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:12 + def name; end + + # pkg:gem/activemodel#lib/active_model/naming.rb:12 + def name=(_arg0); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:12 + def param_key; end + + # pkg:gem/activemodel#lib/active_model/naming.rb:12 + def param_key=(_arg0); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:12 + def plural; end + + # pkg:gem/activemodel#lib/active_model/naming.rb:12 + def plural=(_arg0); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:12 + def route_key; end + + # pkg:gem/activemodel#lib/active_model/naming.rb:12 + def route_key=(_arg0); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:12 + def singular; end + + # pkg:gem/activemodel#lib/active_model/naming.rb:12 + def singular=(_arg0); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:12 + def singular_route_key; end + + # pkg:gem/activemodel#lib/active_model/naming.rb:12 + def singular_route_key=(_arg0); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:151 + def to_s(*, **, &); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:151 + def to_str(*, **, &); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:209 + def uncountable?; end + + private + + # pkg:gem/activemodel#lib/active_model/naming.rb:216 + def _singularize(string); end + + # pkg:gem/activemodel#lib/active_model/naming.rb:220 + def i18n_keys; end + + # pkg:gem/activemodel#lib/active_model/naming.rb:228 + def i18n_scope; end +end + +# pkg:gem/activemodel#lib/active_model/naming.rb:214 +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. +# +# pkg:gem/activemodel#lib/active_model/naming.rb:252 +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" + # + # pkg:gem/activemodel#lib/active_model/naming.rb:270 + def model_name; end + + private + + # pkg:gem/activemodel#lib/active_model/naming.rb:352 + def inherited(base); end + + class << self + # pkg:gem/activemodel#lib/active_model/naming.rb:253 + 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" + # + # pkg:gem/activemodel#lib/active_model/naming.rb:338 + 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" + # + # pkg:gem/activemodel#lib/active_model/naming.rb:283 + 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. + # + # pkg:gem/activemodel#lib/active_model/naming.rb:326 + 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" + # + # pkg:gem/activemodel#lib/active_model/naming.rb:291 + 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" + # + # pkg:gem/activemodel#lib/active_model/naming.rb:311 + 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 + # + # pkg:gem/activemodel#lib/active_model/naming.rb:299 + def uncountable?(record_or_class); end + + private + + # pkg:gem/activemodel#lib/active_model/naming.rb:342 + def model_name_from_record_or_class(record_or_class); end + end +end + +# pkg:gem/activemodel#lib/active_model/nested_error.rb:7 +class ActiveModel::NestedError < ::ActiveModel::Error + extend ::Forwardable + + # pkg:gem/activemodel#lib/active_model/nested_error.rb:8 + def initialize(base, inner_error, override_options = T.unsafe(nil)); end + + # pkg:gem/activemodel#lib/active_model/nested_error.rb:17 + def inner_error; end + + # pkg:gem/activemodel#lib/active_model/nested_error.rb:20 + def message(*args, **, &block); end +end + +# pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:156 +class ActiveModel::NullMutationTracker + include ::Singleton + extend ::Singleton::SingletonClassMethods + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:174 + def any_changes?; end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:171 + def change_to_attribute(attr_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:178 + def changed?(attr_name, **); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:159 + def changed_attribute_names; end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:182 + def changed_in_place?(attr_name); end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:163 + def changed_values; end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:167 + def changes; end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:186 + def original_value(attr_name); end + + class << self + private + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:157 + def allocate; end + + # pkg:gem/activemodel#lib/active_model/attribute_mutation_tracker.rb:157 + def new(*_arg0); end + end +end + +# pkg:gem/activemodel#lib/active_model/railtie.rb:7 +class ActiveModel::Railtie < ::Rails::Railtie; end + +# = Active \Model \RangeError +# +# Raised when attribute values are out of range. +# +# pkg:gem/activemodel#lib/active_model/errors.rb:523 +class ActiveModel::RangeError < ::RangeError; end + +# pkg:gem/activemodel#lib/active_model/secure_password.rb:4 +module ActiveModel::SecurePassword + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveModel::SecurePassword::ClassMethods + + class << self + # pkg:gem/activemodel#lib/active_model/secure_password.rb:13 + def min_cost; end + + # pkg:gem/activemodel#lib/active_model/secure_password.rb:13 + def min_cost=(_arg0); end + end +end + +# pkg:gem/activemodel#lib/active_model/secure_password.rb:17 +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. + # + # 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 + # + # pkg:gem/activemodel#lib/active_model/secure_password.rb:101 + def has_secure_password(attribute = T.unsafe(nil), validations: T.unsafe(nil)); end +end + +# pkg:gem/activemodel#lib/active_model/secure_password.rb:148 +class ActiveModel::SecurePassword::InstanceMethodsOnActivation < ::Module + # pkg:gem/activemodel#lib/active_model/secure_password.rb:149 + def initialize(attribute); 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. +# +# pkg:gem/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, take a look +# at the private method +read_attribute_for_serialization+. +# +# 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' }}) +# +# pkg:gem/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 + # + # pkg:gem/activemodel#lib/active_model/serialization.rb:172 + 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"}]} + # + # pkg:gem/activemodel#lib/active_model/serialization.rb:125 + def serializable_hash(options = T.unsafe(nil)); end + + private + + # pkg:gem/activemodel#lib/active_model/serialization.rb:152 + 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 + # + # pkg:gem/activemodel#lib/active_model/serialization.rb:184 + def serializable_add_includes(options = T.unsafe(nil)); end + + # pkg:gem/activemodel#lib/active_model/serialization.rb:174 + def serializable_attributes(attribute_names); end +end + +# pkg:gem/activemodel#lib/active_model.rb:68 +module ActiveModel::Serializers + extend ::ActiveSupport::Autoload +end + +# = Active \Model \JSON \Serializer +# +# pkg:gem/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" } ] } + # + # pkg:gem/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 + # + # pkg:gem/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 +# +# pkg:gem/activemodel#lib/active_model/errors.rb:517 +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. +# +# pkg:gem/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. + # + # pkg:gem/activemodel#lib/active_model/translation.rb:46 + def human_attribute_name(attribute, options = T.unsafe(nil)); end + + # Returns the +i18n_scope+ for the class. Override if you want custom lookup. + # + # pkg:gem/activemodel#lib/active_model/translation.rb:26 + 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. + # + # pkg:gem/activemodel#lib/active_model/translation.rb:34 + def lookup_ancestors; end +end + +# pkg:gem/activemodel#lib/active_model/translation.rb:38 +ActiveModel::Translation::MISSING_TRANSLATION = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:4 +module ActiveModel::Type + class << self + # pkg:gem/activemodel#lib/active_model/type.rb:38 + def default_value; end + + # pkg:gem/activemodel#lib/active_model/type.rb:34 + def lookup(*, **, &); end + + # Add a new type to the registry, allowing it to be referenced as a + # symbol by {attribute}[rdoc-ref:Attributes::ClassMethods#attribute]. + # + # pkg:gem/activemodel#lib/active_model/type.rb:30 + def register(type_name, klass = T.unsafe(nil), &block); end + + # pkg:gem/activemodel#lib/active_model/type.rb:26 + def registry; end + + # pkg:gem/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. +# +# pkg:gem/activemodel#lib/active_model/type/big_integer.rb:25 +class ActiveModel::Type::BigInteger < ::ActiveModel::Type::Integer + # pkg:gem/activemodel#lib/active_model/type/big_integer.rb:26 + def serialize_cast_value(value); end + + private + + # pkg:gem/activemodel#lib/active_model/type/big_integer.rb:31 + 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. +# +# pkg:gem/activemodel#lib/active_model/type/binary.rb:11 +class ActiveModel::Type::Binary < ::ActiveModel::Type::Value + # pkg:gem/activemodel#lib/active_model/type/binary.rb:16 + def binary?; end + + # pkg:gem/activemodel#lib/active_model/type/binary.rb:20 + def cast(value); end + + # pkg:gem/activemodel#lib/active_model/type/binary.rb:35 + def changed_in_place?(raw_old_value, value); end + + # pkg:gem/activemodel#lib/active_model/type/binary.rb:30 + def serialize(value); end + + # pkg:gem/activemodel#lib/active_model/type/binary.rb:12 + def type; end +end + +# pkg:gem/activemodel#lib/active_model/type/binary.rb:40 +class ActiveModel::Type::Binary::Data + # pkg:gem/activemodel#lib/active_model/type/binary.rb:41 + def initialize(value); end + + # pkg:gem/activemodel#lib/active_model/type/binary.rb:56 + def ==(other); end + + # pkg:gem/activemodel#lib/active_model/type/binary.rb:52 + def hex; end + + # pkg:gem/activemodel#lib/active_model/type/binary.rb:47 + def to_s; end + + # pkg:gem/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+. +# +# pkg:gem/activemodel#lib/active_model/type/boolean.rb:14 +class ActiveModel::Type::Boolean < ::ActiveModel::Type::Value + # pkg:gem/activemodel#lib/active_model/type/boolean.rb:30 + def serialize(value); end + + # pkg:gem/activemodel#lib/active_model/type/boolean.rb:34 + def serialize_cast_value(value); end + + # pkg:gem/activemodel#lib/active_model/type/boolean.rb:26 + def type; end + + private + + # pkg:gem/activemodel#lib/active_model/type/boolean.rb:39 + def cast_value(value); end +end + +# pkg:gem/activemodel#lib/active_model/type/boolean.rb:15 +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. +# +# pkg:gem/activemodel#lib/active_model/type/date.rb:26 +class ActiveModel::Type::Date < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Timezone + include ::ActiveModel::Type::Helpers::AcceptsMultiparameterTime::InstanceMethods + + # pkg:gem/activemodel#lib/active_model/type/date.rb:30 + def type; end + + # pkg:gem/activemodel#lib/active_model/type/date.rb:34 + def type_cast_for_schema(value); end + + private + + # pkg:gem/activemodel#lib/active_model/type/date.rb:39 + def cast_value(value); end + + # pkg:gem/activemodel#lib/active_model/type/date.rb:57 + def fallback_string_to_date(string); end + + # pkg:gem/activemodel#lib/active_model/type/date.rb:51 + def fast_string_to_date(string); end + + # pkg:gem/activemodel#lib/active_model/type/date.rb:66 + def new_date(year, mon, mday); end + + # pkg:gem/activemodel#lib/active_model/type/date.rb:72 + def value_from_multiparameter_assignment(*); end +end + +# pkg:gem/activemodel#lib/active_model/type/date.rb:50 +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 +# +# pkg:gem/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 + + # pkg:gem/activemodel#lib/active_model/type/date_time.rb:49 + def type; end + + private + + # pkg:gem/activemodel#lib/active_model/type/date_time.rb:54 + def cast_value(value); end + + # pkg:gem/activemodel#lib/active_model/type/date_time.rb:67 + def fallback_string_to_time(string); end + + # '0.123456' -> 123456 + # '1.123456' -> 123456 + # + # pkg:gem/activemodel#lib/active_model/type/date_time.rb:63 + def microseconds(time); end + + # pkg:gem/activemodel#lib/active_model/type/date_time.rb:79 + 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 +# +# pkg:gem/activemodel#lib/active_model/type/decimal.rb:45 +class ActiveModel::Type::Decimal < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Numeric + + # pkg:gem/activemodel#lib/active_model/type/decimal.rb:49 + def type; end + + # pkg:gem/activemodel#lib/active_model/type/decimal.rb:53 + def type_cast_for_schema(value); end + + private + + # pkg:gem/activemodel#lib/active_model/type/decimal.rb:98 + def apply_scale(value); end + + # pkg:gem/activemodel#lib/active_model/type/decimal.rb:58 + def cast_value(value); end + + # pkg:gem/activemodel#lib/active_model/type/decimal.rb:82 + def convert_float_to_big_decimal(value); end + + # pkg:gem/activemodel#lib/active_model/type/decimal.rb:90 + def float_precision; end +end + +# pkg:gem/activemodel#lib/active_model/type/decimal.rb:47 +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 +# +# 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+. +# +# bag = BagOfCoffee.new +# +# bag.weight = "0.25" +# bag.weight # => 0.25 +# +# bag.weight = "" +# bag.weight # => nil +# +# bag.weight = "NaN" +# bag.weight # => Float::NAN +# +# pkg:gem/activemodel#lib/active_model/type/float.rb:36 +class ActiveModel::Type::Float < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Numeric + + # pkg:gem/activemodel#lib/active_model/type/float.rb:39 + def type; end + + # pkg:gem/activemodel#lib/active_model/type/float.rb:43 + def type_cast_for_schema(value); end + + private + + # pkg:gem/activemodel#lib/active_model/type/float.rb:53 + def cast_value(value); end +end + +# pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:5 +module ActiveModel::Type::Helpers; end + +# pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:6 +class ActiveModel::Type::Helpers::AcceptsMultiparameterTime < ::Module + # pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:37 + def initialize(defaults: T.unsafe(nil)); end +end + +# pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:7 +module ActiveModel::Type::Helpers::AcceptsMultiparameterTime::InstanceMethods + # pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:24 + def assert_valid_value(value); end + + # pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:16 + def cast(value); end + + # pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:8 + def serialize(value); end + + # pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:12 + def serialize_cast_value(value); end + + # pkg:gem/activemodel#lib/active_model/type/helpers/accepts_multiparameter_time.rb:32 + def value_constructed_by_mass_assignment?(value); end +end + +# pkg:gem/activemodel#lib/active_model/type/helpers/mutable.rb:6 +module ActiveModel::Type::Helpers::Mutable + # pkg:gem/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. + # + # pkg:gem/activemodel#lib/active_model/type/helpers/mutable.rb:14 + def changed_in_place?(raw_old_value, new_value); end + + # pkg:gem/activemodel#lib/active_model/type/helpers/mutable.rb:18 + def mutable?; end +end + +# pkg:gem/activemodel#lib/active_model/type/helpers/numeric.rb:6 +module ActiveModel::Type::Helpers::Numeric + # pkg:gem/activemodel#lib/active_model/type/helpers/numeric.rb:15 + def cast(value); end + + # pkg:gem/activemodel#lib/active_model/type/helpers/numeric.rb:31 + def changed?(old_value, _new_value, new_value_before_type_cast); end + + # pkg:gem/activemodel#lib/active_model/type/helpers/numeric.rb:7 + def serialize(value); end + + # pkg:gem/activemodel#lib/active_model/type/helpers/numeric.rb:11 + def serialize_cast_value(value); end + + private + + # pkg:gem/activemodel#lib/active_model/type/helpers/numeric.rb:37 + def equal_nan?(old_value, new_value); end + + # pkg:gem/activemodel#lib/active_model/type/helpers/numeric.rb:49 + def non_numeric_string?(value); end + + # pkg:gem/activemodel#lib/active_model/type/helpers/numeric.rb:44 + def number_to_non_number?(old_value, new_value_before_type_cast); end +end + +# pkg:gem/activemodel#lib/active_model/type/helpers/numeric.rb:56 +ActiveModel::Type::Helpers::Numeric::NUMERIC_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activemodel#lib/active_model/type/helpers/time_value.rb:9 +module ActiveModel::Type::Helpers::TimeValue + # pkg:gem/activemodel#lib/active_model/type/helpers/time_value.rb:24 + def apply_seconds_precision(value); end + + # pkg:gem/activemodel#lib/active_model/type/helpers/time_value.rb:10 + def serialize_cast_value(value); end + + # pkg:gem/activemodel#lib/active_model/type/helpers/time_value.rb:38 + def type_cast_for_schema(value); end + + # pkg:gem/activemodel#lib/active_model/type/helpers/time_value.rb:42 + def user_input_in_time_zone(value); end + + private + + # pkg:gem/activemodel#lib/active_model/type/helpers/time_value.rb:73 + def fast_string_to_time(string); end + + # pkg:gem/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 + +# pkg:gem/activemodel#lib/active_model/type/helpers/time_value.rb:64 +ActiveModel::Type::Helpers::TimeValue::ISO_DATETIME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activemodel#lib/active_model/type/helpers/timezone.rb:8 +module ActiveModel::Type::Helpers::Timezone + # pkg:gem/activemodel#lib/active_model/type/helpers/timezone.rb:13 + def default_timezone; end + + # pkg:gem/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" +# +# pkg:gem/activemodel#lib/active_model/type/immutable_string.rb:37 +class ActiveModel::Type::ImmutableString < ::ActiveModel::Type::Value + # pkg:gem/activemodel#lib/active_model/type/immutable_string.rb:38 + def initialize(**args); end + + # pkg:gem/activemodel#lib/active_model/type/immutable_string.rb:48 + def serialize(value); end + + # pkg:gem/activemodel#lib/active_model/type/immutable_string.rb:57 + def serialize_cast_value(value); end + + # pkg:gem/activemodel#lib/active_model/type/immutable_string.rb:44 + def type; end + + private + + # pkg:gem/activemodel#lib/active_model/type/immutable_string.rb:62 + 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 +# +# pkg:gem/activemodel#lib/active_model/type/integer.rb:44 +class ActiveModel::Type::Integer < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Numeric + + # pkg:gem/activemodel#lib/active_model/type/integer.rb:51 + def initialize(**); end + + # pkg:gem/activemodel#lib/active_model/type/integer.rb:60 + def deserialize(value); end + + # pkg:gem/activemodel#lib/active_model/type/integer.rb:74 + def serializable?(value); end + + # pkg:gem/activemodel#lib/active_model/type/integer.rb:65 + def serialize(value); end + + # pkg:gem/activemodel#lib/active_model/type/integer.rb:70 + def serialize_cast_value(value); end + + # pkg:gem/activemodel#lib/active_model/type/integer.rb:56 + def type; end + + private + + # pkg:gem/activemodel#lib/active_model/type/integer.rb:108 + def _limit; end + + # pkg:gem/activemodel#lib/active_model/type/integer.rb:89 + def cast_value(value); end + + # pkg:gem/activemodel#lib/active_model/type/integer.rb:93 + def ensure_in_range(value); end + + # pkg:gem/activemodel#lib/active_model/type/integer.rb:85 + def in_range?(value); end + + # pkg:gem/activemodel#lib/active_model/type/integer.rb:100 + def max_value; end + + # pkg:gem/activemodel#lib/active_model/type/integer.rb:104 + def min_value; end + + # pkg:gem/activemodel#lib/active_model/type/integer.rb:83 + def range; end +end + +# Column storage size in bytes. +# 4 bytes means an integer as opposed to smallint etc. +# +# pkg:gem/activemodel#lib/active_model/type/integer.rb:49 +ActiveModel::Type::Integer::DEFAULT_LIMIT = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activemodel#lib/active_model/type/registry.rb:5 +class ActiveModel::Type::Registry + # pkg:gem/activemodel#lib/active_model/type/registry.rb:6 + def initialize; end + + # pkg:gem/activemodel#lib/active_model/type/registry.rb:23 + def lookup(symbol, *args, **); end + + # pkg:gem/activemodel#lib/active_model/type/registry.rb:15 + def register(type_name, klass = T.unsafe(nil), &block); end + + private + + # pkg:gem/activemodel#lib/active_model/type/registry.rb:10 + def initialize_copy(other); end + + # pkg:gem/activemodel#lib/active_model/type/registry.rb:35 + def registrations; end +end + +# pkg:gem/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 + + # pkg:gem/activemodel#lib/active_model/type/serialize_cast_value.rb:41 + def initialize(*, **, &); end + + # pkg:gem/activemodel#lib/active_model/type/serialize_cast_value.rb:37 + def itself_if_serialize_cast_value_compatible; end + + class << self + # pkg:gem/activemodel#lib/active_model/type/serialize_cast_value.rb:21 + def included(klass); end + + # pkg:gem/activemodel#lib/active_model/type/serialize_cast_value.rb:25 + def serialize(type, value); end + end +end + +# pkg:gem/activemodel#lib/active_model/type/serialize_cast_value.rb:8 +module ActiveModel::Type::SerializeCastValue::ClassMethods + # pkg:gem/activemodel#lib/active_model/type/serialize_cast_value.rb:9 + def serialize_cast_value_compatible?; end +end + +# pkg:gem/activemodel#lib/active_model/type/serialize_cast_value.rb:15 +module ActiveModel::Type::SerializeCastValue::DefaultImplementation + # pkg:gem/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. +# +# pkg:gem/activemodel#lib/active_model/type/string.rb:15 +class ActiveModel::Type::String < ::ActiveModel::Type::ImmutableString + # pkg:gem/activemodel#lib/active_model/type/string.rb:16 + def changed_in_place?(raw_old_value, new_value); end + + # pkg:gem/activemodel#lib/active_model/type/string.rb:22 + def to_immutable_string; end + + private + + # pkg:gem/activemodel#lib/active_model/type/string.rb:33 + 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 +# +# pkg:gem/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 + + # pkg:gem/activemodel#lib/active_model/type/time.rb:45 + def type; end + + # pkg:gem/activemodel#lib/active_model/type/time.rb:49 + def user_input_in_time_zone(value); end + + private + + # pkg:gem/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. +# +# pkg:gem/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. + # + # pkg:gem/activemodel#lib/active_model/type/value.rb:17 + def initialize(precision: T.unsafe(nil), limit: T.unsafe(nil), scale: T.unsafe(nil)); end + + # pkg:gem/activemodel#lib/active_model/type/value.rb:121 + def ==(other); end + + # pkg:gem/activemodel#lib/active_model/type/value.rb:144 + def as_json(*); end + + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activemodel#lib/active_model/type/value.rb:43 + def deserialize(value); end + + # pkg:gem/activemodel#lib/active_model/type/value.rb:127 + def eql?(other); end + + # pkg:gem/activemodel#lib/active_model/type/value.rb:113 + def force_equality?(_value); end + + # pkg:gem/activemodel#lib/active_model/type/value.rb:129 + def hash; end + + # pkg:gem/activemodel#lib/active_model/type/value.rb:11 + def limit; end + + # pkg:gem/activemodel#lib/active_model/type/value.rb:117 + def map(value); end + + # pkg:gem/activemodel#lib/active_model/type/value.rb:140 + def mutable?; end + + # pkg:gem/activemodel#lib/active_model/type/value.rb:11 + def precision; end + + # pkg:gem/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. + # + # pkg:gem/activemodel#lib/active_model/type/value.rb:28 + def serializable?(value); 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+. + # + # pkg:gem/activemodel#lib/active_model/type/value.rb:65 + def serialize(value); end + + # pkg:gem/activemodel#lib/active_model/type/value.rb:136 + def serialized?; end + + # Returns the unique type name as a Symbol. Subclasses should override + # this method. + # + # pkg:gem/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. + # + # pkg:gem/activemodel#lib/active_model/type/value.rb:71 + def type_cast_for_schema(value); end + + # pkg:gem/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+. + # + # pkg:gem/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. +# +# pkg:gem/activemodel#lib/active_model/errors.rb:538 +class ActiveModel::UnknownAttributeError < ::NoMethodError + # pkg:gem/activemodel#lib/active_model/errors.rb:541 + def initialize(record, attribute); end + + # pkg:gem/activemodel#lib/active_model/errors.rb:539 + def attribute; end + + # pkg:gem/activemodel#lib/active_model/errors.rb:539 + def record; end +end + +# pkg:gem/activemodel#lib/active_model/gem_version.rb:9 +module ActiveModel::VERSION; end + +# pkg:gem/activemodel#lib/active_model/gem_version.rb:10 +ActiveModel::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activemodel#lib/active_model/gem_version.rb:11 +ActiveModel::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activemodel#lib/active_model/gem_version.rb:13 +ActiveModel::VERSION::PRE = T.let(T.unsafe(nil), String) + +# pkg:gem/activemodel#lib/active_model/gem_version.rb:15 +ActiveModel::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/activemodel#lib/active_model/gem_version.rb:12 +ActiveModel::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +# = 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 +# +# pkg:gem/activemodel#lib/active_model/validations.rb:460 +class ActiveModel::ValidationError < ::StandardError + # pkg:gem/activemodel#lib/active_model/validations.rb:463 + def initialize(model); end + + # pkg:gem/activemodel#lib/active_model/validations.rb:461 + 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. +# +# pkg:gem/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 # => # + # + # pkg:gem/activemodel#lib/active_model/validations.rb:330 + def errors; 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 + # + # pkg:gem/activemodel#lib/active_model/validations.rb:402 + 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 + # + # pkg:gem/activemodel#lib/active_model/validations.rb:431 + 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 + # + # pkg:gem/activemodel#lib/active_model/validations.rb:363 + def valid?(context = T.unsafe(nil)); end + + # pkg:gem/activemodel#lib/active_model/validations.rb:371 + 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. + # + # pkg:gem/activemodel#lib/active_model/validations.rb:411 + 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. + # + # pkg:gem/activemodel#lib/active_model/validations/with.rb:144 + def validates_with(*args, &block); end + + private + + # pkg:gem/activemodel#lib/active_model/validations.rb:434 + def init_internals; end + + # Clean the +Errors+ object if instance is duped. + # + # pkg:gem/activemodel#lib/active_model/validations.rb:312 + def initialize_dup(other); end + + # pkg:gem/activemodel#lib/active_model/validations.rb:445 + def raise_validation_error; end + + # pkg:gem/activemodel#lib/active_model/validations.rb:440 + def run_validations!; end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def __callbacks?; end + def _validators; end + def _validators=(value); end + def _validators?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def __callbacks?; end + def _validators; end + def _validators?; end + end +end + +# == \Active \Model Absence Validator +# +# pkg:gem/activemodel#lib/active_model/validations/absence.rb:6 +class ActiveModel::Validations::AbsenceValidator < ::ActiveModel::EachValidator + # pkg:gem/activemodel#lib/active_model/validations/absence.rb:7 + def validate_each(record, attr_name, value); end +end + +# pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:5 +class ActiveModel::Validations::AcceptanceValidator < ::ActiveModel::EachValidator + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:6 + def initialize(options); end + + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:11 + def validate_each(record, attribute, value); end + + private + + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:23 + def acceptable_option?(value); end + + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:18 + def setup!(klass); end +end + +# pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:27 +class ActiveModel::Validations::AcceptanceValidator::LazilyDefineAttributes < ::Module + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:28 + def initialize(attributes); end + + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:73 + def ==(other); end + + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:56 + def define_on(klass); end + + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:32 + def included(klass); end + + # pkg:gem/activemodel#lib/active_model/validations/acceptance.rb:51 + def matches?(method_name); end + + protected + + # pkg:gem/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. +# +# pkg:gem/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. + # + # pkg:gem/activemodel#lib/active_model/validations/callbacks.rb:114 + def run_validations!; end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def __callbacks?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def __callbacks?; end + end +end + +# pkg:gem/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 + # + # pkg:gem/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" + # + # pkg:gem/activemodel#lib/active_model/validations/callbacks.rb:55 + def before_validation(*args, &block); end + + private + + # pkg:gem/activemodel#lib/active_model/validations/callbacks.rb:99 + def set_options_for_callback(options); end +end + +# pkg:gem/activemodel#lib/active_model/validations.rb:74 +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 + # + # pkg:gem/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 + # + # pkg:gem/activemodel#lib/active_model/validations.rb:248 + def clear_validators!; end + + # Copy validators on inheritance. + # + # pkg:gem/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]) + # * :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. + # + # NOTE: Calling +validate+ multiple times on the same method will overwrite previous definitions. + # + # pkg:gem/activemodel#lib/active_model/validations.rb:171 + 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]) + # * :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 + # + # pkg:gem/activemodel#lib/active_model/validations/validates.rb:106 + 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 + # + # pkg:gem/activemodel#lib/active_model/validations/validates.rb:148 + 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]) + # * :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. + # + # pkg:gem/activemodel#lib/active_model/validations.rb:104 + 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 + # + # pkg:gem/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 + # # => [ + # # #, + # # #, + # # # + # # ] + # + # pkg:gem/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) + # # => [ + # # #, + # # ] + # + # pkg:gem/activemodel#lib/active_model/validations.rb:268 + def validators_on(*attributes); end + + private + + # pkg:gem/activemodel#lib/active_model/validations/validates.rb:161 + 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. + # + # pkg:gem/activemodel#lib/active_model/validations/validates.rb:157 + def _validates_default_keys; end + + # pkg:gem/activemodel#lib/active_model/validations.rb:298 + def predicate_for_validation_context(context); end +end + +# pkg:gem/activemodel#lib/active_model/validations.rb:108 +ActiveModel::Validations::ClassMethods::VALID_OPTIONS_FOR_VALIDATE = T.let(T.unsafe(nil), Array) + +# pkg:gem/activemodel#lib/active_model/validations/clusivity.rb:8 +module ActiveModel::Validations::Clusivity + include ::ActiveModel::Validations::ResolveValue + + # pkg:gem/activemodel#lib/active_model/validations/clusivity.rb:14 + def check_validity!; end + + private + + # pkg:gem/activemodel#lib/active_model/validations/clusivity.rb:31 + def delimiter; end + + # pkg:gem/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. + # + # pkg:gem/activemodel#lib/active_model/validations/clusivity.rb:40 + def inclusion_method(enumerable); end +end + +# pkg:gem/activemodel#lib/active_model/validations/clusivity.rb:11 +ActiveModel::Validations::Clusivity::ERROR_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/activemodel#lib/active_model/validations/comparability.rb:5 +module ActiveModel::Validations::Comparability + # pkg:gem/activemodel#lib/active_model/validations/comparability.rb:10 + def error_options(value, option_value); end +end + +# pkg:gem/activemodel#lib/active_model/validations/comparability.rb:6 +ActiveModel::Validations::Comparability::COMPARE_CHECKS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activemodel#lib/active_model/validations/comparison.rb:8 +class ActiveModel::Validations::ComparisonValidator < ::ActiveModel::EachValidator + include ::ActiveModel::Validations::Comparability + include ::ActiveModel::Validations::ResolveValue + + # pkg:gem/activemodel#lib/active_model/validations/comparison.rb:12 + def check_validity!; end + + # pkg:gem/activemodel#lib/active_model/validations/comparison.rb:19 + def validate_each(record, attr_name, value); end +end + +# pkg:gem/activemodel#lib/active_model/validations/confirmation.rb:5 +class ActiveModel::Validations::ConfirmationValidator < ::ActiveModel::EachValidator + # pkg:gem/activemodel#lib/active_model/validations/confirmation.rb:6 + def initialize(options); end + + # pkg:gem/activemodel#lib/active_model/validations/confirmation.rb:11 + def validate_each(record, attribute, value); end + + private + + # pkg:gem/activemodel#lib/active_model/validations/confirmation.rb:31 + def confirmation_value_equal?(record, attribute, value, confirmed); end + + # pkg:gem/activemodel#lib/active_model/validations/confirmation.rb:21 + def setup!(klass); end +end + +# pkg:gem/activemodel#lib/active_model/validations/exclusion.rb:7 +class ActiveModel::Validations::ExclusionValidator < ::ActiveModel::EachValidator + include ::ActiveModel::Validations::ResolveValue + include ::ActiveModel::Validations::Clusivity + + # pkg:gem/activemodel#lib/active_model/validations/exclusion.rb:10 + def validate_each(record, attribute, value); end +end + +# pkg:gem/activemodel#lib/active_model/validations/format.rb:7 +class ActiveModel::Validations::FormatValidator < ::ActiveModel::EachValidator + include ::ActiveModel::Validations::ResolveValue + + # pkg:gem/activemodel#lib/active_model/validations/format.rb:20 + def check_validity!; end + + # pkg:gem/activemodel#lib/active_model/validations/format.rb:10 + def validate_each(record, attribute, value); end + + private + + # pkg:gem/activemodel#lib/active_model/validations/format.rb:34 + def check_options_validity(name); end + + # pkg:gem/activemodel#lib/active_model/validations/format.rb:30 + def record_error(record, attribute, name, value); end + + # pkg:gem/activemodel#lib/active_model/validations/format.rb:48 + def regexp_using_multiline_anchors?(regexp); end +end + +# pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/activemodel#lib/active_model/validations/presence.rb:34 + def validates_presence_of(*attr_names); end + + # pkg:gem/activemodel#lib/active_model/validations/length.rb:127 + def validates_size_of(*attr_names); end + + private + + # pkg:gem/activemodel#lib/active_model/validations/helper_methods.rb:7 + def _merge_attributes(attr_names); end +end + +# pkg:gem/activemodel#lib/active_model/validations/inclusion.rb:7 +class ActiveModel::Validations::InclusionValidator < ::ActiveModel::EachValidator + include ::ActiveModel::Validations::ResolveValue + include ::ActiveModel::Validations::Clusivity + + # pkg:gem/activemodel#lib/active_model/validations/inclusion.rb:10 + def validate_each(record, attribute, value); end +end + +# pkg:gem/activemodel#lib/active_model/validations/length.rb:7 +class ActiveModel::Validations::LengthValidator < ::ActiveModel::EachValidator + include ::ActiveModel::Validations::ResolveValue + + # pkg:gem/activemodel#lib/active_model/validations/length.rb:15 + def initialize(options); end + + # pkg:gem/activemodel#lib/active_model/validations/length.rb:29 + def check_validity!; end + + # pkg:gem/activemodel#lib/active_model/validations/length.rb:47 + def validate_each(record, attribute, value); end + + private + + # pkg:gem/activemodel#lib/active_model/validations/length.rb:69 + def skip_nil_check?(key); end +end + +# pkg:gem/activemodel#lib/active_model/validations/length.rb:11 +ActiveModel::Validations::LengthValidator::CHECKS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activemodel#lib/active_model/validations/length.rb:10 +ActiveModel::Validations::LengthValidator::MESSAGES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activemodel#lib/active_model/validations/length.rb:13 +ActiveModel::Validations::LengthValidator::RESERVED_OPTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activemodel#lib/active_model/validations/numericality.rb:9 +class ActiveModel::Validations::NumericalityValidator < ::ActiveModel::EachValidator + include ::ActiveModel::Validations::Comparability + include ::ActiveModel::Validations::ResolveValue + + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:22 + def check_validity!; end + + # pkg:gem/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 + + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:118 + def allow_only_integer?(record); end + + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:112 + def filtered_options(value); end + + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:108 + def is_hexadecimal_literal?(raw_value); end + + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:104 + def is_integer?(raw_value); end + + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:94 + def is_number?(raw_value, precision, scale); end + + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:68 + def option_as_number(record, option_value, precision, scale); end + + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:72 + def parse_as_number(raw_value, precision, scale); end + + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:86 + def parse_float(raw_value, precision, scale); end + + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:122 + def prepare_value_for_validation(value, record, attr_name); end + + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:143 + def record_attribute_changed_in_place?(record, attr_name); end + + # pkg:gem/activemodel#lib/active_model/validations/numericality.rb:90 + def round(raw_value, scale); end +end + +# pkg:gem/activemodel#lib/active_model/validations/numericality.rb:20 +ActiveModel::Validations::NumericalityValidator::HEXADECIMAL_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activemodel#lib/active_model/validations/numericality.rb:18 +ActiveModel::Validations::NumericalityValidator::INTEGER_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activemodel#lib/active_model/validations/numericality.rb:14 +ActiveModel::Validations::NumericalityValidator::NUMBER_CHECKS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activemodel#lib/active_model/validations/numericality.rb:13 +ActiveModel::Validations::NumericalityValidator::RANGE_CHECKS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activemodel#lib/active_model/validations/numericality.rb:16 +ActiveModel::Validations::NumericalityValidator::RESERVED_OPTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activemodel#lib/active_model/validations/presence.rb:5 +class ActiveModel::Validations::PresenceValidator < ::ActiveModel::EachValidator + # pkg:gem/activemodel#lib/active_model/validations/presence.rb:6 + def validate_each(record, attr_name, value); end +end + +# pkg:gem/activemodel#lib/active_model/validations/resolve_value.rb:5 +module ActiveModel::Validations::ResolveValue + # pkg:gem/activemodel#lib/active_model/validations/resolve_value.rb:6 + def resolve_value(record, value); end +end + +# pkg:gem/activemodel#lib/active_model/validations/with.rb:7 +class ActiveModel::Validations::WithValidator < ::ActiveModel::EachValidator + # pkg:gem/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 +# +# pkg:gem/activemodel#lib/active_model/validator.rb:96 +class ActiveModel::Validator + # Accepts options that will be made available through the +options+ reader. + # + # pkg:gem/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 + # + # pkg:gem/activemodel#lib/active_model/validator.rb:116 + def kind; end + + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/activemodel#lib/active_model/validator.rb:103 + def kind; end + end +end diff --git a/sorbet/rbi/gems/activerecord-import@1.7.0.rbi b/sorbet/rbi/gems/activerecord-import@1.7.0.rbi new file mode 100644 index 000000000..25f41956a --- /dev/null +++ b/sorbet/rbi/gems/activerecord-import@1.7.0.rbi @@ -0,0 +1,619 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `activerecord-import` gem. +# Please instead update this file by running `bin/tapioca gem activerecord-import`. + + +# pkg:gem/activerecord-import#lib/activerecord-import/active_record/adapters/abstract_adapter.rb:5 +module ActiveRecord; end + +# pkg:gem/activerecord-import#lib/activerecord-import/import.rb:133 +class ActiveRecord::Associations::CollectionAssociation < ::ActiveRecord::Associations::Association + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:134 + def bulk_import(*args, &block); end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:251 + def import(*args, &block); end +end + +# pkg:gem/activerecord-import#lib/activerecord-import/import.rb:126 +class ActiveRecord::Associations::CollectionProxy < ::ActiveRecord::Relation + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:127 + def bulk_import(*args, &block); end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:130 + def import(*args, &block); end +end + +# pkg:gem/activerecord-import#lib/activerecord-import/import.rb:262 +class ActiveRecord::Base + include ::ActiveModel::Access + include ::ActiveModel::ForbiddenAttributesProtection + include ::ActiveModel::AttributeAssignment + include ::ActiveModel::Serialization + extend ::ActiveRecord::Import::Connection + + # See ActiveRecord::ConnectionAdapters::AbstractAdapter.synchronize + # + # pkg:gem/activerecord-import#lib/activerecord-import/synchronize.rb:64 + def synchronize(instances, key = T.unsafe(nil)); end + + class << self + # Imports a collection of values to the database. + # + # This is more efficient than using ActiveRecord::Base#create or + # ActiveRecord::Base#save multiple times. This method works well if + # you want to create more than one record at a time and do not care + # about having ActiveRecord objects returned for each record + # inserted. + # + # This can be used with or without validations. It does not utilize + # the ActiveRecord::Callbacks during creation/modification while + # performing the import. + # + # == Usage + # Model.import array_of_models + # Model.import column_names, array_of_models + # Model.import array_of_hash_objects + # Model.import column_names, array_of_hash_objects + # Model.import column_names, array_of_values + # Model.import column_names, array_of_values, options + # + # ==== Model.import array_of_models + # + # With this form you can call _import_ passing in an array of model + # objects that you want updated. + # + # ==== Model.import column_names, array_of_values + # + # The first parameter +column_names+ is an array of symbols or + # strings which specify the columns that you want to update. + # + # The second parameter, +array_of_values+, is an array of + # arrays. Each subarray is a single set of values for a new + # record. The order of values in each subarray should match up to + # the order of the +column_names+. + # + # ==== Model.import column_names, array_of_values, options + # + # The first two parameters are the same as the above form. The third + # parameter, +options+, is a hash. This is optional. Please see + # below for what +options+ are available. + # + # == Options + # * +validate+ - true|false, tells import whether or not to use + # ActiveRecord validations. Validations are enforced by default. + # It skips the uniqueness validation for performance reasons. + # You can find more details here: + # https://github.com/zdennis/activerecord-import/issues/228 + # * +ignore+ - true|false, an alias for on_duplicate_key_ignore. + # * +on_duplicate_key_ignore+ - true|false, tells import to discard + # records that contain duplicate keys. For Postgres 9.5+ it adds + # ON CONFLICT DO NOTHING, for MySQL it uses INSERT IGNORE, and for + # SQLite it uses INSERT OR IGNORE. Cannot be enabled on a + # recursive import. For database adapters that normally support + # setting primary keys on imported objects, this option prevents + # that from occurring. + # * +on_duplicate_key_update+ - :all, an Array, or Hash, tells import to + # use MySQL's ON DUPLICATE KEY UPDATE or Postgres/SQLite ON CONFLICT + # DO UPDATE ability. See On Duplicate Key Update below. + # * +synchronize+ - an array of ActiveRecord instances for the model + # that you are currently importing data into. This synchronizes + # existing model instances in memory with updates from the import. + # * +timestamps+ - true|false, tells import to not add timestamps + # (if false) even if record timestamps is disabled in ActiveRecord::Base + # * +recursive+ - true|false, tells import to import all has_many/has_one + # associations if the adapter supports setting the primary keys of the + # newly imported objects. PostgreSQL only. + # * +batch_size+ - an integer value to specify the max number of records to + # include per insert. Defaults to the total number of records to import. + # + # == Examples + # class BlogPost < ActiveRecord::Base ; end + # + # # Example using array of model objects + # posts = [ BlogPost.new author_name: 'Zach Dennis', title: 'AREXT', + # BlogPost.new author_name: 'Zach Dennis', title: 'AREXT2', + # BlogPost.new author_name: 'Zach Dennis', title: 'AREXT3' ] + # BlogPost.import posts + # + # # Example using array_of_hash_objects + # # NOTE: column_names will be determined by using the keys of the first hash in the array. If later hashes in the + # # array have different keys an exception will be raised. If you have hashes to import with different sets of keys + # # we recommend grouping these into batches before importing. + # values = [ {author_name: 'zdennis', title: 'test post'} ], [ {author_name: 'jdoe', title: 'another test post'} ] ] + # BlogPost.import values + # + # # Example using column_names and array_of_hash_objects + # columns = [ :author_name, :title ] + # values = [ {author_name: 'zdennis', title: 'test post'} ], [ {author_name: 'jdoe', title: 'another test post'} ] ] + # BlogPost.import columns, values + # + # # Example using column_names and array_of_values + # columns = [ :author_name, :title ] + # values = [ [ 'zdennis', 'test post' ], [ 'jdoe', 'another test post' ] ] + # BlogPost.import columns, values + # + # # Example using column_names, array_of_value and options + # columns = [ :author_name, :title ] + # values = [ [ 'zdennis', 'test post' ], [ 'jdoe', 'another test post' ] ] + # BlogPost.import( columns, values, validate: false ) + # + # # Example synchronizing existing instances in memory + # post = BlogPost.where(author_name: 'zdennis').first + # puts post.author_name # => 'zdennis' + # columns = [ :author_name, :title ] + # values = [ [ 'yoda', 'test post' ] ] + # BlogPost.import posts, synchronize: [ post ] + # puts post.author_name # => 'yoda' + # + # # Example synchronizing unsaved/new instances in memory by using a uniqued imported field + # posts = [BlogPost.new(title: "Foo"), BlogPost.new(title: "Bar")] + # BlogPost.import posts, synchronize: posts, synchronize_keys: [:title] + # puts posts.first.persisted? # => true + # + # == On Duplicate Key Update (MySQL) + # + # The :on_duplicate_key_update option can be either :all, an Array, or a Hash. + # + # ==== Using :all + # + # The :on_duplicate_key_update option can be set to :all. All columns + # other than the primary key are updated. If a list of column names is + # supplied, only those columns will be updated. Below is an example: + # + # BlogPost.import columns, values, on_duplicate_key_update: :all + # + # ==== Using an Array + # + # The :on_duplicate_key_update option can be an array of column + # names. The column names are the only fields that are updated if + # a duplicate record is found. Below is an example: + # + # BlogPost.import columns, values, on_duplicate_key_update: [ :date_modified, :content, :author ] + # + # ==== Using A Hash + # + # The :on_duplicate_key_update option can be a hash of column names + # to model attribute name mappings. This gives you finer grained + # control over what fields are updated with what attributes on your + # model. Below is an example: + # + # BlogPost.import columns, attributes, on_duplicate_key_update: { title: :title } + # + # == On Duplicate Key Update (Postgres 9.5+ and SQLite 3.24+) + # + # The :on_duplicate_key_update option can be :all, an Array, or a Hash with up to + # three attributes, :conflict_target (and optionally :index_predicate) or + # :constraint_name (Postgres), and :columns. + # + # ==== Using :all + # + # The :on_duplicate_key_update option can be set to :all. All columns + # other than the primary key are updated. If a list of column names is + # supplied, only those columns will be updated. Below is an example: + # + # BlogPost.import columns, values, on_duplicate_key_update: :all + # + # ==== Using an Array + # + # The :on_duplicate_key_update option can be an array of column + # names. This option only handles inserts that conflict with the + # primary key. If a table does not have a primary key, this will + # not work. The column names are the only fields that are updated + # if a duplicate record is found. Below is an example: + # + # BlogPost.import columns, values, on_duplicate_key_update: [ :date_modified, :content, :author ] + # + # ==== Using a Hash + # + # The :on_duplicate_key_update option can be a hash with up to three + # attributes, :conflict_target (and optionally :index_predicate) or + # :constraint_name, and :columns. Unlike MySQL, Postgres requires the + # conflicting constraint to be explicitly specified. Using this option + # allows you to specify a constraint other than the primary key. + # + # ===== :conflict_target + # + # The :conflict_target attribute specifies the columns that make up the + # conflicting unique constraint and can be a single column or an array of + # column names. This attribute is ignored if :constraint_name is included, + # but it is the preferred method of identifying a constraint. It will + # default to the primary key. Below is an example: + # + # BlogPost.import columns, values, on_duplicate_key_update: { conflict_target: [ :author_id, :slug ], columns: [ :date_modified ] } + # + # ===== :index_predicate + # + # The :index_predicate attribute optionally specifies a WHERE condition + # on :conflict_target, which is required for matching against partial + # indexes. This attribute is ignored if :constraint_name is included. + # Below is an example: + # + # BlogPost.import columns, values, on_duplicate_key_update: { conflict_target: [ :author_id, :slug ], index_predicate: 'status <> 0', columns: [ :date_modified ] } + # + # ===== :constraint_name + # + # The :constraint_name attribute explicitly identifies the conflicting + # unique index by name. Postgres documentation discourages using this method + # of identifying an index unless absolutely necessary. Below is an example: + # + # BlogPost.import columns, values, on_duplicate_key_update: { constraint_name: :blog_posts_pkey, columns: [ :date_modified ] } + # + # ===== :condition + # + # The :condition attribute optionally specifies a WHERE condition + # on :conflict_action. Only rows for which this expression returns true will be updated. + # Note that it's evaluated last, after a conflict has been identified as a candidate to update. + # Below is an example: + # + # BlogPost.import columns, values, on_duplicate_key_update: { conflict_target: [ :author_id ], condition: "blog_posts.title NOT LIKE '%sample%'", columns: [ :author_name ] } + # + # ===== :columns + # + # The :columns attribute can be either :all, an Array, or a Hash. + # + # ===== Using :all + # + # The :columns attribute can be :all. All columns other than the primary key will be updated. + # If a list of column names is supplied, only those columns will be updated. + # Below is an example: + # + # BlogPost.import columns, values, on_duplicate_key_update: { conflict_target: :slug, columns: :all } + # + # ===== Using an Array + # + # The :columns attribute can be an array of column names. The column names + # are the only fields that are updated if a duplicate record is found. + # Below is an example: + # + # BlogPost.import columns, values, on_duplicate_key_update: { conflict_target: :slug, columns: [ :date_modified, :content, :author ] } + # + # ===== Using a Hash + # + # The :columns option can be a hash of column names to model attribute name + # mappings. This gives you finer grained control over what fields are updated + # with what attributes on your model. Below is an example: + # + # BlogPost.import columns, attributes, on_duplicate_key_update: { conflict_target: :slug, columns: { title: :title } } + # + # = Returns + # This returns an object which responds to +failed_instances+ and +num_inserts+. + # * failed_instances - an array of objects that fails validation and were not committed to the database. An empty array if no validation is performed. + # * num_inserts - the number of insert statements it took to import the data + # * ids - the primary keys of the imported ids if the adapter supports it, otherwise an empty array. + # * results - import results if the adapter supports it, otherwise an empty array. + # + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:530 + def bulk_import(*args); end + + # Imports a collection of values if all values are valid. Import fails at the + # first encountered validation error and raises ActiveRecord::RecordInvalid + # with the failed instance. + # + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:546 + def bulk_import!(*args); end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:530 + def import(*args); end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:546 + def import!(*args); end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:555 + def import_helper(*args); end + + # Imports the passed in +column_names+ and +array_of_attributes+ + # given the passed in +options+ Hash with validations. Returns an + # object with the methods +failed_instances+ and +num_inserts+. + # +failed_instances+ is an array of instances that failed validations. + # +num_inserts+ is the number of inserts it took to import the data. See + # ActiveRecord::Base.import for more information on + # +column_names+, +array_of_attributes+ and +options+. + # + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:763 + def import_with_validations(column_names, array_of_attributes, options = T.unsafe(nil)); end + + # Imports the passed in +column_names+ and +array_of_attributes+ + # given the passed in +options+ Hash. This will return the number + # of insert operations it took to create these records without + # validations or callbacks. See ActiveRecord::Base.import for more + # information on +column_names+, +array_of_attributes_ and + # +options+. + # + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:782 + def import_without_validations_or_callbacks(column_names, array_of_attributes, options = T.unsafe(nil)); end + + # Returns true if the current database connection adapter + # supports import functionality, otherwise returns false. + # + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:268 + def supports_import?(*args); end + + # Returns true if the current database connection adapter + # supports on duplicate key update functionality, otherwise + # returns false. + # + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:275 + def supports_on_duplicate_key_update?; end + + # returns true if the current database connection adapter + # supports setting the primary key of bulk imported models, otherwise + # returns false + # + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:282 + def supports_setting_primary_key_of_imported_objects?; end + + # Synchronizes the passed in ActiveRecord instances with data + # from the database. This is like calling reload on an individual + # ActiveRecord instance but it is intended for use on multiple instances. + # + # This uses one query for all instance updates and then updates existing + # instances rather sending one query for each instance + # + # == Examples + # # Synchronizing existing models by matching on the primary key field + # posts = Post.where(author: "Zach").first + # <.. out of system changes occur to change author name from Zach to Zachary..> + # Post.synchronize posts + # posts.first.author # => "Zachary" instead of Zach + # + # # Synchronizing using custom key fields + # posts = Post.where(author: "Zach").first + # <.. out of system changes occur to change the address of author 'Zach' to 1245 Foo Ln ..> + # Post.synchronize posts, [:name] # queries on the :name column and not the :id column + # posts.first.address # => "1245 Foo Ln" instead of whatever it was + # + # pkg:gem/activerecord-import#lib/activerecord-import/synchronize.rb:25 + def synchronize(instances, keys = T.unsafe(nil)); end + + private + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:1070 + def add_special_rails_stamps(column_names, array_of_attributes, options); end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:860 + def associated_options(options, associated_class); end + + # We are eventually going to call Class.import so we build up a hash + # of class => objects to import. + # + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:994 + def find_associated_objects_for_import(associated_objects_by_class, model); end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:959 + def import_associations(models, options); end + + # Sync belongs_to association ids with foreign key field + # + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:939 + def load_association_ids(model); end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:984 + def schema_columns_hash; end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:869 + def set_attributes_and_mark_clean(models, import_result, timestamps, options); end + + # Checks that the imported hash has the required_keys, optionally also checks that the hash has + # no keys beyond those required when `allow_extra_keys` is false. + # returns `nil` if validation passes, or an error message if it fails + # + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:1122 + def validate_hash_import(hash, required_keys, allow_extra_keys); end + + # Returns an Array of Hashes for the passed in +column_names+ and +array_of_attributes+. + # + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:1115 + def validations_array_for_column_names_and_attributes(column_names, array_of_attributes); end + + # Returns SQL the VALUES for an INSERT statement given the passed in +columns+ + # and +array_of_attributes+. + # + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:1033 + def values_sql_for_columns_and_attributes(columns, array_of_attributes); end + end +end + +# pkg:gem/activerecord-import#lib/activerecord-import/active_record/adapters/abstract_adapter.rb:6 +module ActiveRecord::ConnectionAdapters; end + +# pkg:gem/activerecord-import#lib/activerecord-import/active_record/adapters/abstract_adapter.rb:7 +class ActiveRecord::ConnectionAdapters::AbstractAdapter + include ::ActiveRecord::Migration::JoinTable + include ::ActiveRecord::Import::AbstractAdapter::InstanceMethods +end + +# pkg:gem/activerecord-import#lib/activerecord-import/base.rb:7 +module ActiveRecord::Import + class << self + # pkg:gem/activerecord-import#lib/activerecord-import/base.rb:10 + def base_adapter(adapter); end + + # Loads the import functionality for the passed in ActiveRecord connection + # + # pkg:gem/activerecord-import#lib/activerecord-import/base.rb:31 + def load_from_connection_pool(connection_pool); end + + # Loads the import functionality for a specific database adapter + # + # pkg:gem/activerecord-import#lib/activerecord-import/base.rb:24 + def require_adapter(adapter); end + end +end + +# pkg:gem/activerecord-import#lib/activerecord-import/base.rb:8 +ActiveRecord::Import::ADAPTER_PATH = T.let(T.unsafe(nil), String) + +# pkg:gem/activerecord-import#lib/activerecord-import/adapters/abstract_adapter.rb:3 +module ActiveRecord::Import::AbstractAdapter; end + +# pkg:gem/activerecord-import#lib/activerecord-import/adapters/abstract_adapter.rb:4 +module ActiveRecord::Import::AbstractAdapter::InstanceMethods + # Synchronizes the passed in ActiveRecord instances with the records in + # the database by calling +reload+ on each instance. + # + # pkg:gem/activerecord-import#lib/activerecord-import/adapters/abstract_adapter.rb:42 + def after_import_synchronize(instances); end + + # pkg:gem/activerecord-import#lib/activerecord-import/adapters/abstract_adapter.rb:65 + def increment_locking_column!(table_name, results, locking_column); end + + # pkg:gem/activerecord-import#lib/activerecord-import/adapters/abstract_adapter.rb:9 + def insert_many(sql, values, _options = T.unsafe(nil), *args); end + + # pkg:gem/activerecord-import#lib/activerecord-import/adapters/abstract_adapter.rb:5 + def next_value_for_sequence(sequence_name); end + + # Returns an array of post SQL statements given the passed in options. + # + # pkg:gem/activerecord-import#lib/activerecord-import/adapters/abstract_adapter.rb:47 + def post_sql_statements(table_name, options); end + + # pkg:gem/activerecord-import#lib/activerecord-import/adapters/abstract_adapter.rb:25 + def pre_sql_statements(options); end + + # pkg:gem/activerecord-import#lib/activerecord-import/adapters/abstract_adapter.rb:71 + def supports_on_duplicate_key_update?; end +end + +# pkg:gem/activerecord-import#lib/activerecord-import/import.rb:254 +module ActiveRecord::Import::Connection + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:255 + def establish_connection(args = T.unsafe(nil)); end +end + +# pkg:gem/activerecord-import#lib/activerecord-import/import.rb:5 +module ActiveRecord::Import::ConnectionAdapters; end + +# pkg:gem/activerecord-import#lib/activerecord-import/import.rb:10 +module ActiveRecord::Import::ImportSupport + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:11 + def supports_import?; end +end + +# pkg:gem/activerecord-import#lib/activerecord-import/import.rb:22 +class ActiveRecord::Import::MissingColumnError < ::StandardError + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:23 + def initialize(name, index); end +end + +# pkg:gem/activerecord-import#lib/activerecord-import/import.rb:16 +module ActiveRecord::Import::OnDuplicateKeyUpdateSupport + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:17 + def supports_on_duplicate_key_update?; end +end + +# pkg:gem/activerecord-import#lib/activerecord-import/import.rb:8 +class ActiveRecord::Import::Result < ::Struct + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:8 + def failed_instances; end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:8 + def failed_instances=(_); end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:8 + def ids; end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:8 + def ids=(_); end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:8 + def num_inserts; end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:8 + def num_inserts=(_); end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:8 + def results; end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:8 + def results=(_); end + + class << self + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:8 + def [](*_arg0); end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:8 + def inspect; end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:8 + def keyword_init?; end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:8 + def members; end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:8 + def new(*_arg0); end + end +end + +# pkg:gem/activerecord-import#lib/activerecord-import/import.rb:28 +class ActiveRecord::Import::Validator + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:29 + def initialize(klass, options = T.unsafe(nil)); end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:35 + def init_validations(klass); end + + # pkg:gem/activerecord-import#lib/activerecord-import/import.rb:75 + def valid_model?(model); end +end + +# pkg:gem/activerecord-import#lib/activerecord-import/value_sets_parser.rb:6 +class ActiveRecord::Import::ValueSetTooLargeError < ::StandardError + # pkg:gem/activerecord-import#lib/activerecord-import/value_sets_parser.rb:9 + def initialize(msg = T.unsafe(nil), size = T.unsafe(nil)); end + + # pkg:gem/activerecord-import#lib/activerecord-import/value_sets_parser.rb:7 + def size; end +end + +# pkg:gem/activerecord-import#lib/activerecord-import/value_sets_parser.rb:15 +class ActiveRecord::Import::ValueSetsBytesParser + # pkg:gem/activerecord-import#lib/activerecord-import/value_sets_parser.rb:22 + def initialize(values, options); end + + # pkg:gem/activerecord-import#lib/activerecord-import/value_sets_parser.rb:16 + def max_bytes; end + + # pkg:gem/activerecord-import#lib/activerecord-import/value_sets_parser.rb:28 + def parse; end + + # pkg:gem/activerecord-import#lib/activerecord-import/value_sets_parser.rb:16 + def reserved_bytes; end + + # pkg:gem/activerecord-import#lib/activerecord-import/value_sets_parser.rb:16 + def values; end + + private + + # pkg:gem/activerecord-import#lib/activerecord-import/value_sets_parser.rb:59 + def default_max_bytes; end + + class << self + # pkg:gem/activerecord-import#lib/activerecord-import/value_sets_parser.rb:18 + def parse(values, options); end + end +end + +# pkg:gem/activerecord-import#lib/activerecord-import/value_sets_parser.rb:66 +class ActiveRecord::Import::ValueSetsRecordsParser + # pkg:gem/activerecord-import#lib/activerecord-import/value_sets_parser.rb:73 + def initialize(values, options); end + + # pkg:gem/activerecord-import#lib/activerecord-import/value_sets_parser.rb:67 + def max_records; end + + # pkg:gem/activerecord-import#lib/activerecord-import/value_sets_parser.rb:78 + def parse; end + + # pkg:gem/activerecord-import#lib/activerecord-import/value_sets_parser.rb:67 + def values; end + + class << self + # pkg:gem/activerecord-import#lib/activerecord-import/value_sets_parser.rb:69 + def parse(values, options); end + end +end diff --git a/sorbet/rbi/gems/activerecord-session_store@2.1.0.rbi b/sorbet/rbi/gems/activerecord-session_store@2.1.0.rbi new file mode 100644 index 000000000..e88320eed --- /dev/null +++ b/sorbet/rbi/gems/activerecord-session_store@2.1.0.rbi @@ -0,0 +1,459 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `activerecord-session_store` gem. +# Please instead update this file by running `bin/tapioca gem activerecord-session_store`. + + +# pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:4 +module ActionDispatch; end + +# pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:5 +module ActionDispatch::Session; end + +# = Active Record Session Store +# +# A session store backed by an Active Record class. A default class is +# provided, but any object duck-typing to an Active Record Session class +# with text +session_id+ and +data+ attributes is sufficient. +# +# The default assumes a +sessions+ tables with columns: +# +id+ (numeric primary key), +# +session_id+ (string, usually varchar; maximum length is 255), and +# +data+ (text or longtext; careful if your session data exceeds 65KB). +# +# The +session_id+ column should always be indexed for speedy lookups. +# Session data is marshaled to the +data+ column in Base64 format. +# If the data you write is larger than the column's size limit, +# ActionController::SessionOverflowError will be raised. +# +# You may configure the table name, primary key, and data column. +# For example, at the end of config/application.rb: +# +# ActiveRecord::SessionStore::Session.table_name = 'legacy_session_table' +# ActiveRecord::SessionStore::Session.primary_key = 'session_id' +# ActiveRecord::SessionStore::Session.data_column_name = 'legacy_session_data' +# +# Note that setting the primary key to the +session_id+ frees you from +# having a separate +id+ column if you don't want it. However, you must +# set session.model.id = session.session_id by hand! A before filter +# on ApplicationController is a good place. +# +# Since the default class is a simple Active Record, you get timestamps +# for free if you add +created_at+ and +updated_at+ datetime columns to +# the +sessions+ table, making periodic session expiration a snap. +# +# You may provide your own session class implementation, whether a +# feature-packed Active Record or a bare-metal high-performance SQL +# store, by setting +# +# ActionDispatch::Session::ActiveRecordStore.session_class = MySessionClass +# +# You must implement these methods: +# +# self.find_by_session_id(session_id) +# initialize(hash_of_session_id_and_data, options_hash = {}) +# attr_reader :session_id +# attr_accessor :data +# save +# destroy +# +# The example SqlBypass class is a generic SQL session store. You may +# use it as a basis for high-performance database-specific stores. +# +# pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:55 +class ActionDispatch::Session::ActiveRecordStore < ::ActionDispatch::Session::AbstractSecureStore + # pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:58 + def session_class; end + + # pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:58 + def session_class=(_arg0); end + + # pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:58 + def session_class?; end + + private + + # pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:94 + def delete_session(request, session_id, options); end + + # pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:146 + def find_session(request, id); end + + # pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:64 + def get_session(request, sid); end + + # pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:118 + def get_session_model(request, id); end + + # pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:135 + def get_session_with_fallback(sid); end + + # pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:157 + def logger; end + + # pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:77 + def write_session(request, sid, session_data, options); end + + class << self + # pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:161 + def private_session_id?(session_id); end + + # pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:58 + def session_class; end + + # pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:58 + def session_class=(value); end + + # pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:58 + def session_class?; end + end +end + +# pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:61 +ActionDispatch::Session::ActiveRecordStore::ENV_SESSION_OPTIONS_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:151 +module ActionDispatch::Session::ActiveRecordStore::NilLogger + class << self + # pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:152 + def silence; end + end +end + +# pkg:gem/activerecord-session_store#lib/action_dispatch/session/active_record_store.rb:60 +ActionDispatch::Session::ActiveRecordStore::SESSION_RECORD_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/activerecord-session_store#lib/active_record/session_store/version.rb:1 +module ActiveRecord; end + +# pkg:gem/activerecord-session_store#lib/active_record/session_store/version.rb:2 +module ActiveRecord::SessionStore; end + +# pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:11 +module ActiveRecord::SessionStore::ClassMethods + # pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:27 + def create_table!; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:18 + def deserialize(data); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:22 + def drop_table!; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:14 + def serialize(data); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:12 + def serializer; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:12 + def serializer=(val); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:36 + def serializer_class; end + + class << self + # pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:12 + def serializer; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:12 + def serializer=(val); end + end +end + +# Transparently migrates existing session values from Marshal to JSON +# +# pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:75 +class ActiveRecord::SessionStore::ClassMethods::HybridSerializer < ::ActiveRecord::SessionStore::ClassMethods::JsonSerializer + class << self + # pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:78 + def load(value); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:86 + def needs_migration?(value); end + end +end + +# pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:76 +ActiveRecord::SessionStore::ClassMethods::HybridSerializer::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# Uses built-in JSON library to encode/decode session +# +# pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:63 +class ActiveRecord::SessionStore::ClassMethods::JsonSerializer + class << self + # pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:69 + def dump(value); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:64 + def load(value); end + end +end + +# Use Marshal with Base64 encoding +# +# pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:52 +class ActiveRecord::SessionStore::ClassMethods::MarshalSerializer + class << self + # pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:57 + def dump(value); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:53 + def load(value); end + end +end + +# Defer serialization to the ActiveRecord database adapter +# +# pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:92 +class ActiveRecord::SessionStore::ClassMethods::NullSerializer + class << self + # pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:97 + def dump(value); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store.rb:93 + def load(value); end + end +end + +# pkg:gem/activerecord-session_store#lib/active_record/session_store/railtie.rb:5 +class ActiveRecord::SessionStore::Railtie < ::Rails::Railtie; end + +# The default Active Record class. +# +# pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:7 +class ActiveRecord::SessionStore::Session < ::ActiveRecord::Base + include ::ActiveRecord::SessionStore::Session::GeneratedAttributeMethods + include ::ActiveRecord::SessionStore::Session::GeneratedAssociationMethods + extend ::ActiveRecord::SessionStore::ClassMethods + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:57 + def initialize(*); end + + # Lazy-deserialize session state. + # + # pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:63 + def data; end + + # Lazy-deserialize session state. + # + # pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:67 + def data=(_arg0); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:14 + def data_column_name; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:14 + def data_column_name=(val); end + + # Has the session been loaded yet? + # + # pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:70 + def loaded?; end + + # This method was introduced when addressing CVE-2019-16782 + # (see https://github.com/rack/rack/security/advisories/GHSA-hrqr-hxpp-chr3). + # Sessions created on version <= 1.1.3 were guessable via a timing attack. + # To secure sessions created on those old versions, this method can be called + # on all existing sessions in the database. Users will not lose their session + # when this is done. + # + # pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:80 + def secure!; end + + private + + # Ensures that the data about to be stored in the database is not + # larger than the data storage column. Raises + # ActionController::SessionOverflowError. + # + # pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:106 + def raise_on_session_data_overflow!; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:96 + def serialize_data!; end + + class << self + # pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:14 + def data_column_name; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:14 + def data_column_name=(val); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:21 + def data_column_size_limit; end + + # Hook to set up sessid compatibility. + # + # pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:26 + def find_by_session_id(session_id); end + + private + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:32 + def session_id_column; end + + # Compatibility with tables using sessid instead of session_id. + # + # pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:37 + def setup_sessid_compatibility!; end + end +end + +# pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:7 +module ActiveRecord::SessionStore::Session::GeneratedAssociationMethods; end + +# pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:7 +module ActiveRecord::SessionStore::Session::GeneratedAttributeMethods; end + +# pkg:gem/activerecord-session_store#lib/active_record/session_store/session.rb:9 +ActiveRecord::SessionStore::Session::SEMAPHORE = T.let(T.unsafe(nil), Thread::Mutex) + +# A barebones session store which duck-types with the default session +# store but bypasses Active Record and issues SQL directly. This is +# an example session model class meant as a basis for your own classes. +# +# The database connection, table name, and session id and data columns +# are configurable class attributes. Serializing and deserializeing +# are implemented as class methods that you may override. By default, +# serializing data is +# +# ::Base64.encode64(Marshal.dump(data)) +# +# and deserializing data is +# +# Marshal.load(::Base64.decode64(data)) +# +# This serializing behavior is intended to store the widest range of +# binary session data in a +text+ column. For higher performance, +# store in a +blob+ column instead and forgo the Base64 encoding. +# +# pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:23 +class ActiveRecord::SessionStore::SqlBypass + extend ::ActiveRecord::SessionStore::ClassMethods + + # Look for normal and serialized data, self.find_by_session_id's way of + # telling us to postpone deserializing until the data is requested. + # We need to handle a normal data attribute in case of a new record. + # + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:80 + def initialize(attributes); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:69 + def connection(&block); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:69 + def connection=(arg); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:69 + def connection_pool(&block); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:69 + def connection_pool=(arg); end + + # Lazy-deserialize session state. + # + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:94 + def data; end + + # Lazy-deserialize session state. + # + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:75 + def data=(_arg0); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:41 + def data_column; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:41 + def data_column=(val); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:135 + def destroy; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:105 + def loaded?; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:71 + def new_record; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:73 + def new_record?; end + + # Returns true if the record is persisted, i.e. it's not a new record + # + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:89 + def persisted?; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:109 + def save; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:72 + def session_id; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:72 + def session_id=(_arg0); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:35 + def session_id_column; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:35 + def session_id_column=(val); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:29 + def table_name; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:29 + def table_name=(val); end + + class << self + # Use the ActiveRecord::Base.connection by default. + # + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:53 + def connection; end + + # Use the ActiveRecord::Base.connection by default. + # + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:48 + def connection=(_arg0); end + + # Use the ActiveRecord::Base.connection_pool by default. + # + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:57 + def connection_pool; end + + # Use the ActiveRecord::Base.connection_pool by default. + # + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:51 + def connection_pool=(_arg0); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:41 + def data_column; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:41 + def data_column=(val); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:45 + def data_column_name; end + + # Look up a session by id and deserialize its data if found. + # + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:62 + def find_by_session_id(session_id); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:35 + def session_id_column; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:35 + def session_id_column=(val); end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:29 + def table_name; end + + # pkg:gem/activerecord-session_store#lib/active_record/session_store/sql_bypass.rb:29 + def table_name=(val); end + end +end + +# pkg:gem/activerecord-session_store#lib/active_record/session_store/version.rb:3 +ActiveRecord::SessionStore::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/activerecord@7.1.3.4.rbi b/sorbet/rbi/gems/activerecord@7.1.3.4.rbi new file mode 100644 index 000000000..051d046fe --- /dev/null +++ b/sorbet/rbi/gems/activerecord@7.1.3.4.rbi @@ -0,0 +1,37987 @@ +# 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`. + + +# pkg:gem/activerecord#lib/active_record/type.rb:59 +class ActiveModel::Type::BigInteger < ::ActiveModel::Type::Integer; end + +# pkg:gem/activerecord#lib/active_record/type.rb:65 +class ActiveModel::Type::ImmutableString < ::ActiveModel::Type::Value; end + +# pkg:gem/activerecord#lib/active_record/type.rb:64 +class ActiveModel::Type::Integer < ::ActiveModel::Type::Value; end + +# pkg:gem/activerecord#lib/active_record/type.rb:66 +class ActiveModel::Type::String < ::ActiveModel::Type::ImmutableString; end + +# pkg:gem/activerecord#lib/active_record/type.rb:67 +class ActiveModel::Type::Value; end + +# :include: activerecord/README.rdoc +# :enddoc: +# +# pkg:gem/activerecord#lib/active_record/gem_version.rb:3 +module ActiveRecord + include ::ActiveSupport::Deprecation::DeprecatedConstantAccessor + extend ::ActiveSupport::Autoload + + class << self + # pkg:gem/activerecord#lib/active_record.rb:342 + def action_on_strict_loading_violation; end + + # pkg:gem/activerecord#lib/active_record.rb:342 + def action_on_strict_loading_violation=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:422 + def allow_deprecated_singular_associations_name; end + + # pkg:gem/activerecord#lib/active_record.rb:422 + def allow_deprecated_singular_associations_name=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:335 + def application_record_class; end + + # pkg:gem/activerecord#lib/active_record.rb:335 + def application_record_class=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:263 + def async_query_executor; end + + # pkg:gem/activerecord#lib/active_record.rb:263 + def async_query_executor=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:317 + def before_committed_on_all_records; end + + # pkg:gem/activerecord#lib/active_record.rb:317 + def before_committed_on_all_records=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:314 + def belongs_to_required_validates_foreign_key; end + + # pkg:gem/activerecord#lib/active_record.rb:314 + def belongs_to_required_validates_foreign_key=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:323 + def commit_transaction_on_non_local_return; end + + # pkg:gem/activerecord#lib/active_record.rb:323 + def commit_transaction_on_non_local_return=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:209 + def db_warnings_action; end + + # pkg:gem/activerecord#lib/active_record.rb:211 + def db_warnings_action=(action); end + + # pkg:gem/activerecord#lib/active_record.rb:236 + def db_warnings_ignore; end + + # pkg:gem/activerecord#lib/active_record.rb:236 + def db_warnings_ignore=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:192 + 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. + # + # pkg:gem/activerecord#lib/active_record.rb:196 + def default_timezone=(default_timezone); end + + # pkg:gem/activerecord#lib/active_record/deprecator.rb:4 + def deprecator; end + + # pkg:gem/activerecord#lib/active_record.rb:177 + def disable_prepared_statements; end + + # pkg:gem/activerecord#lib/active_record.rb:177 + def disable_prepared_statements=(_arg0); end + + # Explicitly closes all database connections in all pools. + # + # pkg:gem/activerecord#lib/active_record.rb:476 + def disconnect_all!; end + + # pkg:gem/activerecord#lib/active_record.rb:382 + def dump_schema_after_migration; end + + # pkg:gem/activerecord#lib/active_record.rb:382 + def dump_schema_after_migration=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:392 + def dump_schemas; end + + # pkg:gem/activerecord#lib/active_record.rb:392 + def dump_schemas=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:465 + def eager_load!; end + + # pkg:gem/activerecord#lib/active_record.rb:361 + def error_on_ignored_order; end + + # pkg:gem/activerecord#lib/active_record.rb:361 + def error_on_ignored_order=(_arg0); end + + # Returns the currently loaded version of Active Record as a +Gem::Version+. + # + # pkg:gem/activerecord#lib/active_record/gem_version.rb:5 + def gem_version; end + + # pkg:gem/activerecord#lib/active_record.rb:454 + def generate_secure_token_on; end + + # pkg:gem/activerecord#lib/active_record.rb:454 + def generate_secure_token_on=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:286 + 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. + # + # pkg:gem/activerecord#lib/active_record.rb:278 + def global_executor_concurrency=(global_executor_concurrency); end + + # pkg:gem/activerecord#lib/active_record.rb:266 + def global_thread_pool_async_query_executor; end + + # pkg:gem/activerecord#lib/active_record.rb:290 + def index_nested_attribute_errors; end + + # pkg:gem/activerecord#lib/active_record.rb:290 + def index_nested_attribute_errors=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:183 + def lazily_load_schema_cache; end + + # pkg:gem/activerecord#lib/active_record.rb:183 + def lazily_load_schema_cache=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:245 + def legacy_connection_handling=(_); end + + # pkg:gem/activerecord#lib/active_record.rb:308 + def maintain_test_schema; end + + # pkg:gem/activerecord#lib/active_record.rb:308 + def maintain_test_schema=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:457 + def marshalling_format_version; end + + # pkg:gem/activerecord#lib/active_record.rb:461 + def marshalling_format_version=(value); end + + # pkg:gem/activerecord#lib/active_record.rb:373 + def migration_strategy; end + + # pkg:gem/activerecord#lib/active_record.rb:373 + def migration_strategy=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:425 + def query_transformers; end + + # pkg:gem/activerecord#lib/active_record.rb:425 + def query_transformers=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:305 + def queues; end + + # pkg:gem/activerecord#lib/active_record.rb:305 + def queues=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:440 + def raise_int_wider_than_64bit; end + + # pkg:gem/activerecord#lib/active_record.rb:440 + def raise_int_wider_than_64bit=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:311 + def raise_on_assign_to_attr_readonly; end + + # pkg:gem/activerecord#lib/active_record.rb:311 + def raise_on_assign_to_attr_readonly=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:242 + def reading_role; end + + # pkg:gem/activerecord#lib/active_record.rb:242 + def reading_role=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:320 + def run_after_transaction_callbacks_in_order_defined; end + + # pkg:gem/activerecord#lib/active_record.rb:320 + def run_after_transaction_callbacks_in_order_defined=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:189 + def schema_cache_ignored_tables; end + + # pkg:gem/activerecord#lib/active_record.rb:189 + def schema_cache_ignored_tables=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:353 + def schema_format; end + + # pkg:gem/activerecord#lib/active_record.rb:353 + def schema_format=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:395 + def suppress_multiple_database_warning; end + + # pkg:gem/activerecord#lib/active_record.rb:402 + def suppress_multiple_database_warning=(value); end + + # pkg:gem/activerecord#lib/active_record.rb:367 + def timestamped_migrations; end + + # pkg:gem/activerecord#lib/active_record.rb:367 + def timestamped_migrations=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:432 + def use_yaml_unsafe_load; end + + # pkg:gem/activerecord#lib/active_record.rb:432 + def use_yaml_unsafe_load=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:298 + def verbose_query_logs; end + + # pkg:gem/activerecord#lib/active_record.rb:298 + def verbose_query_logs=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:415 + def verify_foreign_keys_for_fixtures; end + + # pkg:gem/activerecord#lib/active_record.rb:415 + def verify_foreign_keys_for_fixtures=(_arg0); end + + # Returns the currently loaded version of Active Record as a +Gem::Version+. + # + # pkg:gem/activerecord#lib/active_record/version.rb:7 + def version; end + + # pkg:gem/activerecord#lib/active_record.rb:332 + def warn_on_records_fetched_greater_than; end + + # pkg:gem/activerecord#lib/active_record.rb:332 + def warn_on_records_fetched_greater_than=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:239 + def writing_role; end + + # pkg:gem/activerecord#lib/active_record.rb:239 + def writing_role=(_arg0); end + + # pkg:gem/activerecord#lib/active_record.rb:447 + def yaml_column_permitted_classes; end + + # pkg:gem/activerecord#lib/active_record.rb:447 + def yaml_column_permitted_classes=(_arg0); end + end +end + +# = Active Record Errors +# +# Generic Active Record exception class. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:7 +class ActiveRecord::ActiveRecordError < ::StandardError; end + +# Superclass for all errors raised from an Active Record adapter. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:59 +class ActiveRecord::AdapterError < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/errors.rb:60 + def initialize(message = T.unsafe(nil), connection_pool: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/errors.rb:65 + def connection_pool; end +end + +# Raised when Active Record cannot find database adapter specified in +# +config/database.yml+ or programmatically. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:55 +class ActiveRecord::AdapterNotFound < ::ActiveRecord::ActiveRecordError; end + +# Raised when adapter not specified on connection (or configuration file +# +config/database.yml+ misses adapter field). +# +# pkg:gem/activerecord#lib/active_record/errors.rb:46 +class ActiveRecord::AdapterNotSpecified < ::ActiveRecord::ActiveRecordError; end + +# AdapterTimeout will be raised when database clients times out while waiting from the server. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:550 +class ActiveRecord::AdapterTimeout < ::ActiveRecord::QueryAborted; end + +# See ActiveRecord::Aggregations::ClassMethods for documentation +# +# pkg:gem/activerecord#lib/active_record/aggregations.rb:5 +module ActiveRecord::Aggregations + # pkg:gem/activerecord#lib/active_record/aggregations.rb:11 + def reload(*); end + + private + + # pkg:gem/activerecord#lib/active_record/aggregations.rb:17 + def clear_aggregation_cache; end + + # pkg:gem/activerecord#lib/active_record/aggregations.rb:21 + def init_internals; end + + # pkg:gem/activerecord#lib/active_record/aggregations.rb:6 + def initialize_dup(*); 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")) +# +# pkg:gem/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) } + # + # pkg:gem/activerecord#lib/active_record/aggregations.rb:225 + def composed_of(part_id, options = T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/active_record/aggregations.rb:248 + def reader_method(name, class_name, mapping, allow_nil, constructor); end + + # pkg:gem/activerecord#lib/active_record/aggregations.rb:261 + def writer_method(name, class_name, mapping, allow_nil, converter); end +end + +# pkg:gem/activerecord#lib/active_record/associations.rb:203 +class ActiveRecord::AmbiguousSourceReflectionForThroughAssociation < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/associations.rb:204 + def initialize(klass, macro, association_name, options, possible_sources); end +end + +# pkg:gem/activerecord#lib/active_record/associations.rb:4 +class ActiveRecord::AssociationNotFoundError < ::ActiveRecord::ConfigurationError + include ::DidYouMean::Correctable + + # pkg:gem/activerecord#lib/active_record/associations.rb:7 + def initialize(record = T.unsafe(nil), association_name = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/associations.rb:5 + def association_name; end + + # pkg:gem/activerecord#lib/active_record/associations.rb:20 + def corrections; end + + # pkg:gem/activerecord#lib/active_record/associations.rb:5 + def record; end +end + +# pkg:gem/activerecord#lib/active_record/association_relation.rb:4 +class ActiveRecord::AssociationRelation < ::ActiveRecord::Relation + # pkg:gem/activerecord#lib/active_record/association_relation.rb:5 + def initialize(klass, association, **); end + + # pkg:gem/activerecord#lib/active_record/association_relation.rb:14 + def ==(other); end + + # pkg:gem/activerecord#lib/active_record/association_relation.rb:19 + def insert(attributes, **kwargs); end + + # pkg:gem/activerecord#lib/active_record/association_relation.rb:19 + def insert!(attributes, **kwargs); end + + # pkg:gem/activerecord#lib/active_record/association_relation.rb:19 + def insert_all(attributes, **kwargs); end + + # pkg:gem/activerecord#lib/active_record/association_relation.rb:19 + def insert_all!(attributes, **kwargs); end + + # pkg:gem/activerecord#lib/active_record/association_relation.rb:10 + def proxy_association; end + + # pkg:gem/activerecord#lib/active_record/association_relation.rb:19 + def upsert(attributes, **kwargs); end + + # pkg:gem/activerecord#lib/active_record/association_relation.rb:19 + def upsert_all(attributes, **kwargs); end + + private + + # pkg:gem/activerecord#lib/active_record/association_relation.rb:35 + def _create(attributes, &block); end + + # pkg:gem/activerecord#lib/active_record/association_relation.rb:39 + def _create!(attributes, &block); end + + # pkg:gem/activerecord#lib/active_record/association_relation.rb:31 + def _new(attributes, &block); end + + # pkg:gem/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.") +# +# pkg:gem/activerecord#lib/active_record/errors.rb:37 +class ActiveRecord::AssociationTypeMismatch < ::ActiveRecord::ActiveRecordError; end + +# See ActiveRecord::Associations::ClassMethods for documentation. +# +# pkg:gem/activerecord#lib/active_record/associations.rb:267 +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 + # + # pkg:gem/activerecord#lib/active_record/associations.rb:313 + def association(name); end + + # pkg:gem/activerecord#lib/active_record/associations.rb:327 + def association_cached?(name); end + + private + + # Returns the specified association instance if it exists, +nil+ otherwise. + # + # pkg:gem/activerecord#lib/active_record/associations.rb:343 + def association_instance_get(name); end + + # Set the specified association instance. + # + # pkg:gem/activerecord#lib/active_record/associations.rb:348 + def association_instance_set(name, association); end + + # pkg:gem/activerecord#lib/active_record/associations.rb:337 + def init_internals; end + + # pkg:gem/activerecord#lib/active_record/associations.rb:331 + def initialize_dup(*); end + + class << self + # pkg:gem/activerecord#lib/active_record/associations.rb:306 + def eager_load!; end + end +end + +# Keeps track of table aliases for ActiveRecord::Associations::JoinDependency +# +# pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/associations/alias_tracker.rb:49 + def initialize(connection, aliases); end + + # pkg:gem/activerecord#lib/active_record/associations/alias_tracker.rb:54 + def aliased_table_for(arel_table, table_name = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/associations/alias_tracker.rb:76 + def aliases; end + + private + + # pkg:gem/activerecord#lib/active_record/associations/alias_tracker.rb:79 + def truncate(name); end + + class << self + # pkg:gem/activerecord#lib/active_record/associations/alias_tracker.rb:9 + def create(connection, initial_table, joins, aliases = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/associations/alias_tracker.rb:26 + 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. +# +# pkg:gem/activerecord#lib/active_record/associations/association.rb:35 +class ActiveRecord::Associations::Association + # pkg:gem/activerecord#lib/active_record/associations/association.rb:41 + def initialize(owner, reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:206 + def create(attributes = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:210 + def create!(attributes = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:37 + def disable_joins; end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:155 + def extensions; end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:196 + def initialize_attributes(record, except_from_scope_attributes = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:139 + def inversed_from(record); end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:143 + 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. + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:151 + 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. + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:175 + def load_target; end + + # Asserts the \target has been loaded setting the \loaded flag to +true+. + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:80 + def loaded!; end + + # Has the \target been already \loaded? + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:75 + def loaded?; end + + # We can't dump @reflection and @through_reflection since it contains the scope proc + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:185 + def marshal_dump; end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:190 + def marshal_load(data); end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:39 + def options(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:36 + def owner; end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:36 + def owner=(_arg0); end + + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:66 + def reload(force = T.unsafe(nil)); end + + # Remove the inverse association, if possible + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:133 + def remove_inverse_instance(record); end + + # Resets the \loaded flag to +false+ and sets the \target to +nil+. + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:54 + def reset; end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:60 + def reset_negative_cache; end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:113 + def reset_scope; end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:101 + def scope; end + + # Set the inverse association, if possible + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:118 + def set_inverse_instance(record); end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:125 + def set_inverse_instance_from_queries(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. + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:91 + def stale_target?; end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:37 + def target; end + + # Sets the target of this association to \target, and the \loaded flag to +true+. + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:96 + 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. + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:269 + def association_scope; end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:352 + def build_record(attributes); end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:367 + 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. + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:217 + def ensure_klass_exists!; end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:221 + def find_target; end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:289 + def find_target?; end + + # Returns true if record contains the foreign_key + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:339 + 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. + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:301 + def foreign_key_present?; end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:375 + def inversable?(record); end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:319 + 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. + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:328 + 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. + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:334 + def invertible_for?(record); end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:380 + 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. + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:308 + def raise_on_type_mismatch!(record); end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:285 + def scope_for_create; end + + # Returns true if statement cache should be skipped on the association reader. + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:360 + def skip_statement_cache?(scope); end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:245 + 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. + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:349 + def stale_state; end + + # Can be overridden (i.e. in ThroughAssociation) to merge in other scopes (i.e. the + # through association's scope) + # + # pkg:gem/activerecord#lib/active_record/associations/association.rb:281 + def target_scope; end + + # pkg:gem/activerecord#lib/active_record/associations/association.rb:253 + def violates_strict_loading?; end +end + +# pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:5 +class ActiveRecord::Associations::AssociationScope + # pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:15 + def initialize(value_transformation); end + + # pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:21 + def scope(association); end + + private + + # pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:124 + def add_constraints(scope, owner, chain); end + + # pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:161 + def apply_scope(scope, table, key, value); end + + # pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:169 + def eval_scope(reflection, scope, owner); end + + # pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:112 + def get_chain(reflection, association, tracker); end + + # pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:54 + def join(table, constraint); end + + # pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:58 + def last_chain_scope(scope, reflection, owner); end + + # pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:81 + def next_chain_scope(scope, reflection, next_reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:77 + def transform_value(value); end + + # pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:52 + def value_transformation; end + + class << self + # pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:10 + def create(&block); end + + # pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:34 + def get_bind_values(owner, chain); end + + # pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:6 + def scope(association); end + end +end + +# pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:19 +ActiveRecord::Associations::AssociationScope::INSTANCE = T.let(T.unsafe(nil), ActiveRecord::Associations::AssociationScope) + +# pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:101 +class ActiveRecord::Associations::AssociationScope::ReflectionProxy < ::SimpleDelegator + # pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:104 + def initialize(reflection, aliased_table); end + + # pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:102 + def aliased_table; end + + # pkg:gem/activerecord#lib/active_record/associations/association_scope.rb:109 + def all_includes; end +end + +# = Active Record Belongs To Association +# +# pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:6 +class ActiveRecord::Associations::BelongsToAssociation < ::ActiveRecord::Associations::SingularAssociation + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:53 + def decrement_counters; end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:61 + def decrement_counters_before_last_save; end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:40 + def default(&block); end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:7 + def handle_dependency; end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:57 + def increment_counters; end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:35 + def inversed_from(record); end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:44 + def reset; end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:84 + def saved_change_to_target?; end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:76 + def target_changed?; end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:80 + def target_previously_changed?; end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:49 + def updated?; end + + private + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:118 + def find_target?; end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:141 + def foreign_key_present?; end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:145 + def invertible_for?(record); end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:137 + def primary_key(klass); end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:89 + def replace(record); end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:126 + def replace_keys(record, force: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:122 + def require_counter_update?; end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:150 + def stale_state; end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:103 + def update_counters(by); end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_association.rb:113 + def update_counters_via_scope(klass, foreign_key, by); end +end + +# = Active Record Belongs To Polymorphic Association +# +# pkg:gem/activerecord#lib/active_record/associations/belongs_to_polymorphic_association.rb:6 +class ActiveRecord::Associations::BelongsToPolymorphicAssociation < ::ActiveRecord::Associations::BelongsToAssociation + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_polymorphic_association.rb:7 + def klass; end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_polymorphic_association.rb:20 + def saved_change_to_target?; end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_polymorphic_association.rb:12 + def target_changed?; end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_polymorphic_association.rb:16 + def target_previously_changed?; end + + private + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_polymorphic_association.rb:35 + def inverse_reflection_for(record); end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_polymorphic_association.rb:39 + def raise_on_type_mismatch!(record); end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_polymorphic_association.rb:25 + def replace_keys(record, force: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/associations/belongs_to_polymorphic_association.rb:43 + def stale_state; end +end + +# This is the parent Association class which defines the variables +# used by all associations. +# +# The hierarchy is defined as follows: +# Association +# - SingularAssociation +# - BelongsToAssociation +# - HasOneAssociation +# - CollectionAssociation +# - HasManyAssociation +# This class is inherited by the has_one and belongs_to association classes +# +# pkg:gem/activerecord#lib/active_record/associations.rb:280 +module ActiveRecord::Associations::Builder; end + +# pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:15 +class ActiveRecord::Associations::Builder::Association + class << self + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:25 + def build(model, name, scope, options, &block); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:40 + def create_reflection(model, name, scope, options, &block); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:17 + def extensions; end + + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:17 + def extensions=(_arg0); end + + private + + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:144 + def add_after_commit_jobs_callback(model, dependent); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:139 + def add_destroy_callbacks(model, reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:53 + def build_scope(scope); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:129 + 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... + # + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:94 + def define_accessors(model, reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:76 + def define_callbacks(model, reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:121 + def define_change_tracking_methods(model, reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:73 + def define_extensions(model, name); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:101 + def define_readers(mixin, name); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:117 + def define_validations(model, reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:109 + def define_writers(mixin, name); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:61 + def macro; end + + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:125 + def valid_dependent_options; end + + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:65 + def valid_options(options); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:69 + def validate_options(options); end + end +end + +# pkg:gem/activerecord#lib/active_record/associations/builder/association.rb:21 +ActiveRecord::Associations::Builder::Association::VALID_OPTIONS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/active_record/associations/builder/belongs_to.rb:4 +class ActiveRecord::Associations::Builder::BelongsTo < ::ActiveRecord::Associations::Builder::SingularAssociation + class << self + # pkg:gem/activerecord#lib/active_record/associations/builder/belongs_to.rb:43 + def touch_record(o, changes, foreign_key, name, touch); end + + private + + # pkg:gem/activerecord#lib/active_record/associations/builder/belongs_to.rb:27 + def add_counter_cache_callbacks(model, reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/belongs_to.rb:102 + def add_default_callbacks(model, reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/belongs_to.rb:108 + def add_destroy_callbacks(model, reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/belongs_to.rb:78 + def add_touch_callbacks(model, reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/belongs_to.rb:20 + def define_callbacks(model, reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/belongs_to.rb:143 + def define_change_tracking_methods(model, reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/belongs_to.rb:112 + def define_validations(model, reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/belongs_to.rb:5 + def macro; end + + # pkg:gem/activerecord#lib/active_record/associations/builder/belongs_to.rb:16 + def valid_dependent_options; end + + # pkg:gem/activerecord#lib/active_record/associations/builder/belongs_to.rb:9 + def valid_options(options); end + end +end + +# pkg:gem/activerecord#lib/active_record/associations/builder/collection_association.rb:6 +class ActiveRecord::Associations::Builder::CollectionAssociation < ::ActiveRecord::Associations::Builder::Association + class << self + # pkg:gem/activerecord#lib/active_record/associations/builder/collection_association.rb:13 + def define_callbacks(model, reflection); end + + private + + # pkg:gem/activerecord#lib/active_record/associations/builder/collection_association.rb:30 + def define_callback(model, callback_name, name, options); end + + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/associations/builder/collection_association.rb:58 + def define_readers(mixin, name); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/collection_association.rb:68 + def define_writers(mixin, name); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/collection_association.rb:9 + def valid_options(options); end + end +end + +# pkg:gem/activerecord#lib/active_record/associations/builder/collection_association.rb:7 +ActiveRecord::Associations::Builder::CollectionAssociation::CALLBACKS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/active_record/associations/builder/has_and_belongs_to_many.rb:4 +class ActiveRecord::Associations::Builder::HasAndBelongsToMany + # pkg:gem/activerecord#lib/active_record/associations/builder/has_and_belongs_to_many.rb:7 + def initialize(association_name, lhs_model, options); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/has_and_belongs_to_many.rb:5 + def association_name; end + + # pkg:gem/activerecord#lib/active_record/associations/builder/has_and_belongs_to_many.rb:5 + def lhs_model; end + + # pkg:gem/activerecord#lib/active_record/associations/builder/has_and_belongs_to_many.rb:59 + def middle_reflection(join_model); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/has_and_belongs_to_many.rb:5 + def options; end + + # pkg:gem/activerecord#lib/active_record/associations/builder/has_and_belongs_to_many.rb:13 + def through_model; end + + private + + # pkg:gem/activerecord#lib/active_record/associations/builder/has_and_belongs_to_many.rb:92 + def belongs_to_options(options); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/has_and_belongs_to_many.rb:71 + def middle_options(join_model); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/has_and_belongs_to_many.rb:80 + def table_name; end +end + +# pkg:gem/activerecord#lib/active_record/associations/builder/has_many.rb:4 +class ActiveRecord::Associations::Builder::HasMany < ::ActiveRecord::Associations::Builder::CollectionAssociation + class << self + private + + # pkg:gem/activerecord#lib/active_record/associations/builder/has_many.rb:5 + def macro; end + + # pkg:gem/activerecord#lib/active_record/associations/builder/has_many.rb:18 + def valid_dependent_options; end + + # pkg:gem/activerecord#lib/active_record/associations/builder/has_many.rb:9 + def valid_options(options); end + end +end + +# pkg:gem/activerecord#lib/active_record/associations/builder/has_one.rb:4 +class ActiveRecord::Associations::Builder::HasOne < ::ActiveRecord::Associations::Builder::SingularAssociation + class << self + # pkg:gem/activerecord#lib/active_record/associations/builder/has_one.rb:38 + def touch_record(record, name, touch); end + + private + + # pkg:gem/activerecord#lib/active_record/associations/builder/has_one.rb:27 + def add_destroy_callbacks(model, reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/has_one.rb:47 + def add_touch_callbacks(model, reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/has_one.rb:22 + def define_callbacks(model, reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/has_one.rb:31 + def define_validations(model, reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/builder/has_one.rb:5 + def macro; end + + # pkg:gem/activerecord#lib/active_record/associations/builder/has_one.rb:18 + def valid_dependent_options; end + + # pkg:gem/activerecord#lib/active_record/associations/builder/has_one.rb:9 + def valid_options(options); end + end +end + +# pkg:gem/activerecord#lib/active_record/associations/builder/singular_association.rb:6 +class ActiveRecord::Associations::Builder::SingularAssociation < ::ActiveRecord::Associations::Builder::Association + class << self + private + + # pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/associations/builder/singular_association.rb:30 + def define_constructors(mixin, name); end + + # pkg:gem/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(record) +# # ... +# end +# +# def log_after_remove(record) +# # ... +# end +# end +# +# It's possible to stack callbacks by passing them as an array. Example: +# +# class Firm < ActiveRecord::Base +# has_many :clients, +# dependent: :destroy, +# after_add: [:congratulate_client, -> (firm, record) { firm.log << "after_adding#{record.id}" }], +# 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). +# +# == 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. +# +# pkg:gem/activerecord#lib/active_record/associations.rb:1272 +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 also ActiveRecord::Associations::ClassMethods's overview + # 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. + # [+: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, see note below). 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.) + # Note: Specifying a counter cache will add it to that model's list of readonly attributes + # using +attr_readonly+. + # [+:polymorphic+] + # Specify this association is a polymorphic association by passing +true+. + # 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). + # [+: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 ActiveRecord::Associations::ClassMethods's overview on 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. + # + # 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 + # belong_to :note, query_constraints: [:organization_id, :note_id] + # + # pkg:gem/activerecord#lib/active_record/associations.rb:1886 + 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[7.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. + # + # 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 + # + # pkg:gem/activerecord#lib/active_record/associations.rb:2067 + 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. 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 the 'Association Join Models' + # and 'Setting Inverses' sections above.) + # [+: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 ActiveRecord::Associations::ClassMethods's overview on 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. + # + # 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] + # + # pkg:gem/activerecord#lib/active_record/associations.rb:1522 + 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 also ActiveRecord::Associations::ClassMethods's overview + # 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 a Join Model through which to perform the query. 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 the 'Association Join Models' + # and 'Setting Inverses' sections above.) + # [+: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 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 #belongs_to association on the associated object + # that is the inverse of this #has_one association. + # See ActiveRecord::Associations::ClassMethods's overview on 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. + # + # 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') }, 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] + # + # pkg:gem/activerecord#lib/active_record/associations.rb:1708 + 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. +# +# pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:31 +class ActiveRecord::Associations::CollectionAssociation < ::ActiveRecord::Associations::Association + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:277 + def add_to_target(record, skip_callbacks: T.unsafe(nil), replace: T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:115 + def build(attributes = T.unsafe(nil), &block); end + + # Add +records+ to this association. Since +<<+ flattens its argument list + # and inserts each record, +push+ and +concat+ behave identically. + # + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:125 + 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. + # + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:184 + 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. + # + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:148 + 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. + # + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:193 + def destroy(*records); end + + # Destroy all the records from this association. + # + # See destroy for more info. + # + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:170 + 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?. + # + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:230 + def empty?; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:92 + def find(*args); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:304 + def find_from_target?; end + + # Implements the ids reader method, e.g. foo.item_ids for Foo.has_many :items + # + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:49 + def ids_reader; end + + # Implements the ids writer method, e.g. foo.item_ids= for Foo.has_many :items + # + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:60 + def ids_writer(ids); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:256 + def include?(record); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:268 + def load_target; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:300 + def null_scope?; end + + # Implements the reader method, e.g. foo.items for Foo.has_many :items + # + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:32 + def reader; end + + # Replace this collection with +other_array+. This will perform a diff + # and delete/add only records that have changed. + # + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:240 + def replace(other_array); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:85 + def reset; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:294 + 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. + # + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:207 + def size; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:281 + def target=(record); end + + # Implements the writer method, e.g. foo.items= for Foo.has_many :items + # + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:44 + def writer(records); end + + private + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:346 + def _create_record(attributes, raise = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:484 + def callback(method, record); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:490 + def callbacks_for(callback_name); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:430 + def concat_records(records, raise = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:377 + 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). + # + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:406 + def delete_records(records, method); end + + # If the :inverse_of option has been + # specified, then #find scans the entire collection. + # + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:513 + def find_by_scan(*args); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:499 + def include_in_memory?(record); end + + # Do the relevant stuff to insert the given record into the association collection. + # + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:369 + 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 + # + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:327 + def merge_target_lists(persisted, memory); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:391 + def remove_records(existing_records, records, method); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:422 + def replace_common_records_in_memory(new_target, original_target); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:449 + def replace_on_target(record, skip_callbacks, replace:, inversing: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:410 + def replace_records(new_target, original_target); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_association.rb:313 + 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. +# +# pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:31 +class ActiveRecord::Associations::CollectionProxy < ::ActiveRecord::Relation + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:32 + def initialize(klass, 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 + # # => [ + # # #, + # # #, + # # # + # # ] + # + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1036 + 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 + # + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:967 + def ==(other); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def _select!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def and(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def and!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def annotate(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def annotate!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def annotate_values(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def annotate_values=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1040 + def append(*records); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def arel(*, **, &); 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 + # + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:318 + def build(attributes = T.unsafe(nil), &block); end + + # -- + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1053 + def clear; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1041 + def concat(*records); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def construct_join_dependency(*, **, &); 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) + # # => [ + # # #, + # # #, + # # # + # # ] + # + # pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:365 + def create!(attributes = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def create_with(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def create_with!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def create_with_value(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + 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) + # # => [ + # # #, + # # # + # # ] + # + # pkg:gem/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) + # + # pkg:gem/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) + # + # pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:501 + def destroy_all; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def distinct(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def distinct!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def distinct_value(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def distinct_value=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def eager_load(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def eager_load!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def eager_load_values(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + 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 + # + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:831 + def empty?; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def except(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def excluding(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def excluding!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def extending(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def extending!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def extending_values(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def extending_values=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def extensions(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def extract_associated(*, **, &); end + + # Finds an object in the collection responding to the +id+. Uses the same + # rules as ActiveRecord::FinderMethods.find. Returns 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) + # # => [ + # # #, + # # # + # # ] + # + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:138 + def find(*args); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def from(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def from!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def from_clause(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def from_clause=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def group(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def group!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def group_values(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def group_values=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def having(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def having!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def having_clause(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def having_clause=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def in_order_of(*, **, &); 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 + # + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:927 + def include?(record); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def includes(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def includes!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def includes_values(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def includes_values=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def insert(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def insert!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def insert_all(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def insert_all!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1105 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def invert_where(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def invert_where!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def joins(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def joins!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def joins_values(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + 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) # => [] + # + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:259 + def last(limit = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def left_joins(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def left_outer_joins(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def left_outer_joins!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def left_outer_joins_values(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def left_outer_joins_values=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def limit(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def limit!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def limit_value(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def limit_value=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def load_async(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:44 + def load_target; end + + # pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:53 + def loaded?; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def lock(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def lock!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def lock_value(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def lock_value=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def merge(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def merge!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:321 + def new(attributes = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def none(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def none!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def null_relation?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def offset(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def offset!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def offset_value(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def offset_value=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def only(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def optimizer_hints(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def optimizer_hints!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def optimizer_hints_values(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def optimizer_hints_values=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def or(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def or!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def order(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def order!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def order_values(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def order_values=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:728 + def pluck(*column_names); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def preload(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def preload!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def preload_values(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def preload_values=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1043 + def prepend(*args); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1110 + def pretty_print(pp); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:931 + def proxy_association; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1039 + def push(*records); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def readonly(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def readonly!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def readonly_value(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + 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 + # # => [ + # # #, + # # #, + # # # + # # ] + # + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1011 + def records; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def references(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def references!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def references_values(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def references_values=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def regroup(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def regroup!(*, **, &); 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 + # # => [#] + # + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1072 + def reload; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def reorder(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def reorder!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def reordering_value(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + 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 + # + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:391 + def replace(other_array); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def reselect(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def reselect!(*, **, &); 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 + # # => [#] + # + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1093 + def reset; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1099 + def reset_scope; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def reverse_order(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def reverse_order!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def reverse_order_value(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def reverse_order_value=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def rewhere(*, **, &); end + + # Returns a Relation object for the records in this association + # + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:936 + def scope; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def scoping(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def select_values(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + 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. + # + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:782 + def size; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def skip_preloading!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def skip_query_cache!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def skip_query_cache_value(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def skip_query_cache_value=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def spawn(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def strict_loading(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def strict_loading!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def strict_loading_value(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def strict_loading_value=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def structurally_compatible?(*, **, &); 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) # => [] + # + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:289 + def take(limit = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:40 + def target; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def uniq!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def unscope(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def unscope!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def unscope_values(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def unscope_values=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def upsert(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def upsert_all(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def values(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def where(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def where!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def where_clause(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def where_clause=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def with(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def with!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def with_values(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def with_values=(arg); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1124 + def without(*, **, &); end + + private + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1145 + def exec_queries; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1141 + def find_from_target?; end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1132 + def find_nth_from_last(index); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1127 + def find_nth_with_limit(index, limit); end + + # pkg:gem/activerecord#lib/active_record/associations/collection_proxy.rb:1137 + def null_scope?; end +end + +# pkg:gem/activerecord#lib/active_record/associations/disable_joins_association_scope.rb:5 +class ActiveRecord::Associations::DisableJoinsAssociationScope < ::ActiveRecord::Associations::AssociationScope + # pkg:gem/activerecord#lib/active_record/associations/disable_joins_association_scope.rb:6 + def scope(association); end + + private + + # pkg:gem/activerecord#lib/active_record/associations/disable_joins_association_scope.rb:33 + def add_constraints(reflection, key, join_ids, owner, ordered); end + + # pkg:gem/activerecord#lib/active_record/associations/disable_joins_association_scope.rb:18 + def last_scope_chain(reverse_chain, owner); end +end + +# pkg:gem/activerecord#lib/active_record/associations/foreign_association.rb:4 +module ActiveRecord::Associations::ForeignAssociation + # pkg:gem/activerecord#lib/active_record/associations/foreign_association.rb:5 + def foreign_key_present?; end + + # pkg:gem/activerecord#lib/active_record/associations/foreign_association.rb:13 + def nullified_owner_attributes; end + + private + + # Sets the owner attributes on the given record + # + # pkg:gem/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. +# +# pkg:gem/activerecord#lib/active_record/associations/has_many_association.rb:11 +class ActiveRecord::Associations::HasManyAssociation < ::ActiveRecord::Associations::CollectionAssociation + include ::ActiveRecord::Associations::ForeignAssociation + + # pkg:gem/activerecord#lib/active_record/associations/has_many_association.rb:14 + def handle_dependency; end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_association.rb:61 + def insert_record(record, validate = T.unsafe(nil), raise = T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/active_record/associations/has_many_association.rb:143 + def _create_record(attributes, *); end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_association.rb:139 + def concat_records(records, *); 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. + # + # pkg:gem/activerecord#lib/active_record/associations/has_many_association.rb:80 + def count_records; end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_association.rb:112 + def delete_count(method, scope); end + + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/associations/has_many_association.rb:127 + def delete_records(records, method); end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_association.rb:158 + def difference(a, b); end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_association.rb:162 + def intersection(a, b); end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_association.rb:98 + def update_counter(difference, reflection = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_association.rb:151 + def update_counter_if_success(saved_successfully, difference); end + + # pkg:gem/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 +# +# pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:6 +class ActiveRecord::Associations::HasManyThroughAssociation < ::ActiveRecord::Associations::HasManyAssociation + include ::ActiveRecord::Associations::ThroughAssociation + + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:9 + def initialize(owner, reflection); end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:14 + def concat(*records); end + + # pkg:gem/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 + + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:56 + def build_through_record(record); end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:37 + def concat_records(records); end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:130 + def delete_or_nullify_all_records(method); end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:134 + def delete_records(records, method); end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:203 + def delete_through_records(records); end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:171 + def difference(a, b); end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:187 + def distribution(array); end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:219 + def find_target; end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:177 + def intersection(a, b); end + + # NOTE - not sure that we can actually cope with inverses here + # + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:226 + def invertible_for?(record); end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:183 + def mark_occurrence(distribution, record); end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:110 + def remove_records(existing_records, records, method); end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:81 + def save_through_record(record); end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:115 + def target_reflection_has_associated_record?; end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:193 + def through_records_for(record); end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:69 + def through_scope; end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:71 + def through_scope_attributes; end + + # pkg:gem/activerecord#lib/active_record/associations/has_many_through_association.rb:119 + def update_through_counter?(method); end +end + +# = Active Record Has One Association +# +# pkg:gem/activerecord#lib/active_record/associations/has_one_association.rb:6 +class ActiveRecord::Associations::HasOneAssociation < ::ActiveRecord::Associations::SingularAssociation + include ::ActiveRecord::Associations::ForeignAssociation + + # pkg:gem/activerecord#lib/active_record/associations/has_one_association.rb:26 + def delete(method = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/associations/has_one_association.rb:9 + def handle_dependency; end + + private + + # pkg:gem/activerecord#lib/active_record/associations/has_one_association.rb:133 + def _create_record(attributes, raise_error = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/associations/has_one_association.rb:119 + def nullify_owner_attributes(record); end + + # pkg:gem/activerecord#lib/active_record/associations/has_one_association.rb:95 + def remove_target!(method); end + + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/associations/has_one_association.rb:91 + def set_new_record(record); end + + # pkg:gem/activerecord#lib/active_record/associations/has_one_association.rb:125 + def transaction_if(value, &block); end +end + +# = Active Record Has One Through Association +# +# pkg:gem/activerecord#lib/active_record/associations/has_one_through_association.rb:6 +class ActiveRecord::Associations::HasOneThroughAssociation < ::ActiveRecord::Associations::HasOneAssociation + include ::ActiveRecord::Associations::ThroughAssociation + + private + + # pkg:gem/activerecord#lib/active_record/associations/has_one_through_association.rb:15 + def create_through_record(record, save); end + + # pkg:gem/activerecord#lib/active_record/associations/has_one_through_association.rb:10 + def replace(record, save = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:5 +class ActiveRecord::Associations::JoinDependency + extend ::ActiveSupport::Autoload + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:71 + def initialize(base, table, associations, join_type); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:153 + def apply_column_aliases(relation); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:77 + def base_klass; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:158 + def each(&block); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:105 + def instantiate(result_set, strict_loading_value, &block); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:85 + def join_constraints(joins_to_add, alias_tracker, references); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:81 + def reflections; end + + protected + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:163 + def join_root; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:163 + def join_type; end + + private + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:166 + def alias_tracker; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:168 + def aliases; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:228 + def build(associations, base_klass); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:242 + def construct(ar_parent, parent, row, seen, model_cache, strict_loading_value); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:280 + def construct_model(record, node, row, model_cache, id, strict_loading_value); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:223 + def find_reflection(klass, name); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:166 + def join_root_alias; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:190 + def make_constraints(parent, child, join_type); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:184 + def make_join_constraints(join_root, join_type); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:214 + def walk(left, right, join_type); end + + class << self + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:47 + def make_tree(associations); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:53 + def walk_tree(associations, hash); end + end +end + +# pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:13 +class ActiveRecord::Associations::JoinDependency::Aliases + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:14 + def initialize(tables); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:34 + def column_alias(node, column); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:30 + def column_aliases(node); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:26 + def columns; end +end + +# pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:44 +class ActiveRecord::Associations::JoinDependency::Aliases::Column < ::Struct + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:44 + def alias; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:44 + def alias=(_); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:44 + def name; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:44 + def name=(_); end + + class << self + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:44 + def [](*_arg0); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:44 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:44 + def keyword_init?; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:44 + def members; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:44 + def new(*_arg0); end + end +end + +# pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:38 +class ActiveRecord::Associations::JoinDependency::Aliases::Table < ::Struct + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:39 + def column_aliases; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:38 + def columns; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:38 + def columns=(_); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:38 + def node; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:38 + def node=(_); end + + class << self + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:38 + def [](*_arg0); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:38 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:38 + def keyword_init?; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:38 + def members; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency.rb:38 + def new(*_arg0); end + end +end + +# pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_association.rb:9 +class ActiveRecord::Associations::JoinDependency::JoinAssociation < ::ActiveRecord::Associations::JoinDependency::JoinPart + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_association.rb:13 + def initialize(reflection, children); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_association.rb:24 + def join_constraints(foreign_table, foreign_klass, join_type, alias_tracker); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_association.rb:19 + def match?(other); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_association.rb:78 + def readonly?; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_association.rb:10 + def reflection; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_association.rb:84 + def strict_loading?; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_association.rb:11 + def table; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_association.rb:11 + def table=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_association.rb:10 + def tables; end + + private + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_association.rb:91 + def append_constraints(join, constraints); end +end + +# pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_base.rb:8 +class ActiveRecord::Associations::JoinDependency::JoinBase < ::ActiveRecord::Associations::JoinDependency::JoinPart + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_base.rb:11 + def initialize(base_klass, table, children); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_base.rb:16 + def match?(other); end + + # pkg:gem/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). +# +# pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_part.rb:12 +class ActiveRecord::Associations::JoinDependency::JoinPart + include ::Enumerable + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_part.rb:22 + def initialize(base_klass, children); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_part.rb:20 + def attribute_types(*, **, &); 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. + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_part.rb:18 + def children; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_part.rb:20 + def column_names(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_part.rb:31 + def each(&block); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_part.rb:36 + def each_children(&block); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_part.rb:48 + def extract_record(row, column_names_with_alias); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_part.rb:65 + def instantiate(row, aliases, column_types = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_part.rb:27 + def match?(other); end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_part.rb:20 + def primary_key(*, **, &); end + + # An Arel::Table for the active_record + # + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_part.rb:44 + def table; end + + # pkg:gem/activerecord#lib/active_record/associations/join_dependency/join_part.rb:20 + def table_name(*, **, &); 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. +# +# pkg:gem/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. + # + # pkg:gem/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 + + # pkg:gem/activerecord#lib/active_record/associations/preloader.rb:56 + def associate_by_default; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader.rb:56 + def associations; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader.rb:126 + def branches; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader.rb:120 + def call; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader.rb:116 + def empty?; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader.rb:130 + def loaders; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader.rb:56 + def records; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader.rb:56 + def scope; end +end + +# pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:8 +class ActiveRecord::Associations::Preloader::Association + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:104 + def initialize(klass, owners, reflection, preload_scope, reflection_scope, associate_by_default); end + + # pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:161 + def association_key_name; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:119 + def future_classes; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:102 + def klass; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:197 + def load_records(raw_records = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:176 + def loaded?(owner); end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:165 + def loader_query; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:169 + def owners_by_key; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:154 + def preloaded_records; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:148 + def records_by_owner; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:135 + def run; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:131 + def run?; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:127 + def runnable_loaders; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:184 + def scope; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:188 + def set_inverse(record); end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:115 + def table_name; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:180 + def target_for(owner); end + + private + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:245 + def associate_records_to_owner(owner, records); end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:281 + def association_key_type; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:293 + def build_scope; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:309 + def cascade_strict_loading(scope); end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:273 + def convert_key(key); end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:265 + def derive_key(owner, key); end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:257 + def key_conversion_required?; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:238 + def model; end + + # The name of the key on the model which declares the association + # + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:241 + def owner_key_name; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:285 + def owner_key_type; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:238 + def owners; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:238 + def preload_scope; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:238 + def reflection; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:289 + def reflection_scope; end +end + +# pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:9 +class ActiveRecord::Associations::Preloader::Association::LoaderQuery + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:12 + def initialize(scope, association_key_name); end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:10 + def association_key_name; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:17 + def eql?(other); end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:24 + def hash; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:41 + def load_records_for_keys(keys, &block); end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:32 + def load_records_in_batch(loaders); end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:28 + def records_for(loaders); end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:10 + def scope; end +end + +# pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:60 +class ActiveRecord::Associations::Preloader::Association::LoaderRecords + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:61 + def initialize(loaders, loader_query); end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:70 + def records; end + + private + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:97 + def already_loaded_records; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:75 + def already_loaded_records_by_key; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:75 + def keys_to_load; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:91 + def load_records; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:75 + def loader_query; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:75 + def loaders; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/association.rb:77 + def populate_keys_to_load_and_already_loaded_records; end +end + +# pkg:gem/activerecord#lib/active_record/associations/preloader/batch.rb:6 +class ActiveRecord::Associations::Preloader::Batch + # pkg:gem/activerecord#lib/active_record/associations/preloader/batch.rb:7 + def initialize(preloaders, available_records:); end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/batch.rb:12 + def call; end + + private + + # pkg:gem/activerecord#lib/active_record/associations/preloader/batch.rb:40 + def group_and_load_similar(loaders); end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/batch.rb:38 + def loaders; end +end + +# pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:6 +class ActiveRecord::Associations::Preloader::Branch + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:11 + def initialize(association:, children:, parent:, associate_by_default:, scope:); end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:8 + def associate_by_default; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:7 + def association; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:7 + def children; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:66 + def done?; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:21 + def future_classes; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:74 + def grouped_records; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:25 + def immediate_future_classes; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:47 + def likely_reflections; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:112 + def loaders; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:7 + def parent; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:102 + def polymorphic?; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:62 + def preloaded_records; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:9 + def preloaded_records=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:85 + def preloaders_for_reflection(reflection, reflection_records); end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:54 + def root?; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:70 + def runnable_loaders; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:8 + def scope; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:58 + def source_records; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:37 + def target_classes; end + + private + + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:120 + 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. + # + # pkg:gem/activerecord#lib/active_record/associations/preloader/branch.rb:137 + def preloader_for(reflection); end +end + +# pkg:gem/activerecord#lib/active_record/associations/preloader/through_association.rb:6 +class ActiveRecord::Associations::Preloader::ThroughAssociation < ::ActiveRecord::Associations::Preloader::Association + # pkg:gem/activerecord#lib/active_record/associations/preloader/through_association.rb:51 + def future_classes; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/through_association.rb:7 + def preloaded_records; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/through_association.rb:11 + def records_by_owner; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/through_association.rb:41 + def runnable_loaders; end + + private + + # pkg:gem/activerecord#lib/active_record/associations/preloader/through_association.rb:67 + def data_available?; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/through_association.rb:76 + def middle_records; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/through_association.rb:100 + def preload_index; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/through_association.rb:72 + def source_preloaders; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/through_association.rb:92 + def source_records_by_owner; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/through_association.rb:88 + def source_reflection; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/through_association.rb:80 + def through_preloaders; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/through_association.rb:96 + def through_records_by_owner; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/through_association.rb:84 + def through_reflection; end + + # pkg:gem/activerecord#lib/active_record/associations/preloader/through_association.rb:106 + def through_scope; end +end + +# pkg:gem/activerecord#lib/active_record/associations/singular_association.rb:6 +class ActiveRecord::Associations::SingularAssociation < ::ActiveRecord::Associations::Association + # pkg:gem/activerecord#lib/active_record/associations/singular_association.rb:22 + def build(attributes = T.unsafe(nil), &block); end + + # Implements the reload reader method, e.g. foo.reload_bar for + # Foo.has_one :bar + # + # pkg:gem/activerecord#lib/active_record/associations/singular_association.rb:30 + def force_reload_reader; end + + # Implements the reader method, e.g. foo.bar for Foo.has_one :bar + # + # pkg:gem/activerecord#lib/active_record/associations/singular_association.rb:7 + def reader; end + + # Implements the writer method, e.g. foo.bar= for Foo.belongs_to :bar + # + # pkg:gem/activerecord#lib/active_record/associations/singular_association.rb:18 + def writer(record); end + + private + + # pkg:gem/activerecord#lib/active_record/associations/singular_association.rb:56 + def _create_record(attributes, raise_error = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/associations/singular_association.rb:40 + def find_target; end + + # pkg:gem/activerecord#lib/active_record/associations/singular_association.rb:48 + def replace(record); end + + # pkg:gem/activerecord#lib/active_record/associations/singular_association.rb:36 + def scope_for_create; end + + # pkg:gem/activerecord#lib/active_record/associations/singular_association.rb:52 + def set_new_record(record); end +end + +# = Active Record Through Association +# +# pkg:gem/activerecord#lib/active_record/associations/through_association.rb:6 +module ActiveRecord::Associations::ThroughAssociation + # pkg:gem/activerecord#lib/active_record/associations/through_association.rb:7 + def source_reflection(*, **, &); end + + private + + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/associations/through_association.rb:57 + def construct_join_attributes(*records); end + + # pkg:gem/activerecord#lib/active_record/associations/through_association.rb:96 + def ensure_mutable; end + + # pkg:gem/activerecord#lib/active_record/associations/through_association.rb:106 + def ensure_not_nested; end + + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/associations/through_association.rb:34 + def target_scope; end + + # pkg:gem/activerecord#lib/active_record/associations/through_association.rb:26 + def through_association; end + + # pkg:gem/activerecord#lib/active_record/associations/through_association.rb:14 + def through_reflection; end + + # pkg:gem/activerecord#lib/active_record/associations/through_association.rb:10 + def transaction(&block); end +end + +# pkg:gem/activerecord#lib/active_record/asynchronous_queries_tracker.rb:4 +class ActiveRecord::AsynchronousQueriesTracker + # pkg:gem/activerecord#lib/active_record/asynchronous_queries_tracker.rb:46 + def initialize; end + + # pkg:gem/activerecord#lib/active_record/asynchronous_queries_tracker.rb:44 + def current_session; end + + # pkg:gem/activerecord#lib/active_record/asynchronous_queries_tracker.rb:55 + def finalize_session; end + + # pkg:gem/activerecord#lib/active_record/asynchronous_queries_tracker.rb:50 + def start_session; end + + class << self + # pkg:gem/activerecord#lib/active_record/asynchronous_queries_tracker.rb:39 + def complete(asynchronous_queries_tracker); end + + # pkg:gem/activerecord#lib/active_record/asynchronous_queries_tracker.rb:31 + def install_executor_hooks(executor = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/asynchronous_queries_tracker.rb:35 + def run; end + end +end + +# pkg:gem/activerecord#lib/active_record/asynchronous_queries_tracker.rb:5 +module ActiveRecord::AsynchronousQueriesTracker::NullSession + class << self + # pkg:gem/activerecord#lib/active_record/asynchronous_queries_tracker.rb:7 + def active?; end + + # pkg:gem/activerecord#lib/active_record/asynchronous_queries_tracker.rb:11 + def finalize; end + end +end + +# pkg:gem/activerecord#lib/active_record/asynchronous_queries_tracker.rb:16 +class ActiveRecord::AsynchronousQueriesTracker::Session + # pkg:gem/activerecord#lib/active_record/asynchronous_queries_tracker.rb:17 + def initialize; end + + # pkg:gem/activerecord#lib/active_record/asynchronous_queries_tracker.rb:21 + def active?; end + + # pkg:gem/activerecord#lib/active_record/asynchronous_queries_tracker.rb:25 + def finalize; end +end + +# AsynchronousQueryInsideTransactionError will be raised when attempting +# to perform an asynchronous query from inside a transaction +# +# pkg:gem/activerecord#lib/active_record/errors.rb:509 +class ActiveRecord::AsynchronousQueryInsideTransactionError < ::ActiveRecord::ActiveRecordError; end + +# pkg:gem/activerecord#lib/active_record/attribute_assignment.rb:4 +module ActiveRecord::AttributeAssignment + include ::ActiveModel::ForbiddenAttributesProtection + include ::ActiveModel::AttributeAssignment + + private + + # pkg:gem/activerecord#lib/active_record/attribute_assignment.rb:8 + 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+. + # + # pkg:gem/activerecord#lib/active_record/attribute_assignment.rb:38 + def assign_multiparameter_attributes(pairs); end + + # Assign any deferred nested attributes after the base attributes have been set. + # + # pkg:gem/activerecord#lib/active_record/attribute_assignment.rb:28 + def assign_nested_parameter_attributes(pairs); end + + # pkg:gem/activerecord#lib/active_record/attribute_assignment.rb:44 + def execute_callstack_for_multiparameter_attributes(callstack); end + + # pkg:gem/activerecord#lib/active_record/attribute_assignment.rb:62 + def extract_callstack_for_multiparameter_attributes(pairs); end + + # pkg:gem/activerecord#lib/active_record/attribute_assignment.rb:80 + def find_parameter_position(multiparameter_name); end + + # pkg:gem/activerecord#lib/active_record/attribute_assignment.rb:76 + 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:AttributeAssignment#attributes=] method. +# The exception has an +attribute+ property that is the name of the offending attribute. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:422 +class ActiveRecord::AttributeAssignmentError < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/errors.rb:425 + def initialize(message = T.unsafe(nil), exception = T.unsafe(nil), attribute = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/errors.rb:423 + def attribute; end + + # pkg:gem/activerecord#lib/active_record/errors.rb:423 + def exception; end +end + +# = Active Record Attribute Methods +# +# pkg:gem/activerecord#lib/active_record/attribute_methods.rb:8 +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 + # + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:412 + 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) + # + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:425 + def []=(attr_name, value); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:319 + 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 + # + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:457 + 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]" + # + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:362 + 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"] + # + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:331 + 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 + # + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:384 + 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} + # + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:343 + 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 + # + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:313 + 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 + # + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:286 + def respond_to?(name, include_private = T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:462 + 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). + # + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:483 + def attributes_for_create(attribute_names); end + + # Filters the primary keys, readonly attributes and virtual columns from the attribute names. + # + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:472 + def attributes_for_update(attribute_names); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:467 + def attributes_with_values(attribute_names); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:491 + def format_for_inspect(name, value); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:507 + def pk_attribute?(name); end + + class << self + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:31 + 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" +# +# pkg:gem/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} + # + # pkg:gem/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. + # + # pkg:gem/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" + # + # pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/before_type_cast.rb:93 + def attribute_before_type_cast(attr_name); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/before_type_cast.rb:101 + def attribute_came_from_user?(attr_name); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/before_type_cast.rb:97 + def attribute_for_database(attr_name); end +end + +# pkg:gem/activerecord#lib/active_record/attribute_methods.rb:42 +module ActiveRecord::AttributeMethods::ClassMethods + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:255 + def _has_attribute?(attr_name); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:53 + def alias_attribute(new_name, old_name); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:85 + 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 + # + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:219 + def attribute_method?(attribute); 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"] + # + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:231 + 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.) + # + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:178 + 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.) + # + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:196 + def dangerous_class_method?(method_name); end + + # Generates all the attribute related methods for columns in the database + # accessors, mutators and query methods. + # + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:126 + def define_attribute_methods; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:63 + def eagerly_generate_alias_attribute_methods(_new_name, _old_name); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:67 + 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 + # + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:249 + def has_attribute?(attr_name); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:43 + 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 + # + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:160 + def instance_method_already_implemented?(method_name); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:182 + def method_defined_within?(name, klass, superklass = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:138 + def undefine_attribute_methods; end + + private + + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:260 + def inherited(child_class); 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_change # => "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"). +# +# pkg:gem/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"). + # + # pkg:gem/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. + # + # pkg:gem/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"). + # + # pkg:gem/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). + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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? + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/dirty.rb:169 + def has_changes_to_save?; end + + # reload the record and clears changed attributes. + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/dirty.rb:63 + def reload(*); 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"). + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/dirty.rb:118 + def saved_changes; end + + # Did the last call to +save+ have any changes to change? + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/dirty.rb:138 + def will_save_change_to_attribute?(attr_name, **options); end + + private + + # pkg:gem/activerecord#lib/active_record/attribute_methods/dirty.rb:239 + def _create_record(attribute_names = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/dirty.rb:204 + def _touch_row(attribute_names, time); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/dirty.rb:233 + def _update_record(attribute_names = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/dirty.rb:249 + def attribute_names_for_partial_inserts; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/dirty.rb:245 + def attribute_names_for_partial_updates; end + + # pkg:gem/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 + +# pkg:gem/activerecord#lib/active_record/attribute_methods.rb:26 +class ActiveRecord::AttributeMethods::GeneratedAttributeMethods < ::Module + include ::Mutex_m + + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:27 + def lock; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:27 + def locked?; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:27 + def synchronize(&block); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:27 + def try_lock; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods.rb:27 + def unlock; end +end + +# = Active Record Attribute Methods Primary Key +# +# pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:8 +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. + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:20 + def id; end + + # Sets the primary key column's value. If the primary key is composite, + # raises TypeError when the set value not enumerable. + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:34 + 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. + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:45 + 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. + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:55 + def id_before_type_cast; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:83 + 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. + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:75 + 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. + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:65 + def id_was; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:26 + def primary_key_values_present?; end + + # Returns this record's primary key value wrapped in an array if one is + # available. + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:13 + def to_key; end + + private + + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:92 + def attribute_method?(attr_name); end +end + +# pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:96 +module ActiveRecord::AttributeMethods::PrimaryKey::ClassMethods + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:118 + def composite_primary_key?; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:104 + def dangerous_attribute_method?(method_name); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:136 + def get_primary_key(base_name); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:100 + 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. + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:111 + 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" + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:165 + def primary_key=(value); end + + # Returns a quoted version of the primary key name, used to construct + # SQL statements. + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:124 + def quoted_primary_key; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:128 + def reset_primary_key; end + + private + + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:172 + def derive_primary_key(value); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:180 + def inherited(base); end +end + +# pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:97 +ActiveRecord::AttributeMethods::PrimaryKey::ClassMethods::ID_ATTRIBUTE_METHODS = T.let(T.unsafe(nil), Set) + +# pkg:gem/activerecord#lib/active_record/attribute_methods/primary_key.rb:98 +ActiveRecord::AttributeMethods::PrimaryKey::ClassMethods::PRIMARY_KEY_NOT_SET = T.let(T.unsafe(nil), BasicObject) + +# = Active Record Attribute Methods \Query +# +# pkg:gem/activerecord#lib/active_record/attribute_methods/query.rb:6 +module ActiveRecord::AttributeMethods::Query + extend ::ActiveSupport::Concern + + # pkg:gem/activerecord#lib/active_record/attribute_methods/query.rb:19 + def _query_attribute(attr_name); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/query.rb:13 + def query_attribute(attr_name); end + + private + + # pkg:gem/activerecord#lib/active_record/attribute_methods/query.rb:25 + def attribute?(attr_name); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/query.rb:29 + def query_cast_attribute(attr_name, value); end +end + +# pkg:gem/activerecord#lib/active_record/attribute_methods.rb:24 +ActiveRecord::AttributeMethods::RESTRICTED_CLASS_METHODS = T.let(T.unsafe(nil), Array) + +# = Active Record Attribute Methods \Read +# +# pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/read.rb:50 + 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.) + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/read.rb:29 + def read_attribute(attr_name, &block); end + + private + + # pkg:gem/activerecord#lib/active_record/attribute_methods/read.rb:54 + def attribute(attr_name, &block); end +end + +# pkg:gem/activerecord#lib/active_record/attribute_methods/read.rb:9 +module ActiveRecord::AttributeMethods::Read::ClassMethods + private + + # pkg:gem/activerecord#lib/active_record/attribute_methods/read.rb:11 + def define_method_attribute(name, owner:); end +end + +# = Active Record Attribute Methods \Serialization +# +# pkg:gem/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 + +# pkg:gem/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+ + # * +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 + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/serialization.rb:183 + def serialize(attr_name, class_name_or_coder = T.unsafe(nil), coder: T.unsafe(nil), type: T.unsafe(nil), yaml: T.unsafe(nil), **options); end + + private + + # pkg:gem/activerecord#lib/active_record/attribute_methods/serialization.rb:228 + def build_column_serializer(attr_name, coder, type, yaml = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/serialization.rb:245 + def type_incompatible_with_serialize?(cast_type, coder, type); end +end + +# pkg:gem/activerecord#lib/active_record/attribute_methods/serialization.rb:9 +class ActiveRecord::AttributeMethods::Serialization::ColumnNotSerializableError < ::StandardError + # pkg:gem/activerecord#lib/active_record/attribute_methods/serialization.rb:10 + def initialize(name, type); end +end + +# pkg:gem/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 + +# pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:71 +module ActiveRecord::AttributeMethods::TimeZoneConversion::ClassMethods + # pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:72 + def define_attribute(name, cast_type, **); end + + private + + # pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:80 + def create_time_zone_conversion_attribute?(name, cast_type); end +end + +# pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:8 +class ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter + # pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:17 + def cast(value); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:13 + def deserialize(value); end + + private + + # pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:36 + def convert_time_to_time_zone(value); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:52 + def map_avoiding_infinite_recursion(value); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:48 + def set_time_zone_without_conversion(value); end + + class << self + # pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:9 + def new(subtype); end + end +end + +# = Active Record Attribute Methods \Write +# +# pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/attribute_methods/write.rb:31 + def write_attribute(attr_name, value); end + + private + + # pkg:gem/activerecord#lib/active_record/attribute_methods/write.rb:45 + def attribute=(attr_name, value); end +end + +# pkg:gem/activerecord#lib/active_record/attribute_methods/write.rb:13 +module ActiveRecord::AttributeMethods::Write::ClassMethods + private + + # pkg:gem/activerecord#lib/active_record/attribute_methods/write.rb:15 + def define_method_attribute=(name, owner:); end +end + +# See ActiveRecord::Attributes::ClassMethods for documentation +# +# pkg:gem/activerecord#lib/active_record/attributes.rb:7 +module ActiveRecord::Attributes + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::Attributes::ClassMethods + + module GeneratedClassMethods + def attributes_to_define_after_schema_loads; end + def attributes_to_define_after_schema_loads=(value); end + def attributes_to_define_after_schema_loads?; end + end + + module GeneratedInstanceMethods; end +end + +# = Active Record \Attributes +# +# pkg:gem/activerecord#lib/active_record/attributes.rb:14 +module ActiveRecord::Attributes::ClassMethods + # Defines an attribute with a type on this model. It will override the + # type of existing attributes if needed. This allows control over how + # values are converted to and from SQL when assigned to a model. It also + # changes the behavior of values passed to + # {ActiveRecord::Base.where}[rdoc-ref:QueryMethods#where]. This will let you use + # your domain objects across much of Active Record, without having to + # rely on implementation details or monkey patching. + # + # +name+ The name of the methods to define attribute methods for, and the + # column which this will persist to. + # + # +cast_type+ A symbol such as +:string+ or +:integer+, or a type object + # to be used for this attribute. See the examples below for more + # information about providing custom type objects. + # + # ==== Options + # + # The following options are accepted: + # + # +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+. + # + # +array+ (PostgreSQL only) specifies that the type should be an array (see the + # examples below). + # + # +range+ (PostgreSQL only) specifies that the type should be a range (see the + # examples below). + # + # When using a symbol for +cast_type+, extra options are forwarded to the + # constructor of the type object. + # + # ==== Examples + # + # The type detected by Active Record can be overridden. + # + # # db/schema.rb + # create_table :store_listings, force: true do |t| + # t.decimal :price_in_cents + # end + # + # # app/models/store_listing.rb + # class StoreListing < ActiveRecord::Base + # end + # + # store_listing = StoreListing.new(price_in_cents: '10.1') + # + # # before + # store_listing.price_in_cents # => BigDecimal(10.1) + # + # class StoreListing < ActiveRecord::Base + # attribute :price_in_cents, :integer + # end + # + # # after + # store_listing.price_in_cents # => 10 + # + # A default can also be provided. + # + # # db/schema.rb + # create_table :store_listings, force: true do |t| + # t.string :my_string, default: "original default" + # end + # + # StoreListing.new.my_string # => "original default" + # + # # app/models/store_listing.rb + # class StoreListing < ActiveRecord::Base + # attribute :my_string, :string, default: "new default" + # end + # + # StoreListing.new.my_string # => "new default" + # + # class Product < ActiveRecord::Base + # attribute :my_default_proc, :datetime, default: -> { Time.now } + # end + # + # Product.new.my_default_proc # => 2015-05-30 11:04:48 -0600 + # sleep 1 + # Product.new.my_default_proc # => 2015-05-30 11:04:49 -0600 + # + # \Attributes do not need to be backed by a database column. + # + # # app/models/my_model.rb + # class MyModel < ActiveRecord::Base + # attribute :my_string, :string + # attribute :my_int_array, :integer, array: true + # attribute :my_float_range, :float, range: true + # end + # + # model = MyModel.new( + # my_string: "string", + # my_int_array: ["1", "2", "3"], + # my_float_range: "[1,3.5]", + # ) + # model.attributes + # # => + # { + # my_string: "string", + # my_int_array: [1, 2, 3], + # my_float_range: 1.0..3.5 + # } + # + # Passing options to the type constructor + # + # # app/models/my_model.rb + # class MyModel < ActiveRecord::Base + # attribute :small_int, :integer, limit: 2 + # end + # + # MyModel.create(small_int: 65537) + # # => Error: 65537 is out of range for the limit of two bytes + # + # ==== Creating Custom Types + # + # Users may also define their own custom types, as long as they respond + # to the methods defined on the value type. The method +deserialize+ or + # +cast+ will be called on your type object, with raw input from the + # database or from your controllers. See ActiveModel::Type::Value for the + # expected API. It is recommended that your type objects inherit from an + # existing type, or from ActiveRecord::Type::Value + # + # class MoneyType < ActiveRecord::Type::Integer + # def cast(value) + # if !value.kind_of?(Numeric) && value.include?('$') + # price_in_dollars = value.gsub(/\$/, '').to_f + # super(price_in_dollars * 100) + # else + # super + # end + # end + # end + # + # # config/initializers/types.rb + # ActiveRecord::Type.register(:money, MoneyType) + # + # # app/models/store_listing.rb + # class StoreListing < ActiveRecord::Base + # attribute :price_in_cents, :money + # end + # + # store_listing = StoreListing.new(price_in_cents: '$10.00') + # store_listing.price_in_cents # => 1000 + # + # For more details on creating custom types, see the documentation for + # ActiveModel::Type::Value. For more details on registering your types + # to be referenced by a symbol, see ActiveRecord::Type.register. You can + # also pass a type object directly, in place of a symbol. + # + # ==== \Querying + # + # When {ActiveRecord::Base.where}[rdoc-ref:QueryMethods#where] is called, it will + # use the type defined by the model class to convert the value to SQL, + # calling +serialize+ on your type object. For example: + # + # class Money < Struct.new(:amount, :currency) + # end + # + # class MoneyType < ActiveRecord::Type::Value + # def initialize(currency_converter:) + # @currency_converter = currency_converter + # end + # + # # value will be the result of +deserialize+ or + # # +cast+. Assumed to be an instance of +Money+ in + # # this case. + # def serialize(value) + # value_in_bitcoins = @currency_converter.convert_to_bitcoins(value) + # value_in_bitcoins.amount + # end + # end + # + # # config/initializers/types.rb + # ActiveRecord::Type.register(:money, MoneyType) + # + # # app/models/product.rb + # class Product < ActiveRecord::Base + # currency_converter = ConversionRatesFromTheInternet.new + # attribute :price_in_bitcoins, :money, currency_converter: currency_converter + # end + # + # Product.where(price_in_bitcoins: Money.new(5, "USD")) + # # SELECT * FROM products WHERE price_in_bitcoins = 0.02230 + # + # Product.where(price_in_bitcoins: Money.new(5, "GBP")) + # # SELECT * FROM products WHERE price_in_bitcoins = 0.03412 + # + # ==== Dirty Tracking + # + # The type of an attribute is given the opportunity to change how dirty + # tracking is performed. The methods +changed?+ and +changed_in_place?+ + # will be called from ActiveModel::Dirty. See the documentation for those + # methods in ActiveModel::Type::Value for more details. + # + # pkg:gem/activerecord#lib/active_record/attributes.rb:208 + def attribute(name, cast_type = T.unsafe(nil), default: T.unsafe(nil), **options); end + + # This is the low level API which sits beneath +attribute+. It only + # accepts type objects, and will do its work immediately instead of + # waiting for the schema to load. Automatic schema detection and + # ClassMethods#attribute both call this under the hood. While this method + # is provided so it can be used by plugin authors, application code + # should probably use ClassMethods#attribute. + # + # +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+. + # + # pkg:gem/activerecord#lib/active_record/attributes.rb:253 + def define_attribute(name, cast_type, default: T.unsafe(nil), user_provided_default: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/attributes.rb:263 + def load_schema!; end + + private + + # pkg:gem/activerecord#lib/active_record/attributes.rb:275 + def define_default_attribute(name, value, type, from_user:); end +end + +# pkg:gem/activerecord#lib/active_record/attributes.rb:272 +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. +# +# pkg:gem/activerecord#lib/active_record/autosave_association.rb:138 +module ActiveRecord::AutosaveAssociation + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::AutosaveAssociation::ClassMethods + + # Returns whether or not this record has been changed in any way (including whether + # any of its nested autosave associations are likewise changed) + # + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:271 + def changed_for_autosave?; end + + # Returns the association for the parent being destroyed. + # + # Used to avoid updating the counter cache unnecessarily. + # + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:265 + def destroyed_by_association; end + + # Records the association that is being destroyed and destroying this + # record in the process. + # + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:258 + 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. + # + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:245 + 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. + # + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:252 + def marked_for_destruction?; end + + # Reloads the attributes of the object as usual and clears marked_for_destruction flag. + # + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:234 + def reload(options = T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:554 + def _ensure_no_duplicate_errors; end + + # If the record is new or it has changed, returns true. + # + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:475 + 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. + # + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:371 + 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. + # + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:284 + def associated_records_to_validate_or_save(association, new_record, autosave); end + + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:482 + 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. + # + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:335 + def association_valid?(reflection, record, index = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:534 + def compute_primary_key(reflection, record); end + + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:550 + def custom_validation_context?; end + + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:276 + def init_internals; end + + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:491 + 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. + # + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:297 + def nested_records_changed_for_autosave?; end + + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:361 + def normalize_reflection_attribute(indexed_attribute, reflection, index, attribute); 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. + # + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:502 + 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. + # + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:388 + 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. + # + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:442 + def save_has_one_association(reflection); end + + # Validate the associated records if :validate or + # :autosave is turned on for the association specified by + # +reflection+. + # + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:324 + def validate_collection_association(reflection); end + + # Validate the association if :validate or :autosave is + # turned on for the association. + # + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:315 + def validate_single_association(reflection); end +end + +# pkg:gem/activerecord#lib/active_record/autosave_association.rb:141 +module ActiveRecord::AutosaveAssociation::AssociationBuilderExtension + class << self + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:142 + def build(model, reflection); end + + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:146 + def valid_options; end + end +end + +# pkg:gem/activerecord#lib/active_record/autosave_association.rb:155 +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. + # + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:187 + def add_autosave_association_callbacks(reflection); end + + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:217 + def define_autosave_validation_callbacks(reflection); end + + # pkg:gem/activerecord#lib/active_record/autosave_association.rb:157 + 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.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: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: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. +# +# pkg:gem/activerecord#lib/active_record/base.rb:282 +class ActiveRecord::Base + include ::ActionText::Encryption + 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 ::ActiveModel::ForbiddenAttributesProtection + include ::ActiveModel::AttributeAssignment + include ::ActiveRecord::AttributeAssignment + include ::ActiveModel::Conversion + include ::ActiveRecord::Integration + include ::ActiveModel::Validations + include ::ActiveSupport::Callbacks + include ::ActiveModel::Validations::HelperMethods + include ::ActiveRecord::Validations + include ::ActiveRecord::CounterCache + include ::ActiveRecord::Attributes + include ::ActiveRecord::Locking::Optimistic + include ::ActiveRecord::Locking::Pessimistic + include ::ActiveRecord::Encryption::EncryptableRecord + include ::ActiveModel::AttributeMethods + 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 ::ActiveModel::Dirty + include ::ActiveRecord::AttributeMethods::Dirty + include ::ActiveRecord::AttributeMethods::Serialization + include ::ActiveRecord::Callbacks + include ::ActiveModel::Validations::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::Normalization + include ::ActiveRecord::Marshalling::Methods + include ::CanCan::ModelAdditions + include ::ActiveStorage::Attached::Model + include ::ActiveStorage::Reflection::ActiveRecordExtensions + include ::ActionText::Attribute + extend ::ActiveModel::Naming + extend ::ActiveSupport::Benchmarkable + extend ::ActiveSupport::DescendantsTracker + extend ::ActiveRecord::ConnectionHandling + extend ::ActiveRecord::QueryCache::ClassMethods + extend ::ActiveRecord::Querying + extend ::ActiveModel::Translation + 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 ::ActiveModel::Conversion::ClassMethods + extend ::ActiveRecord::Integration::ClassMethods + extend ::ActiveModel::Validations::ClassMethods + extend ::ActiveModel::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveModel::Validations::HelperMethods + extend ::ActiveRecord::Validations::ClassMethods + extend ::ActiveRecord::CounterCache::ClassMethods + extend ::ActiveRecord::Attributes::ClassMethods + extend ::ActiveRecord::Locking::Optimistic::ClassMethods + extend ::ActiveRecord::Encryption::EncryptableRecord::ClassMethods + extend ::ActiveModel::AttributeMethods::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 ::ActiveModel::Validations::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 ::ActiveRecord::Normalization::ClassMethods + extend ::CanCan::ModelAdditions::ClassMethods + extend ::ActiveStorage::Attached::Model::ClassMethods + extend ::ActiveStorage::Reflection::ActiveRecordExtensions::ClassMethods + extend ::ActionText::Attribute::ClassMethods + extend ::ActiveRecord::Import::Connection + + # pkg:gem/activerecord#lib/active_record/base.rb:309 + def __callbacks; end + + # pkg:gem/activerecord#lib/active_record/base.rb:309 + def __callbacks?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:322 + def _before_commit_callbacks; end + + # pkg:gem/activerecord#lib/active_record/base.rb:322 + def _commit_callbacks; end + + # pkg:gem/activerecord#lib/active_record/base.rb:316 + def _create_callbacks; end + + # pkg:gem/activerecord#lib/active_record/base.rb:316 + def _destroy_callbacks; end + + # pkg:gem/activerecord#lib/active_record/base.rb:316 + def _find_callbacks; end + + # pkg:gem/activerecord#lib/active_record/base.rb:316 + def _initialize_callbacks; end + + # pkg:gem/activerecord#lib/active_record/base.rb:325 + def _reflections; end + + # pkg:gem/activerecord#lib/active_record/base.rb:325 + def _reflections?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:322 + def _rollback_callbacks; end + + # pkg:gem/activerecord#lib/active_record/base.rb:322 + def _run_before_commit_callbacks(&block); end + + # pkg:gem/activerecord#lib/active_record/base.rb:322 + def _run_commit_callbacks(&block); end + + # pkg:gem/activerecord#lib/active_record/base.rb:316 + def _run_create_callbacks(&block); end + + # pkg:gem/activerecord#lib/active_record/base.rb:316 + def _run_destroy_callbacks(&block); end + + # pkg:gem/activerecord#lib/active_record/base.rb:316 + def _run_find_callbacks(&block); end + + # pkg:gem/activerecord#lib/active_record/base.rb:316 + def _run_initialize_callbacks(&block); end + + # pkg:gem/activerecord#lib/active_record/base.rb:322 + def _run_rollback_callbacks(&block); end + + # pkg:gem/activerecord#lib/active_record/base.rb:316 + def _run_save_callbacks(&block); end + + # pkg:gem/activerecord#lib/active_record/base.rb:316 + def _run_touch_callbacks(&block); end + + # pkg:gem/activerecord#lib/active_record/base.rb:316 + def _run_update_callbacks(&block); end + + # pkg:gem/activerecord#lib/active_record/base.rb:309 + def _run_validate_callbacks(&block); end + + # pkg:gem/activerecord#lib/active_record/base.rb:316 + def _run_validation_callbacks(&block); end + + # pkg:gem/activerecord#lib/active_record/base.rb:316 + def _save_callbacks; end + + # pkg:gem/activerecord#lib/active_record/base.rb:316 + def _touch_callbacks; end + + # pkg:gem/activerecord#lib/active_record/base.rb:316 + def _update_callbacks; end + + # pkg:gem/activerecord#lib/active_record/base.rb:309 + def _validate_callbacks; end + + # pkg:gem/activerecord#lib/active_record/base.rb:316 + def _validation_callbacks; end + + # pkg:gem/activerecord#lib/active_record/base.rb:309 + def _validators; end + + # pkg:gem/activerecord#lib/active_record/base.rb:309 + def _validators?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:325 + def aggregate_reflections; end + + # pkg:gem/activerecord#lib/active_record/base.rb:325 + def aggregate_reflections?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:338 + def attachment_reflections; end + + # pkg:gem/activerecord#lib/active_record/base.rb:338 + def attachment_reflections?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:315 + def attribute_aliases; end + + # pkg:gem/activerecord#lib/active_record/base.rb:315 + def attribute_aliases?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:315 + def attribute_method_patterns; end + + # pkg:gem/activerecord#lib/active_record/base.rb:315 + def attribute_method_patterns?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:325 + def automatic_scope_inversing; end + + # pkg:gem/activerecord#lib/active_record/base.rb:325 + def automatic_scope_inversing?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:308 + def cache_timestamp_format; end + + # pkg:gem/activerecord#lib/active_record/base.rb:308 + def cache_timestamp_format?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:308 + def cache_versioning; end + + # pkg:gem/activerecord#lib/active_record/base.rb:308 + def cache_versioning?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:308 + def collection_cache_versioning; end + + # pkg:gem/activerecord#lib/active_record/base.rb:308 + def collection_cache_versioning?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def column_for_attribute(name, &block); end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def default_connection_handler; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def default_connection_handler?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def default_role; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def default_role?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:304 + def default_scope_override; end + + # pkg:gem/activerecord#lib/active_record/base.rb:304 + def default_scopes; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def default_shard; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def default_shard?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:295 + def defined_enums; end + + # pkg:gem/activerecord#lib/active_record/base.rb:295 + def defined_enums?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def destroy_association_async_batch_size; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def destroy_association_async_job(&block); end + + # pkg:gem/activerecord#lib/active_record/base.rb:314 + def encrypted_attributes; end + + # pkg:gem/activerecord#lib/active_record/base.rb:314 + def encrypted_attributes=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/base.rb:314 + def encrypted_attributes?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:326 + def include_root_in_json; end + + # pkg:gem/activerecord#lib/active_record/base.rb:326 + def include_root_in_json?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:312 + def lock_optimistically; end + + # pkg:gem/activerecord#lib/active_record/base.rb:312 + def lock_optimistically?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def logger; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def logger?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:283 + def model_name(&block); end + + # pkg:gem/activerecord#lib/active_record/base.rb:321 + def nested_attributes_options; end + + # pkg:gem/activerecord#lib/active_record/base.rb:321 + def nested_attributes_options?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:332 + def normalized_attributes; end + + # pkg:gem/activerecord#lib/active_record/base.rb:332 + def normalized_attributes=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/base.rb:332 + def normalized_attributes?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:307 + def param_delimiter=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/base.rb:315 + def partial_inserts; end + + # pkg:gem/activerecord#lib/active_record/base.rb:315 + def partial_inserts?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:315 + def partial_updates; end + + # pkg:gem/activerecord#lib/active_record/base.rb:315 + def partial_updates?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def pluralize_table_names; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def pluralize_table_names?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def primary_key_prefix_type; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def primary_key_prefix_type?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:317 + def record_timestamps; end + + # pkg:gem/activerecord#lib/active_record/base.rb:317 + def record_timestamps=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/base.rb:317 + def record_timestamps?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:330 + def signed_id_verifier_secret; end + + # pkg:gem/activerecord#lib/active_record/base.rb:330 + def signed_id_verifier_secret?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:315 + def skip_time_zone_conversion_for_attributes; end + + # pkg:gem/activerecord#lib/active_record/base.rb:315 + def skip_time_zone_conversion_for_attributes?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:303 + def store_full_class_name; end + + # pkg:gem/activerecord#lib/active_record/base.rb:303 + def store_full_class_name?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:303 + def store_full_sti_class; end + + # pkg:gem/activerecord#lib/active_record/base.rb:303 + def store_full_sti_class?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def table_name_prefix; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def table_name_prefix?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def table_name_suffix; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def table_name_suffix?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:315 + def time_zone_aware_attributes; end + + # pkg:gem/activerecord#lib/active_record/base.rb:315 + def time_zone_aware_attributes?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:315 + def time_zone_aware_types; end + + # pkg:gem/activerecord#lib/active_record/base.rb:315 + def time_zone_aware_types?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def type_for_attribute(attr_name, &block); end + + # pkg:gem/activerecord#lib/active_record/base.rb:309 + def validation_context; end + + private + + # pkg:gem/activerecord#lib/active_record/base.rb:309 + def validation_context=(_arg0); end + + class << self + # pkg:gem/activerecord#lib/active_record/base.rb:301 + def _attr_readonly; end + + # pkg:gem/activerecord#lib/active_record/base.rb:301 + def _attr_readonly=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:301 + def _attr_readonly?; end + + # pkg:gem/activerecord#lib/active_record/counter_cache.rb:9 + def _counter_cache_columns; end + + # pkg:gem/activerecord#lib/active_record/counter_cache.rb:9 + def _counter_cache_columns=(value); end + + # pkg:gem/activerecord#lib/active_record/counter_cache.rb:9 + def _counter_cache_columns?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def _destroy_association_async_job; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def _destroy_association_async_job=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def _destroy_association_async_job?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:11 + def _reflections; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:11 + def _reflections=(value); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:11 + def _reflections?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:12 + def aggregate_reflections; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:12 + def aggregate_reflections=(value); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:12 + def aggregate_reflections?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def application_record_class?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def asynchronous_queries_session; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def asynchronous_queries_tracker; end + + # pkg:gem/activerecord#lib/active_record/attributes.rb:11 + def attributes_to_define_after_schema_loads; end + + # pkg:gem/activerecord#lib/active_record/attributes.rb:11 + def attributes_to_define_after_schema_loads=(value); end + + # pkg:gem/activerecord#lib/active_record/attributes.rb:11 + def attributes_to_define_after_schema_loads?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:13 + def automatic_scope_inversing; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:13 + def automatic_scope_inversing=(value); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:13 + def automatic_scope_inversing?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def belongs_to_required_by_default; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def belongs_to_required_by_default=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def belongs_to_required_by_default?; end + + # pkg:gem/activerecord#lib/active_record/integration.rb:16 + def cache_timestamp_format; end + + # pkg:gem/activerecord#lib/active_record/integration.rb:16 + def cache_timestamp_format=(value); end + + # pkg:gem/activerecord#lib/active_record/integration.rb:16 + def cache_timestamp_format?; end + + # pkg:gem/activerecord#lib/active_record/integration.rb:24 + def cache_versioning; end + + # pkg:gem/activerecord#lib/active_record/integration.rb:24 + def cache_versioning=(value); end + + # pkg:gem/activerecord#lib/active_record/integration.rb:24 + def cache_versioning?; end + + # pkg:gem/activerecord#lib/active_record/integration.rb:32 + def collection_cache_versioning; end + + # pkg:gem/activerecord#lib/active_record/integration.rb:32 + def collection_cache_versioning=(value); end + + # pkg:gem/activerecord#lib/active_record/integration.rb:32 + def collection_cache_versioning?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def configurations; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def configurations=(config); end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def connected_to_stack; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def connection_class; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def connection_class=(b); end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def connection_class?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def connection_class_for_self; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def connection_handler; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def connection_handler=(handler); end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def current_preventing_writes; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def current_role; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def current_shard; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/serialization.rb:20 + def default_column_serializer; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/serialization.rb:20 + def default_column_serializer=(value); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/serialization.rb:20 + def default_column_serializer?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def default_connection_handler; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def default_connection_handler=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def default_connection_handler?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def default_role; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def default_role=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def default_role?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:304 + def default_scope_override; end + + # pkg:gem/activerecord#lib/active_record/base.rb:304 + def default_scope_override=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:304 + def default_scopes; end + + # pkg:gem/activerecord#lib/active_record/base.rb:304 + def default_scopes=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def default_shard; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def default_shard=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def default_shard?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:295 + def defined_enums; end + + # pkg:gem/activerecord#lib/active_record/base.rb:295 + def defined_enums=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:295 + def defined_enums?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def destroy_association_async_batch_size; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def destroy_association_async_batch_size=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def destroy_association_async_job; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def destroy_association_async_job=(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:11 + def encrypted_attributes; end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:11 + def encrypted_attributes=(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:11 + def encrypted_attributes?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def enumerate_columns_in_select_statements; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def enumerate_columns_in_select_statements=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def enumerate_columns_in_select_statements?; end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:11 + def generated_token_verifier; end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:11 + def generated_token_verifier=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def has_many_inversing; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def has_many_inversing=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def has_many_inversing?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def immutable_strings_by_default; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def immutable_strings_by_default=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def immutable_strings_by_default?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def implicit_order_column; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def implicit_order_column=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def implicit_order_column?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def inheritance_column; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def inheritance_column=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def inheritance_column?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def internal_metadata_table_name; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def internal_metadata_table_name=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def internal_metadata_table_name?; end + + # pkg:gem/activerecord#lib/active_record/store.rb:101 + def local_stored_attributes; end + + # pkg:gem/activerecord#lib/active_record/store.rb:101 + def local_stored_attributes=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:56 + def lock_optimistically; end + + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:56 + def lock_optimistically=(value); end + + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:56 + def lock_optimistically?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def logger; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def logger=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def logger?; end + + # pkg:gem/activerecord#lib/active_record/nested_attributes.rb:15 + def nested_attributes_options; end + + # pkg:gem/activerecord#lib/active_record/nested_attributes.rb:15 + def nested_attributes_options=(value); end + + # pkg:gem/activerecord#lib/active_record/nested_attributes.rb:15 + def nested_attributes_options?; end + + # pkg:gem/activerecord#lib/active_record/normalization.rb:8 + def normalized_attributes; end + + # pkg:gem/activerecord#lib/active_record/normalization.rb:8 + def normalized_attributes=(value); end + + # pkg:gem/activerecord#lib/active_record/normalization.rb:8 + def normalized_attributes?; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/dirty.rb:50 + def partial_inserts; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/dirty.rb:50 + def partial_inserts=(value); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/dirty.rb:50 + def partial_inserts?; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/dirty.rb:49 + def partial_updates; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/dirty.rb:49 + def partial_updates=(value); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/dirty.rb:49 + def partial_updates?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def pluralize_table_names; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def pluralize_table_names=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def pluralize_table_names?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def primary_key_prefix_type; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def primary_key_prefix_type=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def primary_key_prefix_type?; end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:47 + def record_timestamps; end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:47 + def record_timestamps=(value); end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:47 + def record_timestamps?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def run_commit_callbacks_on_first_saved_instances_in_transaction; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def run_commit_callbacks_on_first_saved_instances_in_transaction=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def run_commit_callbacks_on_first_saved_instances_in_transaction?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def schema_migrations_table_name; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def schema_migrations_table_name=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def schema_migrations_table_name?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def shard_selector; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def shard_selector=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def shard_selector?; end + + # pkg:gem/activerecord#lib/active_record/signed_id.rb:13 + def signed_id_verifier_secret; end + + # pkg:gem/activerecord#lib/active_record/signed_id.rb:13 + def signed_id_verifier_secret=(value); end + + # pkg:gem/activerecord#lib/active_record/signed_id.rb:13 + def signed_id_verifier_secret?; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:67 + def skip_time_zone_conversion_for_attributes; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:67 + def skip_time_zone_conversion_for_attributes=(value); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:67 + def skip_time_zone_conversion_for_attributes?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:303 + def store_full_class_name; end + + # pkg:gem/activerecord#lib/active_record/base.rb:303 + def store_full_class_name=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:303 + def store_full_class_name?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:303 + def store_full_sti_class; end + + # pkg:gem/activerecord#lib/active_record/base.rb:303 + def store_full_sti_class=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:303 + def store_full_sti_class?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def strict_loading_by_default; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def strict_loading_by_default=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def strict_loading_by_default?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:299 + def strict_loading_violation!(owner:, reflection:); end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def table_name_prefix; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def table_name_prefix=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def table_name_prefix?; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def table_name_suffix; end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def table_name_suffix=(value); end + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def table_name_suffix?; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:66 + def time_zone_aware_attributes; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:66 + def time_zone_aware_attributes=(value); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:66 + def time_zone_aware_attributes?; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:68 + def time_zone_aware_types; end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:68 + def time_zone_aware_types=(value); end + + # pkg:gem/activerecord#lib/active_record/attribute_methods/time_zone_conversion.rb:68 + def time_zone_aware_types?; end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:10 + def token_definitions; end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:10 + def token_definitions=(value); end + + private + + # pkg:gem/activerecord#lib/active_record/base.rb:302 + def _inheritance_column=(value); end + end +end + +# pkg:gem/activerecord#lib/active_record/base.rb:315 +module ActiveRecord::Base::GeneratedAssociationMethods; end + +# pkg:gem/activerecord#lib/active_record/base.rb:315 +module ActiveRecord::Base::GeneratedAttributeMethods; end + +# = Active Record \Batches +# +# pkg:gem/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 primary key value to start from, inclusive of the value. + # * :finish - Specifies the primary key 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. + # * :order - Specifies the primary key 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 primary key is + # orderable (e.g. an integer or string). + # + # NOTE: By its nature, batch processing is subject to race conditions if + # other processes are modifying the database. + # + # pkg:gem/activerecord#lib/active_record/relation/batches.rb:79 + def find_each(start: T.unsafe(nil), finish: T.unsafe(nil), batch_size: T.unsafe(nil), error_on_ignore: 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 primary key value to start from, inclusive of the value. + # * :finish - Specifies the primary key 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. + # * :order - Specifies the primary key 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 primary key is + # orderable (e.g. an integer or string). + # + # NOTE: By its nature, batch processing is subject to race conditions if + # other processes are modifying the database. + # + # pkg:gem/activerecord#lib/active_record/relation/batches.rb:148 + def find_in_batches(start: T.unsafe(nil), finish: T.unsafe(nil), batch_size: T.unsafe(nil), error_on_ignore: 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 primary key value to start from, inclusive of the value. + # * :finish - Specifies the primary key 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. + # * :order - Specifies the primary key 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 primary key is + # orderable (e.g. an integer or string). + # + # NOTE: By its nature, batch processing is subject to race conditions if + # other processes are modifying the database. + # + # pkg:gem/activerecord#lib/active_record/relation/batches.rb:239 + 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), order: T.unsafe(nil), use_ranges: T.unsafe(nil), &block); end + + private + + # pkg:gem/activerecord#lib/active_record/relation/batches.rb:325 + def act_on_ignored_order(error_on_ignore); end + + # pkg:gem/activerecord#lib/active_record/relation/batches.rb:297 + def apply_finish_limit(relation, finish, batch_orders); end + + # pkg:gem/activerecord#lib/active_record/relation/batches.rb:284 + def apply_limits(relation, start, finish, batch_orders); end + + # pkg:gem/activerecord#lib/active_record/relation/batches.rb:290 + def apply_start_limit(relation, start, batch_orders); end + + # pkg:gem/activerecord#lib/active_record/relation/batches.rb:304 + def batch_condition(relation, columns, values, operators); end + + # pkg:gem/activerecord#lib/active_record/relation/batches.rb:339 + def batch_on_loaded_relation(relation:, start:, finish:, order:, batch_limit:); end + + # pkg:gem/activerecord#lib/active_record/relation/batches.rb:364 + def batch_on_unloaded_relation(relation:, start:, finish:, load:, order:, use_ranges:, remaining:, batch_limit:); end + + # pkg:gem/activerecord#lib/active_record/relation/batches.rb:319 + def build_batch_orders(order); end + + # pkg:gem/activerecord#lib/active_record/relation/batches.rb:335 + def get_the_order_of_primary_key(order); end +end + +# pkg:gem/activerecord#lib/active_record/relation/batches/batch_enumerator.rb:5 +class ActiveRecord::Batches::BatchEnumerator + include ::Enumerable + + # pkg:gem/activerecord#lib/active_record/relation/batches/batch_enumerator.rb:8 + def initialize(relation:, 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. + # + # pkg:gem/activerecord#lib/active_record/relation/batches/batch_enumerator.rb:27 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation/batches/batch_enumerator.rb:65 + def delete_all; end + + # Destroys records in batches. + # + # Person.where("age < 10").in_batches.destroy_all + # + # See Relation#destroy_all for details of how each batch is destroyed. + # + # pkg:gem/activerecord#lib/active_record/relation/batches/batch_enumerator.rb:85 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/batches/batch_enumerator.rb:94 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/batches/batch_enumerator.rb:52 + def each_record(&block); end + + # The primary key value at which the BatchEnumerator ends, inclusive of the value. + # + # pkg:gem/activerecord#lib/active_record/relation/batches/batch_enumerator.rb:21 + def finish; end + + # The relation from which the BatchEnumerator yields batches. + # + # pkg:gem/activerecord#lib/active_record/relation/batches/batch_enumerator.rb:24 + def relation; end + + # The primary key value from which the BatchEnumerator starts, inclusive of the value. + # + # pkg:gem/activerecord#lib/active_record/relation/batches/batch_enumerator.rb:18 + def start; 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. + # + # pkg:gem/activerecord#lib/active_record/relation/batches/batch_enumerator.rb:74 + def update_all(updates); end +end + +# pkg:gem/activerecord#lib/active_record/relation/batches.rb:9 +ActiveRecord::Batches::DEFAULT_ORDER = T.let(T.unsafe(nil), Symbol) + +# pkg:gem/activerecord#lib/active_record/relation/batches.rb:8 +ActiveRecord::Batches::ORDER_IGNORE_MESSAGE = T.let(T.unsafe(nil), String) + +# = Active Record \Calculations +# +# pkg:gem/activerecord#lib/active_record/relation/calculations.rb:7 +module ActiveRecord::Calculations + # Same as #average, but performs the query asynchronously and returns an + # ActiveRecord::Promise. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:397 + def async_ids; end + + # Same as #maximum, but performs the query asynchronously and returns an + # ActiveRecord::Promise. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:353 + def async_pick(*column_names); end + + # Same as #pluck, but performs the query asynchronously and returns an + # ActiveRecord::Promise. + # + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:324 + def async_pluck(*column_names); end + + # Same as #sum, but performs the query asynchronously and returns an + # ActiveRecord::Promise. + # + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:182 + 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 + # + # pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:217 + 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, loads all records in the relation, if the relation + # hasn't been loaded yet. Calls the block with each record in the relation. + # 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 + # + # Note: If there are a lot of records in the relation, loading all records + # could result in performance issues. + # + # pkg:gem/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(:companies).ids # SELECT people.id FROM people INNER JOIN companies ON companies.id = people.company_id + # + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:361 + 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 + # + # pkg:gem/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 + # + # pkg:gem/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' ] + # + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:342 + 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] + # + # Person.pluck(Arel.sql('DATEDIFF(updated_at, created_at)')) + # # SELECT DATEDIFF(updated_at, created_at) FROM people + # # => ['0', '27761', '173'] + # + # See also #ids. + # + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:283 + 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, loads all records in the relation, if the relation + # hasn't been loaded yet. Calls the block with each record in the relation. + # Returns the sum of +initial_value_or_column+ and the block return + # values: + # + # Person.sum { |person| person.age } # => 4562 + # Person.sum(1000) { |person| person.age } # => 5562 + # + # Note: If there are a lot of records in the relation, loading all records + # could result in performance issues. + # + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:172 + def sum(initial_value_or_column = T.unsafe(nil), &block); end + + private + + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:441 + def aggregate_column(column_name); end + + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:402 + def all_attributes?(column_names); end + + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:626 + def build_count_subquery(relation, column_name, distinct); end + + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:437 + def distinct_select?(column_name); end + + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:492 + def execute_grouped_calculation(operation, column_name, distinct); end + + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:453 + def execute_simple_calculation(operation, column_name, distinct); end + + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:406 + def has_include?(column_name); end + + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:574 + def lookup_cast_type_from_join_dependencies(name, join_dependencies = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:449 + def operation_over_aggregate_column(column, operation, distinct); end + + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:410 + def perform_calculation(operation, column_name); end + + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:617 + def select_for_count; end + + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:599 + def type_cast_calculated_value(value, operation, type); end + + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:582 + def type_cast_pluck_values(result, columns); end + + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:569 + def type_for(field, &block); end +end + +# pkg:gem/activerecord#lib/active_record/relation/calculations.rb:8 +class ActiveRecord::Calculations::ColumnAliasTracker + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:9 + def initialize(connection); end + + # pkg:gem/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" + # + # pkg:gem/activerecord#lib/active_record/relation/calculations.rb:35 + def column_alias_for(field); end + + # pkg:gem/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. +# +# pkg:gem/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 + + # pkg:gem/activerecord#lib/active_record/callbacks.rb:419 + def destroy; end + + # pkg:gem/activerecord#lib/active_record/callbacks.rb:435 + def increment!(attribute, by = T.unsafe(nil), touch: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/callbacks.rb:431 + def touch(*, **); end + + private + + # pkg:gem/activerecord#lib/active_record/callbacks.rb:444 + def _create_record; end + + # pkg:gem/activerecord#lib/active_record/callbacks.rb:448 + def _update_record; end + + # pkg:gem/activerecord#lib/active_record/callbacks.rb:440 + def create_or_update(**); end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def __callbacks?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def __callbacks?; end + end +end + +# pkg:gem/activerecord#lib/active_record/callbacks.rb:281 +ActiveRecord::Callbacks::CALLBACKS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/active_record/callbacks.rb:288 +module ActiveRecord::Callbacks::ClassMethods + include ::ActiveModel::Callbacks +end + +# pkg:gem/activerecord#lib/active_record.rb:122 +module ActiveRecord::Coders; end + +# pkg:gem/activerecord#lib/active_record/coders/column_serializer.rb:5 +class ActiveRecord::Coders::ColumnSerializer + # pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/coders/column_serializer.rb:46 + def assert_valid_value(object, action:); end + + # pkg:gem/activerecord#lib/active_record/coders/column_serializer.rb:7 + def coder; end + + # pkg:gem/activerecord#lib/active_record/coders/column_serializer.rb:22 + def dump(object); end + + # pkg:gem/activerecord#lib/active_record/coders/column_serializer.rb:16 + def init_with(coder); end + + # pkg:gem/activerecord#lib/active_record/coders/column_serializer.rb:29 + def load(payload); end + + # pkg:gem/activerecord#lib/active_record/coders/column_serializer.rb:6 + def object_class; end + + private + + # pkg:gem/activerecord#lib/active_record/coders/column_serializer.rb:54 + def check_arity_of_constructor; end +end + +# pkg:gem/activerecord#lib/active_record/coders/json.rb:5 +module ActiveRecord::Coders::JSON + class << self + # pkg:gem/activerecord#lib/active_record/coders/json.rb:6 + def dump(obj); end + + # pkg:gem/activerecord#lib/active_record/coders/json.rb:10 + def load(json); end + end +end + +# pkg:gem/activerecord#lib/active_record/coders/yaml_column.rb:7 +class ActiveRecord::Coders::YAMLColumn < ::ActiveRecord::Coders::ColumnSerializer + # pkg:gem/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 + + # pkg:gem/activerecord#lib/active_record/coders/yaml_column.rb:77 + def coder; end + + # pkg:gem/activerecord#lib/active_record/coders/yaml_column.rb:68 + def init_with(coder); end + + private + + # pkg:gem/activerecord#lib/active_record/coders/yaml_column.rb:88 + def check_arity_of_constructor; end +end + +# pkg:gem/activerecord#lib/active_record/coders/yaml_column.rb:8 +class ActiveRecord::Coders::YAMLColumn::SafeCoder + # pkg:gem/activerecord#lib/active_record/coders/yaml_column.rb:9 + def initialize(permitted_classes: T.unsafe(nil), unsafe_load: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/coders/yaml_column.rb:15 + def dump(object); end + + # pkg:gem/activerecord#lib/active_record/coders/yaml_column.rb:33 + def load(payload); end +end + +# pkg:gem/activerecord#lib/active_record/associations.rb:187 +class ActiveRecord::CompositePrimaryKeyMismatchError < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/associations.rb:190 + def initialize(reflection = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/associations.rb:188 + def reflection; end +end + +# pkg:gem/activerecord#lib/active_record/migration.rb:175 +class ActiveRecord::ConcurrentMigrationError < ::ActiveRecord::MigrationError + # pkg:gem/activerecord#lib/active_record/migration.rb:179 + def initialize(message = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/active_record/migration.rb:176 +ActiveRecord::ConcurrentMigrationError::DEFAULT_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/activerecord#lib/active_record/migration.rb:177 +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. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:369 +class ActiveRecord::ConfigurationError < ::ActiveRecord::ActiveRecordError; end + +# :stopdoc: +# +# pkg:gem/activerecord#lib/active_record/connection_adapters.rb:4 +module ActiveRecord::ConnectionAdapters + extend ::ActiveSupport::Autoload +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.connection}[rdoc-ref:ConnectionHandling#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. +# +# pkg:gem/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 + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:128 + def initialize(config_or_deprecated_connection, deprecated_logger = T.unsafe(nil), deprecated_connection_options = T.unsafe(nil), deprecated_config = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:33 + def __callbacks; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:33 + def __callbacks?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:34 + def _checkin_callbacks; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:34 + def _checkout_callbacks; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:34 + def _run_checkin_callbacks(&block); end + + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:674 + def active?; end + + # Returns the human-readable name of the adapter. Use mixed case - one + # can always use downcase if needed. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:377 + def adapter_name; end + + # This is meant to be implemented by the adapters that support custom enum types + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:612 + def add_enum_value(*); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:619 + def advisory_locks_enabled?; end + + # Override to check all foreign key constraints in a database. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:655 + def all_foreign_keys_valid?(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:586 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:859 + def build_insert_sql(insert); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:830 + def case_insensitive_comparison(attribute, value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:826 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:666 + def check_all_foreign_keys_valid!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:208 + def check_if_write_query(sql); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:874 + def check_version; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:799 + def clean!; end + + # Clear any caching the database adapter may be doing. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:754 + def clear_cache!(new_connection: T.unsafe(nil)); end + + # Check the connection back in to the connection pool + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:846 + def close; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:794 + def connect!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:313 + def connection_class; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:222 + def connection_retries; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:38 + def create(*, **, &); end + + # This is meant to be implemented by the adapters that support custom enum types + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:600 + def create_enum(*); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:386 + def database_exists?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:870 + def database_version; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:850 + def default_index_type?(index); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:234 + def default_timezone; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:822 + def default_uniqueness_comparison(attribute, value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:38 + def delete(*, **, &); end + + # This is meant to be implemented by the adapters that support extensions + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:592 + def disable_extension(name, **); end + + # Override to turn off referential integrity while executing &block. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:650 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:729 + def discard!; end + + # Disconnects from the database if already connected. Otherwise, this + # method does nothing. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:717 + def disconnect!; end + + # This is meant to be implemented by the adapters that support custom enum types + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:604 + def drop_enum(*); end + + # This is meant to be implemented by the adapters that support extensions + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:596 + def enable_extension(name, **); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:38 + def exec_insert_all(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:38 + def exec_query(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:38 + def execute(*, **, &); end + + # this method must only be called while holding connection pool's mutex + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:334 + def expire; end + + # A list of extensions, to be filled in by adapters that support them. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:638 + def extensions; end + + # This is meant to be implemented by the adapters that support advisory + # locks + # + # Return true if we got the lock, otherwise false + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:627 + def get_advisory_lock(lock_id); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:867 + def get_database_version; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:46 + def in_use?; end + + # A list of index algorithms, to be filled by adapters that support them. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:643 + def index_algorithms; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:38 + def insert(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:261 + def internal_metadata; end + + # this method must only be called while holding connection pool's mutex + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:298 + def lease; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:45 + def lock; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:183 + def lock_thread=(lock_thread); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:45 + def logger; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:253 + def migration_context; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:249 + def migrations_paths; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:45 + def owner; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:44 + def pool; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:48 + def pool=(value); 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:426 + def prefetch_primary_key?(table_name = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:268 + def prepared_statements; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:265 + def prepared_statements?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:270 + 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+. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:242 + 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+. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:814 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:680 + 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 + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:634 + def release_advisory_lock(lock_id); end + + # This is meant to be implemented by the adapters that support custom enum types + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:608 + def rename_enum(*); end + + # This is meant to be implemented by the adapters that support custom enum types + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:616 + def rename_enum_value(*); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:214 + def replica?; end + + # Returns true if its required to reload the connection between requests for development mode. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:767 + 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). + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:741 + def reset!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:38 + def restart_db_transaction(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:226 + def retry_deadline; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:582 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:319 + def role; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:38 + def rollback_db_transaction(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:38 + def rollback_to_savepoint(*, **, &); end + + # Do TransactionRollbackErrors on savepoints affect the parent + # transaction? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:410 + def savepoint_errors_invalidate_transactions?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:329 + def schema_cache; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:257 + def schema_migration; 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:881 + def schema_version; end + + # Seconds since this connection was returned to the pool + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:363 + def seconds_idle; end + + # The shard (e.g. +:default+) for the current connection. In + # a non-sharded application, +:default+ is returned. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:325 + def shard; end + + # this method must only be called while holding connection pool's mutex (and a desire for segfaults) + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:350 + def steal!; end + + # Does this adapter support application-enforced advisory locking? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:419 + def supports_advisory_locks?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:399 + def supports_bulk_alter?; end + + # Does this adapter support creating check constraints? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:491 + def supports_check_constraints?; end + + # Does this adapter support metadata comments on database objects (tables, columns, indexes)? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:526 + def supports_comments?; end + + # Can comments for tables, columns, and indexes be specified in create/alter table statements? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:531 + def supports_comments_in_create?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:550 + def supports_common_table_expressions?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:574 + def supports_concurrent_connections?; end + + # Does this adapter support datetime with precision? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:516 + 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? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:395 + def supports_ddl_transactions?; end + + # Does this adapter support creating deferrable constraints? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:486 + def supports_deferrable_constraints?; end + + # Does this adapter support creating exclusion constraints? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:496 + def supports_exclusion_constraints?; end + + # Does this adapter support explain? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:455 + def supports_explain?; end + + # Does this adapter support expression indices? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:450 + def supports_expression_index?; end + + # Does this adapter support database extensions? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:465 + def supports_extensions?; end + + # Does this adapter support creating foreign key constraints? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:476 + def supports_foreign_keys?; end + + # Does this adapter support foreign/external tables? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:541 + def supports_foreign_tables?; end + + # Does this adapter support including non-key columns? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:445 + def supports_index_include?; end + + # Does this adapter support index sort order? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:435 + def supports_index_sort_order?; end + + # Does this adapter support creating indexes in the same statement as + # creating the table? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:471 + def supports_indexes_in_create?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:570 + def supports_insert_conflict_target?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:562 + def supports_insert_on_duplicate_skip?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:566 + def supports_insert_on_duplicate_update?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:558 + def supports_insert_returning?; end + + # Does this adapter support JSON data type? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:521 + def supports_json?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:554 + def supports_lazy_transactions?; end + + # Does this adapter support materialized views? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:511 + def supports_materialized_views?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:578 + def supports_nulls_not_distinct?; end + + # Does this adapter support optimizer hints? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:546 + def supports_optimizer_hints?; end + + # Does this adapter support partial indices? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:440 + def supports_partial_index?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:430 + def supports_partitioned_indexes?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:414 + def supports_restart_db_transaction?; end + + # Does this adapter support savepoints? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:404 + def supports_savepoints?; end + + # Does this adapter support setting the isolation level for a transaction? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:460 + def supports_transaction_isolation?; end + + # Does this adapter support creating unique constraints? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:501 + def supports_unique_constraints?; end + + # Does this adapter support creating invalid constraints? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:481 + def supports_validate_constraints?; end + + # Does this adapter support views? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:506 + def supports_views?; end + + # Does this adapter support virtual columns? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:536 + def supports_virtual_columns?; end + + # Removes the connection from the pool and disconnect it. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:748 + def throw_away!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:38 + def truncate(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:38 + def truncate_tables(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:368 + def unprepared_statement; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:38 + def update(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:218 + def use_metadata_table?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:293 + def valid_type?(type); 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:774 + def verify!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:45 + def visitor; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:198 + def with_instrumenter(instrumenter, &block); 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1099 + def any_raw_connection; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1204 + def arel_visitor; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1088 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1215 + def build_result(columns:, rows:, column_types: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1208 + def build_statement_pool; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:840 + def can_perform_case_insensitive_comparison_for?(column); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1190 + def collector; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1179 + def column_for(table_name, column_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1185 + def column_for_attribute(attribute); end + + # Perform any necessary initialization upon the newly-established + # @raw_connection -- this is the place to modify the adapter's + # 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). + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1226 + def configure_connection; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1229 + def default_prepared_statements; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1116 + def extended_type_map_key; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1074 + def invalidate_transaction(exception); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1142 + def log(sql, name = T.unsafe(nil), binds = T.unsafe(nil), type_casted_binds = T.unsafe(nil), statement_name = T.unsafe(nil), async: T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1092 + def reconnect; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:962 + def reconnect_can_restore_state?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1070 + def retryable_connection_error?(exception); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1081 + def retryable_query_error?(exception); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1158 + def transform_query(sql); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1165 + def translate_exception(exception, message:, sql:, binds:); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1132 + def translate_exception_class(e, sql, binds); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1122 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1108 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1066 + def verified!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1233 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:999 + def with_raw_connection(allow_retry: T.unsafe(nil), materialize_transactions: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:1175 + def without_prepared_statement?(binds); end + + class << self + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:33 + def __callbacks; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:33 + def __callbacks=(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:33 + def __callbacks?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:34 + def _checkin_callbacks; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:34 + def _checkin_callbacks=(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:34 + def _checkout_callbacks; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:34 + def _checkout_callbacks=(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:89 + def build_read_query_regexp(*parts); end + + # Does the database for this adapter exist? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:382 + def database_exists?(config); end + + # Opens a database console session. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:124 + def dbconsole(config, options = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:893 + def extended_type_map(default_timezone:); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:95 + def find_cmd_and_exec(commands, *args); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:886 + def register_class_with_precision(mapping, key, klass, **kwargs); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:68 + def type_cast_config_to_boolean(config); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:58 + def type_cast_config_to_integer(config); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:76 + def validate_default_timezone(config); end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:953 + def extract_limit(sql_type); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:949 + def extract_precision(sql_type); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:942 + def extract_scale(sql_type); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:902 + def initialize_type_map(m); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:935 + def register_class_with_limit(mapping, key, klass); end + end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:32 +ActiveRecord::ConnectionAdapters::AbstractAdapter::ADAPTER_NAME = T.let(T.unsafe(nil), String) + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:42 +ActiveRecord::ConnectionAdapters::AbstractAdapter::COMMENT_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:86 +ActiveRecord::ConnectionAdapters::AbstractAdapter::DEFAULT_READ_QUERY = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:196 +ActiveRecord::ConnectionAdapters::AbstractAdapter::EXCEPTION_IMMEDIATE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:195 +ActiveRecord::ConnectionAdapters::AbstractAdapter::EXCEPTION_NEVER = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:959 +ActiveRecord::ConnectionAdapters::AbstractAdapter::EXTENDED_TYPE_MAPS = T.let(T.unsafe(nil), Concurrent::Map) + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:180 +ActiveRecord::ConnectionAdapters::AbstractAdapter::FIBER_LOCK = T.let(T.unsafe(nil), ActiveSupport::Concurrency::LoadInterlockAwareMonitor) + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:41 +ActiveRecord::ConnectionAdapters::AbstractAdapter::SIMPLE_INT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:177 +ActiveRecord::ConnectionAdapters::AbstractAdapter::THREAD_LOCK = T.let(T.unsafe(nil), ActiveSupport::Concurrency::ThreadLoadInterlockAwareMonitor) + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:958 +ActiveRecord::ConnectionAdapters::AbstractAdapter::TYPE_MAP = T.let(T.unsafe(nil), ActiveRecord::Type::TypeMap) + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:274 +class ActiveRecord::ConnectionAdapters::AbstractAdapter::Version + include ::Comparable + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:279 + def initialize(version_string, full_version_string = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:284 + def <=>(version_string); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:277 + def full_version_string; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract_adapter.rb:288 + def to_s; end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:12 +module ActiveRecord::ConnectionAdapters::AbstractPool; end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:114 +class ActiveRecord::ConnectionAdapters::AddColumnDefinition < ::Struct + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:114 + def column; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:114 + def column=(_); end + + class << self + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:114 + def [](*_arg0); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:114 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:114 + def keyword_init?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:114 + def members; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:114 + def new(*_arg0); end + end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:621 +class ActiveRecord::ConnectionAdapters::AlterTable + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:626 + def initialize(td); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:645 + def add_check_constraint(expression, options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:653 + def add_column(name, type, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:637 + def add_foreign_key(to_table, options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:622 + def adds; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:624 + def check_constraint_adds; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:624 + def check_constraint_drops; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:649 + def drop_check_constraint(constraint_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:641 + def drop_foreign_key(name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:623 + def foreign_key_adds; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:623 + def foreign_key_drops; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:635 + def name; end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:149 +class ActiveRecord::ConnectionAdapters::BoundSchemaReflection + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:150 + def initialize(abstract_schema_reflection, connection); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:175 + def add(name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:163 + def cached?(table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:155 + def clear!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:211 + def clear_data_source_cache!(name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:183 + def columns(table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:187 + def columns_hash(table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:191 + def columns_hash?(table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:171 + def data_source_exists?(name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:179 + def data_sources(name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:199 + def database_version; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:215 + def dump_to(filename); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:195 + def indexes(table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:159 + def load!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:167 + def primary_keys(table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:207 + def size; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:203 + def version; end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:118 +class ActiveRecord::ConnectionAdapters::ChangeColumnDefaultDefinition < ::Struct + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:118 + def column; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:118 + def column=(_); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:118 + def default; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:118 + def default=(_); end + + class << self + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:118 + def [](*_arg0); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:118 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:118 + def keyword_init?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:118 + def members; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:118 + def new(*_arg0); end + end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:116 +class ActiveRecord::ConnectionAdapters::ChangeColumnDefinition < ::Struct + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:116 + def column; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:116 + def column=(_); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:116 + def name; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:116 + def name=(_); end + + class << self + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:116 + def [](*_arg0); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:116 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:116 + def keyword_init?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:116 + def members; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:116 + def new(*_arg0); end + end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:174 +class ActiveRecord::ConnectionAdapters::CheckConstraintDefinition < ::Struct + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:188 + def defined_for?(name:, expression: T.unsafe(nil), validate: T.unsafe(nil), **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:184 + def export_name_on_schema_dump?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:174 + def expression; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:174 + def expression=(_); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:175 + def name; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:174 + def options; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:174 + def options=(_); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:174 + def table_name; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:174 + def table_name=(_); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:179 + def validate?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:182 + def validated?; end + + class << self + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:174 + def [](*_arg0); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:174 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:174 + def keyword_init?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:174 + def members; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:174 + def new(*_arg0); end + end +end + +# An abstract definition of a column in a table. +# +# pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:20 + def initialize(name, default, sql_type_metadata = T.unsafe(nil), null = T.unsafe(nil), default_function = T.unsafe(nil), collation: T.unsafe(nil), comment: T.unsafe(nil), **); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:75 + def ==(other); end + + # whether the column is auto-populated by the database using a sequence + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:67 + def auto_incremented_by_db?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:71 + def auto_populated?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:34 + def bigint?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:10 + def collation; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:10 + def comment; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:10 + def default; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:10 + def default_function; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:56 + def encode_with(coder); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:85 + def eql?(other); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:30 + def has_default?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:87 + def hash; end + + # Returns the human name of the column name. + # + # ===== Examples + # Column.new('sales_stage', ...).human_name # => 'Sales stage' + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:42 + def human_name; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:46 + def init_with(coder); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:12 + def limit(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:10 + def name; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:10 + def null; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:12 + def precision(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:12 + def scale(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:12 + def sql_type(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:10 + def sql_type_metadata; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:12 + def type(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:99 + def virtual?; end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:104 + 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. +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:79 +class ActiveRecord::ConnectionAdapters::ColumnDefinition < ::Struct + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:109 + def aliased_types(name, fallback); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:98 + def collation; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:98 + def collation=(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:98 + def comment; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:98 + def comment=(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:98 + def default; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:98 + def default=(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:98 + def if_exists; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:98 + def if_exists=(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:98 + def if_not_exists; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:98 + def if_not_exists=(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:98 + def limit; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:98 + def limit=(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:79 + def name; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:79 + def name=(_); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:98 + def null; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:98 + def null=(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:79 + def options; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:79 + def options=(_); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:98 + def precision; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:98 + def precision=(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:93 + def primary_key?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:98 + def scale; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:98 + def scale=(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:79 + def sql_type; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:79 + def sql_type=(_); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:79 + def type; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:79 + def type=(_); end + + class << self + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:79 + def [](*_arg0); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:79 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:79 + def keyword_init?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:79 + def members; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:79 + def new(*_arg0); end + end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:80 +ActiveRecord::ConnectionAdapters::ColumnDefinition::OPTION_NAMES = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:300 +module ActiveRecord::ConnectionAdapters::ColumnMethods + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::ConnectionAdapters::ColumnMethods::ClassMethods + + # Appends a primary key definition to the table definition. + # Can be called multiple times, but this is probably not a good idea. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:305 + def primary_key(name, type = T.unsafe(nil), **options); end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:328 +module ActiveRecord::ConnectionAdapters::ColumnMethods::ClassMethods + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:329 + 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. +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:57 +class ActiveRecord::ConnectionAdapters::ConnectionHandler + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:77 + def initialize; end + + # Returns true if there are any active connections among the connection + # pools that the ConnectionHandler is managing. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:173 + def active_connections?(role = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:97 + def all_connection_pools; end + + # Returns any connections in use by the current thread back to the pool, + # and also returns connections to the pool cached by threads that are no + # longer alive. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:185 + def clear_active_connections!(role = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:206 + def clear_all_connections!(role = T.unsafe(nil)); end + + # Clears the cache which maps classes. + # + # See ConnectionPool#clear_reloadable_connections! for details. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:197 + def clear_reloadable_connections!(role = T.unsafe(nil)); end + + # Returns true if a connection that's accessible to this class has + # already been opened. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:251 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:107 + def connection_pool_list(role = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:93 + def connection_pool_names; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:118 + def connection_pools(role = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:120 + def each_connection_pool(role = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:131 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:218 + def flush_idle_connections!(role = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:85 + def prevent_writes; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:89 + def prevent_writes=(prevent_writes); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:256 + 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). + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:231 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:265 + def retrieve_connection_pool(connection_name, role: T.unsafe(nil), shard: T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:271 + def connection_name_to_pool_manager; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:287 + def deprecation_for_pool_handling(method); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:356 + def determine_owner_name(owner_name, config); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:304 + def disconnect_pool_from_pool_manager(pool_manager, role, shard); end + + # Returns the pool manager for a connection name / identifier. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:274 + def get_pool_manager(connection_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:283 + 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" } + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:323 + def resolve_pool_config(config, connection_name, role, shard); end + + # Get the existing pool manager or initialize and assign a new one. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:279 + def set_pool_manager(connection_name); end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:58 +ActiveRecord::ConnectionAdapters::ConnectionHandler::FINALIZER = T.let(T.unsafe(nil), Proc) + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:61 +class ActiveRecord::ConnectionAdapters::ConnectionHandler::StringConnectionName + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:64 + def initialize(name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:72 + def current_preventing_writes; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:62 + def name; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_handler.rb:68 + 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.connection}[rdoc-ref:ConnectionHandling.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: +# +# * +pool+: maximum number of connections the pool may manage (default 5). +# * +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. +# * +checkout_timeout+: number of seconds to wait for a connection to +# become available before giving up and raising a timeout error (default +# 5 seconds). +# +# -- +# Synchronization policy: +# * all public methods can be called outside +synchronize+ +# * access to these instance variables needs to be in +synchronize+: +# * @connections +# * @now_connecting +# * private methods that require being called in a +synchronize+ blocks +# are now explicitly documented +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:8 +class ActiveRecord::ConnectionAdapters::ConnectionPool + include ::MonitorMixin + include ::ActiveRecord::ConnectionAdapters::QueryCache::ConnectionPoolConfiguration + include ::ActiveRecord::ConnectionAdapters::AbstractPool + + # 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:120 + def initialize(pool_config); 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 + # #connection or #with_connection methods. Connections obtained through + # #checkout will not be detected by #active_connection? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:196 + def active_connection?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:110 + def async_executor; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:109 + def automatic_reconnect; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:109 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:363 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:352 + def checkout(checkout_timeout = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:109 + def checkout_timeout; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:109 + def checkout_timeout=(_arg0); end + + # Clears the cache which maps classes 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). + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:310 + def clear_reloadable_connections(raise_on_acquisition_timeout = T.unsafe(nil)); end + + # Clears the cache which maps classes 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:334 + def clear_reloadable_connections!; end + + # Returns true if a connection has already been opened. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:233 + def connected?; end + + # Retrieve the connection associated with the current thread, or call + # #checkout to obtain one if necessary. + # + # #connection can be called any number of times; the connection is + # held in a cache keyed by a thread. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:181 + def connection; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:185 + def connection_class; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:188 + def connection_klass(*args, **, &block); 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:248 + def connections; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:110 + 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! + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:289 + def discard!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:299 + 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). + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:258 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:280 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:435 + def flush(minimum_idle = T.unsafe(nil)); end + + # Disconnect all currently idle connections. Connections currently checked + # out are unaffected. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:457 + def flush!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:164 + def lock_thread=(lock_thread); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:462 + def num_waiting_in_queue; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:110 + def pool_config; 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:412 + def reap; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:110 + def reaper; 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 + # #connection or #with_connection methods, connections obtained through + # #checkout will not be automatically released. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:207 + def release_connection(owner_thread = 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:380 + def remove(conn); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:110 + def role; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:483 + def schedule_query(future_result); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:112 + def schema_reflection(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:112 + def schema_reflection=(arg); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:110 + def shard; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:110 + 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 } + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:469 + def stat; 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 #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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:222 + def with_connection; 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:647 + def acquire_connection(checkout_timeout); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:716 + def adopt_connection(conn); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:541 + def attempt_to_checkout_all_existing_connections(raise_on_acquisition_timeout = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:489 + def build_async_executor; end + + # -- + # this is unfortunately not concurrent + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:507 + def bulk_make_new_connections(num_new_conns_needed); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:726 + def checkout_and_verify(c); end + + # -- + # Must be called in a synchronize block. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:587 + def checkout_for_exclusive_access(checkout_timeout); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:721 + def checkout_new_connection; end + + # -- + # From the discussion on GitHub: + # https://github.com/rails/rails/pull/14938#commitcomment-6601951 + # This hook-in method allows for easier monkey-patching fixes needed by + # JRuby users that use Fibers. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:522 + def connection_cache_key(thread); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:526 + def current_thread; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:675 + def new_connection; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:673 + def release(conn, owner_thread = T.unsafe(nil)); end + + # -- + # if owner_thread param is omitted, this must be called in synchronize block + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:670 + def remove_connection_from_thread_cache(conn, owner_thread = T.unsafe(nil)); end + + # If the pool is not at a @size limit, establish new connection. Connecting + # to the DB is done outside main synchronized section. + # -- + # Implementation constraint: a newly established connection returned by this + # method must be in the +.leased+ state. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:689 + def try_to_checkout_new_connection; 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:534 + def with_exclusively_acquired_all_connections(raise_on_acquisition_timeout = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:607 + def with_new_connections_blocked; end +end + +# Adds the ability to turn a basic fair FIFO queue into one +# biased to some thread. +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:138 +module ActiveRecord::ConnectionAdapters::ConnectionPool::BiasableQueue + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:178 + def with_a_bias_for(thread); end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:139 +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 + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:142 + def initialize(lock, other_cond, preferred_thread); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:149 + def broadcast; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:154 + def broadcast_on_biased; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:159 + def signal; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:168 + 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. +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:199 +class ActiveRecord::ConnectionAdapters::ConnectionPool::ConnectionLeasingQueue < ::ActiveRecord::ConnectionAdapters::ConnectionPool::Queue + include ::ActiveRecord::ConnectionAdapters::ConnectionPool::BiasableQueue + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:203 + def internal_poll(timeout); end +end + +# = Active Record Connection Pool \Queue +# +# Threadsafe, fair, LIFO queue. Meant to be used by ConnectionPool +# with which it shares a Monitor. +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:13 +class ActiveRecord::ConnectionAdapters::ConnectionPool::Queue + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:14 + def initialize(lock = T.unsafe(nil)); end + + # Add +element+ to the queue. Never blocks. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:37 + def add(element); end + + # Test if any threads are currently waiting on the queue. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:22 + def any_waiting?; end + + # Remove all elements from the queue. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:52 + def clear; end + + # If +element+ is in the queue, remove and return it, or +nil+. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:45 + def delete(element); end + + # Returns the number of threads currently waiting on this + # queue. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:30 + 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, + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:72 + def poll(timeout = T.unsafe(nil)); end + + private + + # Test if the queue currently contains any elements. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:86 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:94 + def can_remove_no_wait?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:77 + 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+. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:106 + def no_wait_poll; end + + # Removes and returns the head of the queue if possible, or +nil+. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:99 + def remove; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:81 + def synchronize(&block); end + + # Waits on the queue up to +timeout+ seconds, then removes and + # returns the head of the queue. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:112 + def wait_poll(timeout); end +end + +# = Active Record Connection Pool \Reaper +# +# Every +frequency+ seconds, the reaper will call +reap+ and +flush+ on +# +pool+. A reaper instantiated with a zero frequency will never reap +# the connection pool. +# +# Configure the frequency by setting +reaping_frequency+ in your database +# YAML file (default 60 seconds). +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb:17 +class ActiveRecord::ConnectionAdapters::ConnectionPool::Reaper + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb:20 + def initialize(pool, frequency); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb:18 + def frequency; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb:18 + def pool; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb:71 + def run; end + + class << self + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb:30 + def register_pool(pool, frequency); end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb:41 + def spawn_thread(frequency); end + end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:120 +class ActiveRecord::ConnectionAdapters::CreateIndexDefinition < ::Struct + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:120 + def algorithm; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:120 + def algorithm=(_); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:120 + def if_not_exists; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:120 + def if_not_exists=(_); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:120 + def index; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:120 + def index=(_); end + + class << self + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:120 + def [](*_arg0); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:120 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:120 + def keyword_init?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:120 + def members; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:120 + def new(*_arg0); end + end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_limits.rb:5 +module ActiveRecord::ConnectionAdapters::DatabaseLimits + # Returns the maximum length of an index name. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_limits.rb:21 + def index_name_length; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_limits.rb:6 + def max_identifier_length; end + + # Returns the maximum length of a table alias. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_limits.rb:16 + def table_alias_length; end + + # Returns the maximum length of a table name. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_limits.rb:11 + def table_name_length; end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_limits.rb:26 + def bind_params_length; end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:5 +module ActiveRecord::ConnectionAdapters::DatabaseStatements + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:390 + def add_transaction_record(record, ensure_finalize = T.unsafe(nil)); end + + # Begins the transaction (and turns off auto-committing). + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:395 + def begin_db_transaction; 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:409 + def begin_isolated_db_transaction(isolation); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:352 + def begin_transaction(*, **, &); end + + # This is used in the StatementCache object. It returns an object that + # can be used to query the database repeatedly. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:54 + def cacheable_query(klass, arel); end + + # Commits the transaction (and turns on auto-committing). + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:414 + def commit_db_transaction; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:352 + def commit_transaction(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:197 + 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 + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:352 + def current_transaction(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:436 + def default_sequence_name(table, column); end + + # Executes the delete statement and returns the number of rows affected. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:206 + def delete(arel, name = T.unsafe(nil), binds = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:352 + def dirty_current_transaction(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:352 + def disable_lazy_transactions!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:468 + def empty_insert_statement_value(primary_key = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:352 + def enable_lazy_transactions!(*, **, &); 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:159 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:151 + 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 + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:170 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:141 + def exec_query(sql, name = T.unsafe(nil), binds = T.unsafe(nil), prepare: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:430 + def exec_restart_db_transaction; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:424 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:166 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:130 + def execute(sql, name = T.unsafe(nil), allow_retry: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:174 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:506 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:189 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:450 + def insert_fixture(fixture, table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:454 + def insert_fixtures_set(fixture_set, tables_to_delete = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:510 + def internal_exec_query(sql, name = T.unsafe(nil), binds = T.unsafe(nil), prepare: T.unsafe(nil), async: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:357 + def mark_transaction_written_if_write(sql); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:352 + def materialize_transactions(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:352 + def open_transactions(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:107 + def query(sql, name = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:99 + def query_value(sql, name = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:103 + def query_values(sql, name = T.unsafe(nil)); end + + # Set the sequence to the max value of the table's column. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:441 + def reset_sequence!(table, column, sequence = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:368 + def reset_transaction(restore: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:426 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:418 + def rollback_db_transaction; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:432 + def rollback_to_savepoint(name = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:352 + def rollback_transaction(*, **, &); end + + # Sanitizes the given LIMIT parameter in order to prevent SQL injection. + # + # The +limit+ may be anything that can evaluate to a string via #to_s. It + # should look like an integer, or an Arel SQL literal. + # + # Returns Integer and Arel::Nodes::SqlLiteral limits as is. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:478 + def sanitize_limit(limit); end + + # Returns an ActiveRecord::Result instance. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:67 + def select_all(arel, name = T.unsafe(nil), binds = T.unsafe(nil), preparable: T.unsafe(nil), async: T.unsafe(nil)); end + + # Returns a record hash with the column names as keys and column values + # as values. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:78 + 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+. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:95 + def select_rows(arel, name = T.unsafe(nil), binds = T.unsafe(nil), async: T.unsafe(nil)); end + + # Returns a single value from a record + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:83 + 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] + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:89 + def select_values(arel, name = T.unsafe(nil), binds = T.unsafe(nil)); end + + # Converts an arel AST to SQL + # + # pkg:gem/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. + # + # == 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.connection.transaction do # BEGIN + # Model.connection.transaction(requires_new: true) do # CREATE SAVEPOINT active_record_1 + # Model.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) + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:337 + def transaction(requires_new: T.unsafe(nil), isolation: T.unsafe(nil), joinable: T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:397 + def transaction_isolation_levels; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:350 + def transaction_manager; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:364 + def transaction_open?; end + + # Executes the truncate statement. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:212 + def truncate(table_name, name = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:216 + def truncate_tables(*table_names); end + + # Executes the update statement and returns the number of rows affected. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:200 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:489 + def with_yaml_fallback(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:352 + def within_new_transaction(*, **, &); end + + # Determines whether the SQL statement is a write query. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:112 + def write_query?(sql); end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:668 + def arel_from_relation(relation); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:541 + def build_fixture_sql(fixtures, table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:583 + def build_fixture_statements(fixture_set); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:590 + def build_truncate_statement(table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:594 + def build_truncate_statements(table_names); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:604 + def combine_multi_statements(total_sql); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:537 + def default_insert_value(column); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:524 + def execute_batch(statements, name = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:676 + def extract_table_ref_from_insert_sql(sql); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:515 + def internal_execute(sql, name = T.unsafe(nil), allow_retry: T.unsafe(nil), materialize_transactions: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:655 + def last_inserted_id(result); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:530 + def raw_execute(sql, name, async: T.unsafe(nil), allow_retry: T.unsafe(nil), materialize_transactions: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:659 + def returning_column_values(result); end + + # Returns an ActiveRecord::Result instance. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:609 + def select(sql, name = T.unsafe(nil), binds = T.unsafe(nil), prepare: T.unsafe(nil), async: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:663 + def single_value_from_rows(rows); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:638 + def sql_for_insert(sql, pk, binds, returning); end + + # pkg:gem/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)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:600 + def with_multi_statements; end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:534 +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 +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/database_statements.rb:498 +ActiveRecord::ConnectionAdapters::DatabaseStatements::HIGH_PRECISION_CURRENT_TIMESTAMP = T.let(T.unsafe(nil), Arel::Nodes::SqlLiteral) + +# pkg:gem/activerecord#lib/active_record/connection_adapters/deduplicable.rb:5 +module ActiveRecord::ConnectionAdapters::Deduplicable + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::ConnectionAdapters::Deduplicable::ClassMethods + + # pkg:gem/activerecord#lib/active_record/connection_adapters/deduplicable.rb:21 + def -@; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/deduplicable.rb:18 + def deduplicate; end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/deduplicable.rb:24 + def deduplicated; end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/deduplicable.rb:8 +module ActiveRecord::ConnectionAdapters::Deduplicable::ClassMethods + # pkg:gem/activerecord#lib/active_record/connection_adapters/deduplicable.rb:13 + def new(*, **); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/deduplicable.rb:9 + def registry; end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:124 +class ActiveRecord::ConnectionAdapters::ForeignKeyDefinition < ::Struct + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:129 + def column; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:149 + def custom_primary_key?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:145 + def deferrable; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:162 + def defined_for?(to_table: T.unsafe(nil), validate: T.unsafe(nil), **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:158 + def export_name_on_schema_dump?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:124 + def from_table; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:124 + def from_table=(_); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:125 + def name; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:137 + def on_delete; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:141 + def on_update; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:124 + def options; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:124 + def options=(_); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:133 + def primary_key; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:124 + def to_table; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:124 + def to_table=(_); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:153 + def validate?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:156 + def validated?; end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:169 + def default_primary_key; end + + class << self + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:124 + def [](*_arg0); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:124 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:124 + def keyword_init?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:124 + def members; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:124 + 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 +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:9 +class ActiveRecord::ConnectionAdapters::IndexDefinition + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:12 + 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 + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:47 + def column_options; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:10 + def columns; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:10 + def comment; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:55 + 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 + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:10 + def include; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:10 + def lengths; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:10 + def name; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:10 + def nulls_not_distinct; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:10 + def opclasses; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:10 + def orders; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:10 + def table; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:10 + def type; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:10 + def unique; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:10 + def using; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:10 + def valid; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:43 + def valid?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:10 + def where; end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:66 + def concise_options(options); end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:115 +class ActiveRecord::ConnectionAdapters::NullColumn < ::ActiveRecord::ConnectionAdapters::Column + # pkg:gem/activerecord#lib/active_record/connection_adapters/column.rb:116 + def initialize(name, **); end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:15 +class ActiveRecord::ConnectionAdapters::NullPool + include ::ActiveRecord::ConnectionAdapters::AbstractPool + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:32 + def async_executor; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:30 + def checkin(_); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:29 + def connection_class; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:33 + def db_config; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:31 + def remove(_); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:25 + def schema_reflection; end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:23 +ActiveRecord::ConnectionAdapters::NullPool::NULL_CONFIG = T.let(T.unsafe(nil), ActiveRecord::ConnectionAdapters::NullPool::NullConfig) + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:18 +class ActiveRecord::ConnectionAdapters::NullPool::NullConfig + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/connection_pool.rb:19 + def method_missing(*); end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:106 +class ActiveRecord::ConnectionAdapters::NullTransaction + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:107 + def initialize; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:112 + def add_record(record, _ = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:109 + def closed?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:115 + def dirty!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:114 + def dirty?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:117 + def invalidate!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:116 + def invalidated?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:111 + def joinable?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:110 + def open?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:113 + def restartable?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:108 + def state; end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:5 +class ActiveRecord::ConnectionAdapters::PoolConfig + include ::Mutex_m + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:29 + def initialize(connection_class, db_config, role, shard); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:10 + def connection_class; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:10 + def connection_class=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:39 + def connection_name; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:8 + def db_config; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:68 + def discard_pool!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:47 + def disconnect!(automatic_reconnect: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:6 + def lock; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:6 + def locked?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:62 + def pool; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:8 + def role; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:12 + def schema_reflection; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:9 + def schema_reflection=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:8 + def shard; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:6 + def synchronize(&block); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:6 + def try_lock; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:6 + def unlock; end + + class << self + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:20 + def discard_pools!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:24 + def disconnect_all!; end + end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/pool_config.rb:16 +ActiveRecord::ConnectionAdapters::PoolConfig::INSTANCES = T.let(T.unsafe(nil), ObjectSpace::WeakMap) + +# pkg:gem/activerecord#lib/active_record/connection_adapters/pool_manager.rb:5 +class ActiveRecord::ConnectionAdapters::PoolManager + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_manager.rb:6 + def initialize; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_manager.rb:26 + def each_pool_config(role = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_manager.rb:44 + def get_pool_config(role, shard); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_manager.rb:18 + def pool_configs(role = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_manager.rb:40 + def remove_pool_config(role, shard); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_manager.rb:36 + def remove_role(role); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_manager.rb:14 + def role_names; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_manager.rb:48 + def set_pool_config(role, shard, pool_config); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/pool_manager.rb:10 + def shard_names; end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:122 +class ActiveRecord::ConnectionAdapters::PrimaryKeyDefinition < ::Struct + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:122 + def name; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:122 + def name=(_); end + + class << self + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:122 + def [](*_arg0); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:122 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:122 + def keyword_init?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:122 + def members; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:122 + def new(*_arg0); end + end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:7 +module ActiveRecord::ConnectionAdapters::QueryCache + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:55 + def initialize(*); end + + # Enable the query cache within the block. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:63 + def cache; 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:94 + def clear_query_cache; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:75 + def disable_query_cache!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:71 + def enable_query_cache!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:53 + def query_cache; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:53 + def query_cache_enabled; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:100 + def select_all(arel, name = T.unsafe(nil), binds = T.unsafe(nil), preparable: T.unsafe(nil), async: T.unsafe(nil)); end + + # Disable the query cache within the block. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:81 + def uncached; end + + private + + # Database adapters can override this method to + # provide custom cache information. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:171 + def cache_notification_info(sql, name, binds); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:142 + def cache_sql(sql, name, binds); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:182 + def configure_query_cache!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:120 + def lookup_sql_cache(sql, name, binds); end + + class << self + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:20 + def dirties_query_cache(base, *method_names); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:11 + def included(base); end + end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:32 +module ActiveRecord::ConnectionAdapters::QueryCache::ConnectionPoolConfiguration + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:33 + def initialize(*); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:43 + def disable_query_cache!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:38 + def enable_query_cache!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:48 + def query_cache_enabled; end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/query_cache.rb:8 +ActiveRecord::ConnectionAdapters::QueryCache::DEFAULT_SIZE = T.let(T.unsafe(nil), Integer) + +# = Active Record Connection Adapters \Quoting +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:9 +module ActiveRecord::ConnectionAdapters::Quoting + # 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:69 + def cast_bound_value(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:180 + def column_name_matcher; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:184 + def column_name_with_order_matcher; end + + # If you are having to call this function, you are likely doing something + # wrong. The column does not have sufficient type information if the user + # provided a custom type on the class level either explicitly (via + # Attributes::ClassMethods#attribute) or implicitly (via + # AttributeMethods::Serialization::ClassMethods#serialize, +time_zone_aware_attributes+). + # In almost all cases, the sql type should only be used to change quoting behavior, when the primitive to + # represent the type doesn't sufficiently reflect the differences + # (varchar vs binary) for example. The type used to get this primitive + # should have been provided before reaching the connection adapter. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:82 + def lookup_cast_type_from_column(column); end + + # Quotes the column value to help prevent + # {SQL injection attacks}[https://en.wikipedia.org/wiki/SQL_injection]. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:12 + def quote(value); end + + # Quote 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. + # + # Deprecated: Consider `Arel.sql("... ? ...", value)` or + # +sanitize_sql+ instead. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:57 + def quote_bound_value(value); end + + # Quotes the column name. Defaults to no quoting. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:93 + def quote_column_name(column_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:114 + def quote_default_expression(value, column); end + + # Quotes a string, escaping any ' (single quote) and \ (backslash) + # characters. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:88 + def quote_string(s); end + + # Quotes the table name. Defaults to column name quoting. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:98 + 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). + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:110 + def quote_table_name_for_assignment(table, attr); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:163 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:141 + def quoted_date(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:131 + def quoted_false; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:158 + def quoted_time(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:123 + def quoted_true; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:167 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:36 + def type_cast(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:135 + def unquoted_false; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:127 + def unquoted_true; end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:244 + def lookup_cast_type(sql_type); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:234 + def type_casted_binds(binds); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:248 + def warn_quote_duration_deprecated; end +end + +# Regexp for column names (with or without a table name prefix). +# Matches the following: +# +# "#{table_name}.#{column_name}" +# "#{column_name}" +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:193 +ActiveRecord::ConnectionAdapters::Quoting::COLUMN_NAME = T.let(T.unsafe(nil), Regexp) + +# 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" +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/quoting.rb:217 +ActiveRecord::ConnectionAdapters::Quoting::COLUMN_NAME_WITH_ORDER = T.let(T.unsafe(nil), Regexp) + +# = Active Record Real \Transaction +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:368 +class ActiveRecord::ConnectionAdapters::RealTransaction < ::ActiveRecord::ConnectionAdapters::Transaction + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:399 + def commit; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:369 + def materialize!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:379 + def restart; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:393 + def rollback; end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:195 +class ActiveRecord::ConnectionAdapters::ReferenceDefinition + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:196 + def initialize(name, polymorphic: T.unsafe(nil), index: T.unsafe(nil), foreign_key: T.unsafe(nil), type: T.unsafe(nil), **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:216 + def add(table_name, connection); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:230 + def add_to(table); end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:247 + def as_options(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:285 + def column_name; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:289 + def column_names; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:277 + def columns; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:251 + def conditional_options; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:245 + def foreign_key; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:273 + def foreign_key_options; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:293 + def foreign_table_name; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:245 + def index; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:263 + def index_options(table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:245 + def name; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:245 + def options; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:245 + def polymorphic; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:259 + def polymorphic_index_name(table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:255 + def polymorphic_options; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:245 + def type; end +end + +# = Active Record Restart Parent \Transaction +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:295 +class ActiveRecord::ConnectionAdapters::RestartParentTransaction < ::ActiveRecord::ConnectionAdapters::Transaction + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:296 + def initialize(connection, parent_transaction, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:315 + def commit; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:319 + def full_rollback?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:308 + def materialize!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:308 + def materialized?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:308 + def restart(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:310 + def rollback; end +end + +# = Active Record Savepoint \Transaction +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:323 +class ActiveRecord::ConnectionAdapters::SavepointTransaction < ::ActiveRecord::ConnectionAdapters::Transaction + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:324 + def initialize(connection, savepoint_name, parent_transaction, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:358 + def commit; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:364 + def full_rollback?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:336 + def materialize!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:341 + def restart; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:350 + def rollback; end +end + +# = Active Record Connection Adapters \Savepoints +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/savepoints.rb:6 +module ActiveRecord::ConnectionAdapters::Savepoints + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/savepoints.rb:11 + def create_savepoint(name = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/savepoints.rb:7 + def current_savepoint_name; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/savepoints.rb:15 + def exec_rollback_to_savepoint(name = T.unsafe(nil)); end + + # pkg:gem/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 +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:221 +class ActiveRecord::ConnectionAdapters::SchemaCache + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:261 + def initialize; end + + # Add internal cache for table with +table_name+. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:325 + def add(connection, table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:398 + def add_all(connection); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:303 + def cached?(table_name); end + + # Clear out internal caches for the data source +name+. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:390 + def clear_data_source_cache!(_connection, name); end + + # Get the columns for a table + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:340 + def columns(connection, table_name); end + + # Get the columns for a table as a hash, key is the column name + # value is the column object. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:352 + def columns_hash(connection, table_name); end + + # Checks whether the columns hash is already cached for a table. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:359 + def columns_hash?(connection, table_name); end + + # A cached lookup for table existence. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:316 + def data_source_exists?(connection, name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:334 + def data_sources(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:373 + def database_version(connection); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:407 + def dump_to(filename); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:280 + def encode_with(coder); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:363 + def indexes(connection, table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:289 + def init_with(coder); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:417 + def marshal_dump; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:421 + def marshal_load(array); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:307 + def primary_keys(connection, table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:381 + def schema_version; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:385 + def size; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:377 + def version(connection); end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:449 + def deep_deduplicate(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:441 + def derive_columns_hash_and_deduplicate_values; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:435 + def ignored_table?(table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:271 + def initialize_dup(other); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:468 + def open(filename); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:462 + def prepare_data_sources(connection); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:429 + def tables_to_cache(connection); end + + class << self + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:234 + def _load_from(filename); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:228 + def load_from(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:223 + def new(*args, **, &block); end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:250 + def read(filename, &block); end + end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:5 +class ActiveRecord::ConnectionAdapters::SchemaCreation + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:6 + def initialize(conn); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:11 + def accept(o); end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:176 + def action_sql(action, dependency); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:151 + def add_column_options!(sql, options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:142 + def add_table_options!(create_sql, o); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:147 + def column_options(o); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:16 + def options_include_default?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:16 + def quote_column_name(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:16 + def quote_default_expression(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:16 + def quote_table_name(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:134 + def quoted_columns(o); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:16 + def quoted_columns_for_index(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:16 + def supports_check_constraints?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:16 + def supports_exclusion_constraints?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:16 + def supports_index_include?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:138 + def supports_index_using?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:16 + def supports_indexes_in_create?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:16 + def supports_nulls_not_distinct?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:16 + def supports_partial_index?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:16 + def supports_unique_constraints?(*, **, &); end + + # Returns any SQL string to go between CREATE and TABLE. May be nil. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:172 + def table_modifier_in_create(o); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:166 + def to_sql(sql); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:16 + def type_to_sql(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:16 + def use_foreign_keys?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:126 + def visit_AddCheckConstraint(o); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:40 + def visit_AddColumnDefinition(o); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:95 + def visit_AddForeignKey(o); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:24 + def visit_AlterTable(o); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:122 + def visit_CheckConstraintDefinition(o); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:33 + def visit_ColumnDefinition(o); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:103 + def visit_CreateIndexDefinition(o); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:130 + def visit_DropCheckConstraint(name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:99 + def visit_DropForeignKey(name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:82 + def visit_ForeignKeyDefinition(o); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:78 + def visit_PrimaryKeyDefinition(o); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_creation.rb:44 + def visit_TableDefinition(o); end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_dumper.rb:5 +class ActiveRecord::ConnectionAdapters::SchemaDumper < ::ActiveRecord::SchemaDumper + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_dumper.rb:13 + def column_spec(column); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_dumper.rb:17 + def column_spec_for_primary_key(column); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_dumper.rb:38 + def default_primary_key?(column); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_dumper.rb:42 + def explicit_primary_key_default?(column); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_dumper.rb:25 + def prepare_column_options(column); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_dumper.rb:101 + def schema_collation(column); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_dumper.rb:86 + def schema_default(column); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_dumper.rb:97 + def schema_expression(column); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_dumper.rb:62 + def schema_limit(column); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_dumper.rb:67 + def schema_precision(column); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_dumper.rb:82 + def schema_scale(column); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_dumper.rb:54 + def schema_type(column); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_dumper.rb:46 + def schema_type_with_virtual(column); end + + class << self + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_dumper.rb:8 + def create(connection, options); end + end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_dumper.rb:6 +ActiveRecord::ConnectionAdapters::SchemaDumper::DEFAULT_DATETIME_PRECISION = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:7 +class ActiveRecord::ConnectionAdapters::SchemaReflection + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:16 + def initialize(cache_path, cache = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:45 + def add(connection, name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:87 + def cached?(table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:25 + def clear!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:81 + def clear_data_source_cache!(connection, name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:53 + def columns(connection, table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:57 + def columns_hash(connection, table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:61 + def columns_hash?(connection, table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:41 + def data_source_exists?(connection, name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:49 + def data_sources(connection, name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:69 + def database_version(connection); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:99 + def dump_to(connection, filename); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:65 + def indexes(connection, table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:31 + def load!(connection); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:37 + def primary_keys(connection, table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:21 + def set_schema_cache(cache); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:77 + def size(connection); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:73 + def version(connection); end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:114 + def cache(connection); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:108 + def empty_cache; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:124 + def load_cache(connection); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:118 + def possible_cache_available?; end + + class << self + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:10 + def check_schema_cache_dump_version; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:10 + def check_schema_cache_dump_version=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:9 + def use_schema_cache_dump; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/schema_cache.rb:9 + def use_schema_cache_dump=(_arg0); end + end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:8 +module ActiveRecord::ConnectionAdapters::SchemaStatements + include ::ActiveRecord::Migration::JoinTable + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1033 + 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+. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1260 + 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 migrations 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) + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:620 + def add_column(table_name, column_name, type, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:627 + 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+. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1140 + 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 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) + # + # Note: only supported by PostgreSQL. + # + # Concurrently adding an index is not supported in a transaction. + # + # For more information see the {"Transactional Migrations" section}[rdoc-ref:Migration]. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:886 + def add_index(table_name, column_name, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1436 + 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 }) + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1030 + 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) + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1419 + def add_timestamps(table_name, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1325 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:638 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:722 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:896 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:394 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:328 + def build_create_table_definition(table_name, id: T.unsafe(nil), primary_key: T.unsafe(nil), force: T.unsafe(nil), **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1515 + 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) + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:695 + 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") + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1497 + 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") + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:713 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:742 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:496 + 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") + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1487 + 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") + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1309 + def check_constraint_exists?(table_name, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1272 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1240 + 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) + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:132 + 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+. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:107 + 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"]) + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1385 + 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) + # + # You can pass an +options+ hash which can include the following keys: + # [:table_name] + # Sets the table name, overriding the default. + # [:column_options] + # Any extra options you want appended to the columns definition. + # [: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 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 + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:375 + def create_join_table(table_1, table_2, column_options: T.unsafe(nil), **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1501 + 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. + # [: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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:293 + 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) + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:44 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:34 + def data_sources; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1389 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:413 + def drop_join_table(table_1, table_2, **options); end + + # Drops a table 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:526 + def drop_table(table_name, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1316 + def dump_schema_information; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1208 + 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") + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1204 + def foreign_key_exists?(from_table, to_table = T.unsafe(nil), **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1213 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1070 + def foreign_keys(table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1464 + 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) + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:102 + def index_exists?(table_name, column_name, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:963 + def index_name(table_name, options); end + + # Verifies the existence of an index with a given name. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:978 + def index_name_exists?(table_name, index_name); end + + # Returns an array of indexes for the given table. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:81 + def indexes(table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1321 + def internal_string_options_for_primary_key; end + + # Returns the maximum length of an index name in bytes. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1553 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:14 + def native_database_types; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1477 + def options_include_default?(options); end + + # Returns just a table's primary key + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:145 + def primary_key(table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1470 + def quoted_columns_for_index(column_names, options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1066 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1291 + 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 used. + # + # remove_column(:suppliers, :qualification, if_exists: true) + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:683 + 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) + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:659 + def remove_columns(table_name, *column_names, type: T.unsafe(nil), **options); 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1181 + 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]. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:937 + 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) + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1049 + 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) + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1428 + def remove_timestamps(table_name, **options); end + + # Renames a column. + # + # rename_column(:suppliers, :description, :name) + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:750 + 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' + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:951 + def rename_index(table_name, old_name, new_name); end + + # Renames a table. + # + # rename_table('octopuses', 'octopi') + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:510 + def rename_table(table_name, new_name, **); end + + # Returns an instance of SchemaCreation, which can be used to visit a schema definition + # object and return DDL. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1511 + def schema_creation; end + + # Truncates a table alias according to the limits of the current adapter. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:28 + def table_alias_for(table_name); end + + # Returns the table comment that's stored in database metadata. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:23 + def table_comment(table_name); end + + # Checks to see if the table +table_name+ exists on the database. + # + # table_exists?(:developers) + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:59 + def table_exists?(table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:18 + def table_options(table_name); end + + # Returns an array of table names defined in the database. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:51 + def tables; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1345 + def type_to_sql(type, limit: T.unsafe(nil), precision: T.unsafe(nil), scale: T.unsafe(nil), **); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1432 + def update_table_definition(table_name, base); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1505 + def use_foreign_keys?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1544 + def valid_column_definition_options; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1548 + def valid_primary_key_options; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1540 + def valid_table_definition_options; end + + # Checks to see if the view +view_name+ exists on the database. + # + # view_exists?(:ebooks) + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:74 + def view_exists?(view_name); end + + # Returns an array of view names defined in the database. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:66 + def views; end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1797 + def add_column_for_alter(table_name, column_name, type, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1582 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1599 + def add_options_for_index_columns(quoted_columns, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1820 + def add_timestamps_for_alter(table_name, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1789 + def can_remove_index_by_name?(column_name, options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1803 + def change_column_default_for_alter(table_name, column_name, default_or_changes); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1757 + def check_constraint_for(table_name, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1763 + def check_constraint_for!(table_name, expression: T.unsafe(nil), **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1747 + def check_constraint_name(table_name, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1578 + def column_options_keys; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1665 + def create_alter_table(name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1661 + def create_table_definition(name, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1850 + def data_source_sql(name = T.unsafe(nil), type: T.unsafe(nil)); end + + # Try to identify whether the given column name is an expression + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1705 + def expression_column_name?(column_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1735 + def extract_foreign_key_action(specifier); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1787 + def extract_new_comment_value(default_or_changes); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1780 + def extract_new_default_value(default_or_changes); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1677 + def fetch_type_metadata(sql_type); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1725 + def foreign_key_for(from_table, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1730 + def foreign_key_for!(from_table, to_table: T.unsafe(nil), **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1715 + def foreign_key_name(table_name, options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1743 + def foreign_keys_enabled?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1558 + def generate_index_name(table_name, column); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1688 + def index_column_names(column_names); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1607 + def index_name_for_remove(table_name, column_name, options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1696 + def index_name_options(column_names); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1837 + def insert_versions_sql(versions); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1589 + def options_for_index_columns(options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1854 + def quoted_scope(name = T.unsafe(nil), type: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1793 + def reference_name_for_table(table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1812 + def remove_column_for_alter(table_name, column_name, type = T.unsafe(nil), **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1816 + def remove_columns_for_alter(table_name, *column_names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1833 + def remove_timestamps_for_alter(table_name, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1648 + def rename_column_indexes(table_name, column_name, new_column_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1808 + def rename_column_sql(table_name, column_name, new_column_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1639 + def rename_table_indexes(table_name, new_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1709 + def strip_table_name_prefix_and_suffix(table_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1572 + def validate_change_column_null_argument!(value); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1669 + def validate_create_table_options!(options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1768 + def validate_index_length!(table_name, new_name, internal = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_statements.rb:1774 + def validate_table_length!(table_name); end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/sql_type_metadata.rb:6 +class ActiveRecord::ConnectionAdapters::SqlTypeMetadata + include ::ActiveRecord::ConnectionAdapters::Deduplicable + extend ::ActiveRecord::ConnectionAdapters::Deduplicable::ClassMethods + + # pkg:gem/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 + + # pkg:gem/activerecord#lib/active_record/connection_adapters/sql_type_metadata.rb:19 + def ==(other); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/sql_type_metadata.rb:27 + def eql?(other); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/sql_type_metadata.rb:29 + def hash; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/sql_type_metadata.rb:9 + def limit; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/sql_type_metadata.rb:9 + def precision; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/sql_type_metadata.rb:9 + def scale; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/sql_type_metadata.rb:9 + def sql_type; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/sql_type_metadata.rb:9 + def type; end + + private + + # pkg:gem/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 +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:706 +class ActiveRecord::ConnectionAdapters::Table + include ::ActiveRecord::ConnectionAdapters::ColumnMethods + extend ::ActiveRecord::ConnectionAdapters::ColumnMethods::ClassMethods + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:711 + def initialize(table_name, base); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:868 + def belongs_to(*args, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def bigint(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def binary(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:324 + def blob(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def boolean(*names, **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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:788 + 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] + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:800 + 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] + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:810 + 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] + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:920 + 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?] + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:940 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:721 + 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?] + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:735 + def column_exists?(column_name, type = T.unsafe(nil), **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def date(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def datetime(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def decimal(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def float(*names, **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] + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:890 + 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?] + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:911 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:747 + 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?] + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:759 + def index_exists?(column_name, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def integer(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def json(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:709 + def name; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:325 + def numeric(*names, **options); 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:862 + 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] + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:820 + def remove(*column_names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:882 + 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] + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:929 + 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] + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:901 + 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] + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:833 + 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] + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:876 + 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] + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:843 + def remove_timestamps(**options); end + + # Renames a column. + # + # t.rename(:description, :name) + # + # See {connection.rename_column}[rdoc-ref:SchemaStatements#rename_column] + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:852 + 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] + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:768 + def rename_index(index_name, new_index_name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def string(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def text(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def time(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def timestamp(*names, **options); 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] + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:777 + def timestamps(**options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def virtual(*names, **options); end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:945 + 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[7.1] +# def up +# create_table :foo do |t| +# puts t.class # => "ActiveRecord::ConnectionAdapters::TableDefinition" +# end +# end +# +# def down +# ... +# end +# end +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:363 +class ActiveRecord::ConnectionAdapters::TableDefinition + include ::ActiveRecord::ConnectionAdapters::ColumnMethods + extend ::ActiveRecord::ConnectionAdapters::ColumnMethods::ClassMethods + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:368 + 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), **); end + + # Returns a ColumnDefinition for the column with name +name+. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:418 + def [](name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:366 + def as; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:553 + def belongs_to(*args, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def bigint(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def binary(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:324 + def blob(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def boolean(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:522 + def check_constraint(expression, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:366 + 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 + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:489 + def column(name, type, index: T.unsafe(nil), **options); end + + # Returns an array of ColumnDefinition objects for the columns of the table. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:415 + def columns; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:366 + def comment; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def date(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def datetime(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def decimal(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def float(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:518 + def foreign_key(to_table, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:366 + def foreign_keys; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:366 + 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') + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:514 + def index(column_name, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:366 + def indexes; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def integer(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def json(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:366 + def name; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:580 + def new_check_constraint_definition(expression, options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:555 + def new_column_definition(name, type, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:572 + def new_foreign_key_definition(to_table, options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:325 + def numeric(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:366 + def options; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:409 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:548 + def references(*args, **options); end + + # remove the column +name+ from the table. + # remove_column(:account_id) + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:506 + def remove_column(name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:392 + def set_primary_key(table_name, id, primary_key, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def string(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:366 + def temporary; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def text(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def time(*names, **options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def timestamp(*names, **options); 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 + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:530 + def timestamps(**options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:331 + def virtual(*names, **options); end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:598 + def aliased_types(name, fallback); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:590 + def create_column_definition(name, type, options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:602 + def integer_like_primary_key?(type, options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:606 + def integer_like_primary_key_type(type, options); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:610 + def raise_on_duplicate_column(name); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/schema_definitions.rb:586 + def valid_column_definition_options; end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:120 +class ActiveRecord::ConnectionAdapters::Transaction + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:126 + def initialize(connection, isolation: T.unsafe(nil), joinable: T.unsafe(nil), run_commit_callbacks: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:147 + def add_record(record, ensure_finalize = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:208 + def before_commit_records; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:251 + def closed?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:228 + def commit_records; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:121 + def connection; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:139 + def dirty!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:143 + def dirty?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:249 + def full_rollback?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:171 + def incomplete!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:124 + def invalidate!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:124 + def invalidated?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:121 + def isolation_level; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:250 + def joinable?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:175 + def materialize!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:180 + def materialized?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:252 + def open?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:157 + def records; end + + # Can this transaction's current state be recreated by + # rollback+begin ? + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:167 + def restartable?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:184 + def restore!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:192 + def rollback_records; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:121 + def savepoint_name; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:121 + def state; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:122 + def written; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:122 + def written=(_arg0); end + + private + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:267 + def prepare_instances_to_run_callbacks_on(records); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:259 + def run_action_on_records(records, instances_to_run_callbacks_on); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:255 + def unique_records; end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:77 +class ActiveRecord::ConnectionAdapters::TransactionInstrumenter + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:78 + def initialize(payload = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:97 + def finish(outcome); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:88 + def start; end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:86 +class ActiveRecord::ConnectionAdapters::TransactionInstrumenter::InstrumentationAlreadyStartedError < ::ActiveRecord::ActiveRecordError; end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:85 +class ActiveRecord::ConnectionAdapters::TransactionInstrumenter::InstrumentationNotStartedError < ::ActiveRecord::ActiveRecordError; end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:406 +class ActiveRecord::ConnectionAdapters::TransactionManager + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:407 + def initialize(connection); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:415 + def begin_transaction(isolation: T.unsafe(nil), joinable: T.unsafe(nil), _lazy: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:502 + def commit_transaction; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:588 + def current_transaction; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:470 + def dirty_current_transaction; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:457 + def disable_lazy_transactions!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:462 + def enable_lazy_transactions!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:466 + def lazy_transactions_enabled?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:486 + def materialize_transactions; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:584 + def open_transactions; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:482 + def restorable?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:474 + def restore_transactions; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:519 + def rollback_transaction(transaction = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:531 + def within_new_transaction(isolation: T.unsafe(nil), joinable: T.unsafe(nil)); end + + private + + # Deallocate invalidated prepared statements outside of the transaction + # + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:596 + def after_failure_actions(transaction, error); end +end + +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:593 +ActiveRecord::ConnectionAdapters::TransactionManager::NULL_TRANSACTION = T.let(T.unsafe(nil), ActiveRecord::ConnectionAdapters::NullTransaction) + +# = Active Record Connection Adapters Transaction State +# +# pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:6 +class ActiveRecord::ConnectionAdapters::TransactionState + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:7 + def initialize(state = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:12 + def add_child(state); end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:64 + def commit!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:21 + def committed?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:45 + def completed?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:17 + def finalized?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:68 + def full_commit!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:54 + def full_rollback!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:25 + def fully_committed?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:41 + def fully_completed?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:33 + def fully_rolledback?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:59 + def invalidate!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:37 + def invalidated?; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:72 + def nullify!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:49 + def rollback!; end + + # pkg:gem/activerecord#lib/active_record/connection_adapters/abstract/transaction.rb:29 + 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. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:555 +class ActiveRecord::ConnectionFailed < ::ActiveRecord::QueryAborted; end + +# = Active Record Connection Handling +# +# pkg:gem/activerecord#lib/active_record/connection_handling.rb:5 +module ActiveRecord::ConnectionHandling + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:319 + def clear_active_connections!(role = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:329 + def clear_all_connections!(role = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:315 + def clear_cache!; end + + # Clears the query cache for all connections associated with the current thread. + # + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:244 + def clear_query_caches_for_current_thread; end + + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:324 + def clear_reloadable_connections!(role = T.unsafe(nil)); end + + # Returns +true+ if Active Record is connected. + # + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:291 + 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 + # + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:134 + 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 + # + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:239 + def connected_to?(role:, shard: T.unsafe(nil)); 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 + # + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:163 + 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+. + # + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:185 + def connecting_to(role: T.unsafe(nil), shard: T.unsafe(nil), prevent_writes: 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. + # + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:253 + def connection; end + + # Returns the db_config object from the associated connection: + # + # ActiveRecord::Base.connection_db_config + # # + # + # Use only for reading. + # + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:278 + def connection_db_config; end + + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:282 + def connection_pool; end + + # Returns the connection specification name from the current class or its parent. + # + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:260 + def connection_specification_name; end + + # Returns the connection specification name from the current class or its parent. + # + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:257 + 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. + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:50 + def establish_connection(config_or_env = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:334 + def flush_idle_connections!(role = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:267 + 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. + # + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:197 + def prohibit_shard_swapping(enabled = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:295 + def remove_connection(name = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:286 + def retrieve_connection; end + + # Determine whether or not shard swapping is currently prohibited + # + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:206 + def shard_swapping_prohibited?; 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. + # + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:221 + def while_preventing_writes(enabled = T.unsafe(nil), &block); end + + private + + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:368 + def append_to_connected_to_stack(entry); end + + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:340 + def deprecation_for_delegation(method); end + + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:348 + def resolve_config_for_connection(config_or_env); end + + # pkg:gem/activerecord#lib/active_record/connection_handling.rb:357 + def with_role_and_shard(role, shard, prevent_writes); end +end + +# pkg:gem/activerecord#lib/active_record/connection_handling.rb:7 +ActiveRecord::ConnectionHandling::DEFAULT_ENV = T.let(T.unsafe(nil), Proc) + +# pkg:gem/activerecord#lib/active_record/connection_handling.rb:6 +ActiveRecord::ConnectionHandling::RAILS_ENV = T.let(T.unsafe(nil), Proc) + +# Raised when connection to the database could not been established (for example when +# {ActiveRecord::Base.connection=}[rdoc-ref:ConnectionHandling#connection] +# is given a +nil+ object). +# +# pkg:gem/activerecord#lib/active_record/errors.rb:71 +class ActiveRecord::ConnectionNotEstablished < ::ActiveRecord::AdapterError + # pkg:gem/activerecord#lib/active_record/errors.rb:72 + def initialize(message = T.unsafe(nil), connection_pool: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/errors.rb:76 + 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. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:88 +class ActiveRecord::ConnectionTimeoutError < ::ActiveRecord::ConnectionNotEstablished; end + +# = Active Record \Core +# +# pkg:gem/activerecord#lib/active_record/core.rb:10 +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') + # + # pkg:gem/activerecord#lib/active_record/core.rb:446 + def initialize(attributes = T.unsafe(nil)); end + + # Allows sort on objects + # + # pkg:gem/activerecord#lib/active_record/core.rb:633 + 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. + # + # pkg:gem/activerecord#lib/active_record/core.rb:599 + def ==(comparison_object); end + + # pkg:gem/activerecord#lib/active_record/core.rb:645 + def blank?; end + + # pkg:gem/activerecord#lib/active_record/core.rb:713 + 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, ... }} + # + # pkg:gem/activerecord#lib/active_record/core.rb:555 + def encode_with(coder); end + + # pkg:gem/activerecord#lib/active_record/core.rb:605 + 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. + # + # pkg:gem/activerecord#lib/active_record/core.rb:622 + def freeze; end + + # Returns +true+ if the attributes hash has been frozen. + # + # pkg:gem/activerecord#lib/active_record/core.rb:628 + def frozen?; 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) ] + # + # pkg:gem/activerecord#lib/active_record/core.rb:609 + def hash; 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' + # + # pkg:gem/activerecord#lib/active_record/core.rb:473 + 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. + # + # pkg:gem/activerecord#lib/active_record/core.rb:483 + def init_with_attributes(attributes, new_record = T.unsafe(nil)); end + + # Returns the contents of the record as a nicely formatted string. + # + # pkg:gem/activerecord#lib/active_record/core.rb:718 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/core.rb:641 + 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. + # + # pkg:gem/activerecord#lib/active_record/core.rb:736 + def pretty_print(pp); end + + # Marks this record as read only. + # + # customer = Customer.first + # customer.readonly! + # customer.save # Raises an ActiveRecord::ReadOnlyRecord + # + # pkg:gem/activerecord#lib/active_record/core.rb:709 + def readonly!; end + + # Returns +true+ if the record is read only. + # + # pkg:gem/activerecord#lib/active_record/core.rb:650 + def readonly?; end + + # Sets the record to strict_loading mode. This will raise an error + # if the record tries to lazily load an 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 + # + # pkg:gem/activerecord#lib/active_record/core.rb:688 + def strict_loading!(value = T.unsafe(nil), mode: T.unsafe(nil)); end + + # Returns +true+ if the record is in strict_loading mode. + # + # pkg:gem/activerecord#lib/active_record/core.rb:655 + def strict_loading?; end + + # pkg:gem/activerecord#lib/active_record/core.rb:697 + def strict_loading_mode; end + + # Returns +true+ if the record uses strict_loading with +:n_plus_one_only+ mode enabled. + # + # pkg:gem/activerecord#lib/active_record/core.rb:700 + def strict_loading_n_plus_one_only?; end + + private + + # pkg:gem/activerecord#lib/active_record/core.rb:793 + def custom_inspect_method_defined?; end + + # pkg:gem/activerecord#lib/active_record/core.rb:772 + def init_internals; end + + # pkg:gem/activerecord#lib/active_record/core.rb:525 + def initialize_dup(other); end + + # pkg:gem/activerecord#lib/active_record/core.rb:790 + def initialize_internals_callback; end + + # pkg:gem/activerecord#lib/active_record/core.rb:804 + 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 + # + # pkg:gem/activerecord#lib/active_record/core.rb:768 + 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 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 + 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 + +# pkg:gem/activerecord#lib/active_record/core.rb:238 +module ActiveRecord::Core::ClassMethods + # Returns an instance of +Arel::Table+ loaded with the current table name. + # + # pkg:gem/activerecord#lib/active_record/core.rb:364 + def arel_table; end + + # pkg:gem/activerecord#lib/active_record/core.rb:376 + def cached_find_by_statement(key, &block); end + + # Returns columns which shouldn't be exposed while calling +#inspect+. + # + # pkg:gem/activerecord#lib/active_record/core.rb:322 + def filter_attributes; end + + # Specifies columns which shouldn't be exposed while calling +#inspect+. + # + # pkg:gem/activerecord#lib/active_record/core.rb:331 + def filter_attributes=(filter_attributes); end + + # pkg:gem/activerecord#lib/active_record/core.rb:243 + def find(*ids); end + + # pkg:gem/activerecord#lib/active_record/core.rb:256 + def find_by(*args); end + + # pkg:gem/activerecord#lib/active_record/core.rb:303 + def find_by!(*args); end + + # pkg:gem/activerecord#lib/active_record/core.rb:311 + def generated_association_methods; end + + # pkg:gem/activerecord#lib/active_record/core.rb:239 + def initialize_find_by_cache; end + + # pkg:gem/activerecord#lib/active_record/core.rb:307 + def initialize_generated_modules; end + + # Returns a string like 'Post(id:integer, title:string, body:text)' + # + # pkg:gem/activerecord#lib/active_record/core.rb:348 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/core.rb:336 + def inspection_filter; end + + # pkg:gem/activerecord#lib/active_record/core.rb:368 + def predicate_builder; end + + # pkg:gem/activerecord#lib/active_record/core.rb:372 + def type_caster; end + + private + + # pkg:gem/activerecord#lib/active_record/core.rb:418 + def cached_find_by(keys, values); end + + # pkg:gem/activerecord#lib/active_record/core.rb:382 + def inherited(subclass); end + + # pkg:gem/activerecord#lib/active_record/core.rb:404 + def relation; end + + # pkg:gem/activerecord#lib/active_record/core.rb:414 + def table_metadata; end +end + +# pkg:gem/activerecord#lib/active_record/core.rb:797 +class ActiveRecord::Core::InspectionMask + # pkg:gem/activerecord#lib/active_record/core.rb:798 + def pretty_print(pp); end +end + +# = Active Record Counter Cache +# +# pkg:gem/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 + + # pkg:gem/activerecord#lib/active_record/counter_cache.rb:186 + def _create_record(attribute_names = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/counter_cache.rb:196 + def destroy_row; end + + # pkg:gem/activerecord#lib/active_record/counter_cache.rb:211 + def each_counter_cached_associations; end + + module GeneratedClassMethods + def _counter_cache_columns; end + def _counter_cache_columns=(value); end + def _counter_cache_columns?; end + end + + module GeneratedInstanceMethods; end +end + +# pkg:gem/activerecord#lib/active_record/counter_cache.rb:12 +module ActiveRecord::CounterCache::ClassMethods + # pkg:gem/activerecord#lib/active_record/counter_cache.rb:180 + 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) + # + # pkg:gem/activerecord#lib/active_record/counter_cache.rb:176 + 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) + # + # pkg:gem/activerecord#lib/active_record/counter_cache.rb:146 + def increment_counter(counter_name, id, by: T.unsafe(nil), touch: T.unsafe(nil)); 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. + # * +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) + # + # # Like above, but also touch the +updated_at+ and/or +updated_on+ + # # attributes. + # Post.reset_counters(1, :comments, touch: true) + # + # pkg:gem/activerecord#lib/active_record/counter_cache.rb:33 + 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) + # + # pkg:gem/activerecord#lib/active_record/counter_cache.rb:114 + 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). +# +# pkg:gem/activerecord#lib/active_record/errors.rb:413 +class ActiveRecord::DangerousAttributeError < ::ActiveRecord::ActiveRecordError; end + +# Raised when creating a database if it exists. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:336 +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. +# +# pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:4 +class ActiveRecord::DatabaseConfigurations + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:73 + def initialize(configurations = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:27 + def any?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:153 + 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+. + # + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:98 + def configs_for(env_name: T.unsafe(nil), name: T.unsafe(nil), config_key: T.unsafe(nil), include_hidden: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:26 + def configurations; end + + # Checks if the application's configurations are empty. + # + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:150 + 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. + # + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:127 + 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`. + # + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:142 + 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"}) + # + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:174 + def resolve(config); end + + private + + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:200 + def build_configs(configs); end + + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:239 + def build_configuration_sentence; end + + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:273 + def build_db_config_from_hash(env_name, name, config); end + + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:252 + def build_db_config_from_raw_config(env_name, name, config); end + + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:263 + def build_db_config_from_string(env_name, name, config); end + + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:188 + def default_env; end + + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:192 + def env_with_configs(env = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:295 + def environment_url_config(env, name, config); end + + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:302 + def environment_value_for(name); end + + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:286 + def merge_db_environment_variables(current_env, configs); end + + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:225 + def resolve_symbol_connection(name); end + + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:219 + def walk_configs(env_name, config); end + + class << self + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:29 + def db_config_handlers; end + + # pkg:gem/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: + # + # ActiveRecord::DatabaseConfigurations.register_db_config_handler do |env_name, name, url, config| + # next unless config.key?(:vitess) + # VitessConfig.new(env_name, name, config) + # 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+. + # + # pkg:gem/activerecord#lib/active_record/database_configurations.rb:61 + def register_db_config_handler(&block); end + end +end + +# Expands a connection string into a hash. +# +# pkg:gem/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" + # } + # + # pkg:gem/activerecord#lib/active_record/database_configurations/connection_url_resolver.rb:25 + def initialize(url); end + + # Converts the given URL to a full connection hash. + # + # pkg:gem/activerecord#lib/active_record/database_configurations/connection_url_resolver.rb:39 + def to_hash; end + + private + + # Returns name of the database. + # + # pkg:gem/activerecord#lib/active_record/database_configurations/connection_url_resolver.rb:84 + 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" + # # => {} + # + # pkg:gem/activerecord#lib/active_record/database_configurations/connection_url_resolver.rb:61 + def query_hash; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/connection_url_resolver.rb:65 + def raw_config; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/connection_url_resolver.rb:46 + def uri; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/connection_url_resolver.rb:48 + 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. +# +# pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:8 +class ActiveRecord::DatabaseConfigurations::DatabaseConfig + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:11 + def initialize(env_name, name); end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:32 + def _database=(database); end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:36 + def adapter; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:20 + def adapter_class_method; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:16 + def adapter_method; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:60 + def checkout_timeout; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:28 + def database; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:9 + def env_name; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:80 + def for_current_env?; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:24 + def host; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:68 + def idle_timeout; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:52 + def max_queue; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:48 + def max_threads; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:76 + def migrations_paths; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:44 + def min_threads; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:9 + def name; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:40 + def pool; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:56 + def query_cache; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:64 + def reaping_frequency; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:72 + def replica?; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/database_config.rb:84 + def schema_cache_path; 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. +# +# pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:20 +class ActiveRecord::DatabaseConfigurations::HashConfig < ::ActiveRecord::DatabaseConfigurations::DatabaseConfig + # Initialize a new +HashConfig+ 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". + # * :config - The config hash. This is the hash that contains the + # database adapter, name, and other important information for database + # connections. + # + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:36 + def initialize(env_name, name, configuration_hash); end + + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:67 + def _database=(database); end + + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:106 + def adapter; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:91 + def checkout_timeout; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:21 + def configuration_hash; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:63 + def database; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:149 + def database_tasks?; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:117 + def default_schema_cache_path; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:55 + def host; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:101 + def idle_timeout; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:121 + def lazy_schema_cache_path; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:87 + def max_queue; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:79 + 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. + # + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:51 + def migrations_paths; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:75 + def min_threads; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:71 + def pool; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:125 + def primary?; end + + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:83 + def query_cache; end + + # +reaping_frequency+ is configurable mostly for historical reasons, but it could + # also be useful if someone wants a very low +idle_timeout+. + # + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:97 + 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+. + # + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:44 + 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. + # + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:113 + 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. + # + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:137 + def schema_dump(format = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:59 + def socket; end + + private + + # pkg:gem/activerecord#lib/active_record/database_configurations/hash_config.rb:154 + def schema_file_type(format); end +end + +# pkg:gem/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. +# +# pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/database_configurations/url_config.rb:40 + def initialize(env_name, name, url, configuration_hash = T.unsafe(nil)); end + + # pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/database_configurations/url_config.rb:50 + def build_url_hash; 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. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:93 +class ActiveRecord::DatabaseConnectionError < ::ActiveRecord::ConnectionNotEstablished + # pkg:gem/activerecord#lib/active_record/errors.rb:94 + def initialize(message = T.unsafe(nil)); end + + class << self + # pkg:gem/activerecord#lib/active_record/errors.rb:99 + def hostname_error(hostname); end + + # pkg:gem/activerecord#lib/active_record/errors.rb:106 + def username_error(username); end + end +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. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:525 +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, created_at, updated_at, entryable_type, entryable_id ] +# 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 ] +# class Message < ApplicationRecord +# include Entryable +# end +# +# # Schema: comments[ id, content ] +# 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 +# +# 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) +# create! entryable: Comment.new(content: content), creator: creator +# end +# end +# +# == 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' +# +# pkg:gem/activerecord#lib/active_record/delegated_type.rb:155 +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 + # + # pkg:gem/activerecord#lib/active_record/delegated_type.rb:211 + def delegated_type(role, types:, **options); end + + private + + # pkg:gem/activerecord#lib/active_record/delegated_type.rb:217 + def define_delegated_type_methods(role, types:, options:); end +end + +# pkg:gem/activerecord#lib/active_record/relation/delegation.rb:7 +module ActiveRecord::Delegation + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Delegation::ClassMethods + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def &(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def +(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def -(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def [](*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def as_json(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def compact(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:105 + def connection(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def each(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def encode_with(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def in_groups(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def in_groups_of(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def index(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def intersect?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def join(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def length(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:105 + def primary_key(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def reverse(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def rindex(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def rotate(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def sample(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def shuffle(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def slice(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def split(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def to_formatted_s(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def to_fs(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def to_sentence(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def to_xml(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:105 + def transaction(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:100 + def |(*, **, &); end + + private + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:142 + def respond_to_missing?(method, _); end + + class << self + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:9 + def delegated_classes; end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:18 + def uncacheable_methods; end + end +end + +# pkg:gem/activerecord#lib/active_record/relation/delegation.rb:130 +module ActiveRecord::Delegation::ClassMethods + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:131 + def create(klass, *args, **kwargs); end + + private + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:136 + def relation_class_for(klass); end +end + +# pkg:gem/activerecord#lib/active_record/relation/delegation.rb:107 +module ActiveRecord::Delegation::ClassSpecificRelation + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Delegation::ClassSpecificRelation::ClassMethods + + private + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:117 + def method_missing(method, *args, **, &block); end +end + +# pkg:gem/activerecord#lib/active_record/relation/delegation.rb:110 +module ActiveRecord::Delegation::ClassSpecificRelation::ClassMethods + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:111 + def name; end +end + +# pkg:gem/activerecord#lib/active_record/relation/delegation.rb:25 +module ActiveRecord::Delegation::DelegateCache + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:50 + def generate_relation_method(method); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:45 + def inherited(child_class); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:30 + def initialize_relation_delegate_cache; end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:26 + def relation_delegate_class(klass); end + + protected + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:55 + def include_relation_methods(delegate); end + + private + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:61 + def generated_relation_methods; end +end + +# pkg:gem/activerecord#lib/active_record/relation/delegation.rb:69 +class ActiveRecord::Delegation::GeneratedRelationMethods < ::Module + include ::Mutex_m + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:72 + def generate_method(method); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:70 + def lock; end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:70 + def locked?; end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:70 + def synchronize(&block); end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:70 + def try_lock; end + + # pkg:gem/activerecord#lib/active_record/relation/delegation.rb:70 + def unlock; end +end + +# 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 +# +# pkg:gem/activerecord#lib/active_record/associations.rb:256 +class ActiveRecord::DeleteRestrictionError < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/associations.rb:257 + def initialize(name = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/active_record/errors.rb:13 +class ActiveRecord::DeprecatedActiveJobRequiredError < ::ActiveRecord::ActiveRecordError; end + +# pkg:gem/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. +# +# pkg:gem/activerecord#lib/active_record/destroy_association_async_job.rb:10 +class ActiveRecord::DestroyAssociationAsyncJob < ::ActiveJob::Base + # pkg:gem/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 + + # pkg:gem/activerecord#lib/active_record/destroy_association_async_job.rb:34 + def owner_destroyed?(owner, ensuring_owner_was_method); end + + class << self + # pkg:gem/activerecord#lib/active_record/destroy_association_async_job.rb:11 + def queue_name; end + + # pkg:gem/activerecord#lib/active_record/destroy_association_async_job.rb:13 + def rescue_handlers; end + end +end + +# pkg:gem/activerecord#lib/active_record/disable_joins_association_relation.rb:4 +class ActiveRecord::DisableJoinsAssociationRelation < ::ActiveRecord::Relation + # pkg:gem/activerecord#lib/active_record/disable_joins_association_relation.rb:7 + def initialize(klass, key, ids); end + + # pkg:gem/activerecord#lib/active_record/disable_joins_association_relation.rb:17 + def first(limit = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/disable_joins_association_relation.rb:5 + def ids; end + + # pkg:gem/activerecord#lib/active_record/disable_joins_association_relation.rb:5 + def key; end + + # pkg:gem/activerecord#lib/active_record/disable_joins_association_relation.rb:13 + def limit(value); end + + # pkg:gem/activerecord#lib/active_record/disable_joins_association_relation.rb:25 + def load; end +end + +# pkg:gem/activerecord#lib/active_record/migration.rb:104 +class ActiveRecord::DuplicateMigrationNameError < ::ActiveRecord::MigrationError + # pkg:gem/activerecord#lib/active_record/migration.rb:105 + def initialize(name = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/active_record/migration.rb:94 +class ActiveRecord::DuplicateMigrationVersionError < ::ActiveRecord::MigrationError + # pkg:gem/activerecord#lib/active_record/migration.rb:95 + def initialize(version = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:4 +module ActiveRecord::DynamicMatchers + private + + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:15 + def method_missing(name, *arguments, &block); end + + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:6 + def respond_to_missing?(name, _); end +end + +# pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:93 +class ActiveRecord::DynamicMatchers::FindBy < ::ActiveRecord::DynamicMatchers::Method + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:100 + def finder; end + + class << self + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:96 + def prefix; end + end +end + +# pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:105 +class ActiveRecord::DynamicMatchers::FindByBang < ::ActiveRecord::DynamicMatchers::Method + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:116 + def finder; end + + class << self + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:108 + def prefix; end + + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:112 + def suffix; end + end +end + +# pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:26 +class ActiveRecord::DynamicMatchers::Method + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:52 + def initialize(model, method_name); end + + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:50 + def attribute_names; end + + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:63 + def define; end + + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:50 + def model; end + + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:50 + def name; end + + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:59 + def valid?; end + + private + + # Given that the parameters starts with `_`, the finder needs to use the + # same parameter name. + # + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:84 + def attributes_hash; end + + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:72 + def body; end + + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:88 + def finder; end + + # The parameters in the signature may have reserved Ruby words, in order + # to prevent errors, we start each param name with `_`. + # + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:78 + def signature; end + + class << self + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:32 + def match(model, name); end + + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:30 + def matchers; end + + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:37 + def pattern; end + + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:41 + def prefix; end + + # pkg:gem/activerecord#lib/active_record/dynamic_matchers.rb:45 + def suffix; 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]. +# +# pkg:gem/activerecord#lib/active_record/associations.rb:243 +class ActiveRecord::EagerLoadPolymorphicError < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/associations.rb:244 + def initialize(reflection = T.unsafe(nil)); end +end + +# pkg:gem/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 + + # pkg:gem/activerecord#lib/active_record/encryption.rb:47 + def config; end + + # pkg:gem/activerecord#lib/active_record/encryption.rb:48 + def custom_contexts; end + + # pkg:gem/activerecord#lib/active_record/encryption.rb:48 + def custom_contexts=(obj); end + + # pkg:gem/activerecord#lib/active_record/encryption.rb:48 + def default_context; end + + # pkg:gem/activerecord#lib/active_record/encryption.rb:48 + def default_context=(val); end + + # pkg:gem/activerecord#lib/active_record/encryption.rb:47 + def encrypted_attribute_declaration_listeners; end + + # pkg:gem/activerecord#lib/active_record/encryption.rb:47 + def encrypted_attribute_declaration_listeners=(val); end + + class << self + # pkg:gem/activerecord#lib/active_record/encryption.rb:47 + def config; end + + # pkg:gem/activerecord#lib/active_record/encryption.rb:48 + def custom_contexts; end + + # pkg:gem/activerecord#lib/active_record/encryption.rb:48 + def custom_contexts=(obj); end + + # pkg:gem/activerecord#lib/active_record/encryption.rb:48 + def default_context; end + + # pkg:gem/activerecord#lib/active_record/encryption.rb:48 + def default_context=(val); end + + # pkg:gem/activerecord#lib/active_record/encryption.rb:50 + def eager_load!; end + + # pkg:gem/activerecord#lib/active_record/encryption.rb:47 + def encrypted_attribute_declaration_listeners; end + + # pkg:gem/activerecord#lib/active_record/encryption.rb:47 + def encrypted_attribute_declaration_listeners=(val); end + end +end + +# pkg:gem/activerecord#lib/active_record/encryption/auto_filtered_parameters.rb:5 +class ActiveRecord::Encryption::AutoFilteredParameters + # pkg:gem/activerecord#lib/active_record/encryption/auto_filtered_parameters.rb:6 + def initialize(app); end + + # pkg:gem/activerecord#lib/active_record/encryption/auto_filtered_parameters.rb:14 + def enable; end + + private + + # pkg:gem/activerecord#lib/active_record/encryption/auto_filtered_parameters.rb:20 + def app; end + + # pkg:gem/activerecord#lib/active_record/encryption/auto_filtered_parameters.rb:36 + def apply_collected_attributes; end + + # pkg:gem/activerecord#lib/active_record/encryption/auto_filtered_parameters.rb:53 + def apply_filter(klass, attribute); end + + # pkg:gem/activerecord#lib/active_record/encryption/auto_filtered_parameters.rb:28 + def attribute_was_declared(klass, attribute); end + + # pkg:gem/activerecord#lib/active_record/encryption/auto_filtered_parameters.rb:48 + def collect_for_later(klass, attribute); end + + # pkg:gem/activerecord#lib/active_record/encryption/auto_filtered_parameters.rb:44 + def collecting?; end + + # pkg:gem/activerecord#lib/active_record/encryption/auto_filtered_parameters.rb:61 + def excluded_from_filter_parameters?(filter_parameter); end + + # pkg:gem/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+. +# +# pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/encryption/cipher.rb:25 + def decrypt(encrypted_message, key:); end + + # Encrypts the provided text and return an encrypted +Message+. + # + # pkg:gem/activerecord#lib/active_record/encryption/cipher.rb:15 + def encrypt(clean_text, key:, deterministic: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/encryption/cipher.rb:35 + def iv_length; end + + # pkg:gem/activerecord#lib/active_record/encryption/cipher.rb:31 + def key_length; end + + private + + # pkg:gem/activerecord#lib/active_record/encryption/cipher.rb:48 + def cipher_for(secret, deterministic: T.unsafe(nil)); end + + # pkg:gem/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+ +# +# pkg:gem/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) + # + # pkg:gem/activerecord#lib/active_record/encryption/cipher/aes256_gcm.rb:29 + def initialize(secret, deterministic: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/encryption/cipher/aes256_gcm.rb:55 + def decrypt(encrypted_message); end + + # pkg:gem/activerecord#lib/active_record/encryption/cipher/aes256_gcm.rb:34 + def encrypt(clear_text); end + + # pkg:gem/activerecord#lib/active_record/encryption/cipher/aes256_gcm.rb:82 + def inspect; end + + private + + # pkg:gem/activerecord#lib/active_record/encryption/cipher/aes256_gcm.rb:95 + def generate_deterministic_iv(clear_text); end + + # pkg:gem/activerecord#lib/active_record/encryption/cipher/aes256_gcm.rb:87 + def generate_iv(cipher, clear_text); end + + class << self + # pkg:gem/activerecord#lib/active_record/encryption/cipher/aes256_gcm.rb:22 + def iv_length; end + + # pkg:gem/activerecord#lib/active_record/encryption/cipher/aes256_gcm.rb:18 + def key_length; end + end +end + +# pkg:gem/activerecord#lib/active_record/encryption/cipher/aes256_gcm.rb:15 +ActiveRecord::Encryption::Cipher::Aes256Gcm::CIPHER_TYPE = T.let(T.unsafe(nil), String) + +# pkg:gem/activerecord#lib/active_record/encryption/cipher.rb:12 +ActiveRecord::Encryption::Cipher::DEFAULT_ENCODING = T.let(T.unsafe(nil), Encoding) + +# Container of configuration options +# +# pkg:gem/activerecord#lib/active_record/encryption/config.rb:8 +class ActiveRecord::Encryption::Config + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:13 + def initialize; end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def add_to_filter_parameters; end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def add_to_filter_parameters=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def deterministic_key; end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def deterministic_key=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def encrypt_fixtures; end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def encrypt_fixtures=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def excluded_from_filter_parameters; end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def excluded_from_filter_parameters=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def extend_queries; end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def extend_queries=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def forced_encoding_for_deterministic_encryption; end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def forced_encoding_for_deterministic_encryption=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:36 + def has_deterministic_key?; end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:36 + def has_key_derivation_salt?; end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:36 + def has_primary_key?; end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def hash_digest_class; end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def hash_digest_class=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def key_derivation_salt; end + + # pkg:gem/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 } ] + # + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:20 + def previous=(previous_schemes_properties); end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def previous_schemes; end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def previous_schemes=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def primary_key; end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def primary_key=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def store_key_references; end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def store_key_references=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:26 + def support_sha1_for_non_deterministic_encryption=(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def support_unencrypted_data; end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def support_unencrypted_data=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def validate_column_size; end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:9 + def validate_column_size=(_arg0); end + + private + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:63 + def add_previous_scheme(**properties); end + + # pkg:gem/activerecord#lib/active_record/encryption/config.rb:48 + def set_defaults; end +end + +# Configuration API for ActiveRecord::Encryption +# +# pkg:gem/activerecord#lib/active_record/encryption/configurable.rb:6 +module ActiveRecord::Encryption::Configurable + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Encryption::Configurable::ClassMethods +end + +# pkg:gem/activerecord#lib/active_record/encryption/configurable.rb:14 +module ActiveRecord::Encryption::Configurable::ClassMethods + # pkg:gem/activerecord#lib/active_record/encryption/configurable.rb:17 + def cipher(*, **, &); end + + # pkg:gem/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 + + # pkg:gem/activerecord#lib/active_record/encryption/configurable.rb:52 + def encrypted_attribute_was_declared(klass, name); end + + # pkg:gem/activerecord#lib/active_record/encryption/configurable.rb:17 + def encryptor(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/encryption/configurable.rb:17 + def frozen_encryption(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/encryption/configurable.rb:17 + def key_generator(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/encryption/configurable.rb:17 + def key_provider(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/encryption/configurable.rb:17 + def message_serializer(*, **, &); end + + # pkg:gem/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 +# +# pkg:gem/activerecord#lib/active_record/encryption/context.rb:12 +class ActiveRecord::Encryption::Context + # pkg:gem/activerecord#lib/active_record/encryption/context.rb:17 + def initialize; end + + # pkg:gem/activerecord#lib/active_record/encryption/context.rb:15 + def cipher; end + + # pkg:gem/activerecord#lib/active_record/encryption/context.rb:15 + def cipher=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/encryption/context.rb:15 + def encryptor; end + + # pkg:gem/activerecord#lib/active_record/encryption/context.rb:15 + def encryptor=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/encryption/context.rb:15 + def frozen_encryption; end + + # pkg:gem/activerecord#lib/active_record/encryption/context.rb:15 + def frozen_encryption=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/encryption/context.rb:21 + def frozen_encryption?; end + + # pkg:gem/activerecord#lib/active_record/encryption/context.rb:15 + def key_generator; end + + # pkg:gem/activerecord#lib/active_record/encryption/context.rb:15 + def key_generator=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/encryption/context.rb:15 + def key_provider; end + + # pkg:gem/activerecord#lib/active_record/encryption/context.rb:15 + def key_provider=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/encryption/context.rb:15 + def message_serializer; end + + # pkg:gem/activerecord#lib/active_record/encryption/context.rb:15 + def message_serializer=(_arg0); end + + private + + # pkg:gem/activerecord#lib/active_record/encryption/context.rb:37 + def build_default_key_provider; end + + # pkg:gem/activerecord#lib/active_record/encryption/context.rb:29 + def set_defaults; end +end + +# pkg:gem/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. +# +# pkg:gem/activerecord#lib/active_record/encryption/contexts.rb:13 +module ActiveRecord::Encryption::Contexts + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Encryption::Contexts::ClassMethods +end + +# pkg:gem/activerecord#lib/active_record/encryption/contexts.rb:21 +module ActiveRecord::Encryption::Contexts::ClassMethods + # pkg:gem/activerecord#lib/active_record/encryption/contexts.rb:62 + def context; end + + # pkg:gem/activerecord#lib/active_record/encryption/contexts.rb:66 + def current_custom_context; end + + # pkg:gem/activerecord#lib/active_record/encryption/contexts.rb:57 + def protecting_encrypted_data(&block); end + + # pkg:gem/activerecord#lib/active_record/encryption/contexts.rb:70 + def reset_default_context; end + + # pkg:gem/activerecord#lib/active_record/encryption/contexts.rb:33 + def with_encryption_context(properties); end + + # pkg:gem/activerecord#lib/active_record/encryption/contexts.rb:49 + def without_encryption(&block); end +end + +# A KeyProvider that derives keys from passwords. +# +# pkg:gem/activerecord#lib/active_record/encryption/derived_secret_key_provider.rb:6 +class ActiveRecord::Encryption::DerivedSecretKeyProvider < ::ActiveRecord::Encryption::KeyProvider + # pkg:gem/activerecord#lib/active_record/encryption/derived_secret_key_provider.rb:7 + def initialize(passwords, key_generator: T.unsafe(nil)); end + + private + + # pkg:gem/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. +# +# pkg:gem/activerecord#lib/active_record/encryption/deterministic_key_provider.rb:6 +class ActiveRecord::Encryption::DeterministicKeyProvider < ::ActiveRecord::Encryption::DerivedSecretKeyProvider + # pkg:gem/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. +# +# pkg:gem/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+. + # + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:157 + def ciphertext_for(attribute_name); end + + # Decrypts all the encryptable attributes and saves the changes. + # + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:171 + def decrypt; end + + # Encrypts all the encryptable attributes and saves the changes. + # + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:166 + def encrypt; end + + # Returns whether a given attribute is encrypted or not. + # + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:146 + def encrypted_attribute?(attribute_name); end + + private + + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:178 + def _create_record(attribute_names = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:214 + def build_decrypt_attribute_assignments; end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:208 + def build_encrypt_attribute_assignments; end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:223 + def cant_modify_encrypted_attributes_when_frozen; end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:193 + def decrypt_attributes; end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:187 + def encrypt_attributes; end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:204 + def has_encrypted_attributes?; end + + # pkg:gem/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 + +# pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:16 +module ActiveRecord::Encryption::EncryptableRecord::ClassMethods + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:58 + def deterministic_encrypted_attributes; end + + # pkg:gem/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), **context_properties); end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:65 + def source_attribute_from_preserved_attribute(attribute_name); end + + private + + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:132 + def add_length_validation_for_encrypted_columns; end + + # pkg:gem/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), **context_properties); end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:78 + def global_previous_schemes_for(scheme); end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:126 + def load_schema!; end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:109 + def override_accessors_to_preserve_original(name, original_attribute_name); end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:98 + def preserve_original_encrypted(name); end + + # pkg:gem/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 + + # pkg:gem/activerecord#lib/active_record/encryption/encryptable_record.rb:138 + def validate_column_size(attribute_name); end +end + +# pkg:gem/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. +# +# pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:10 +class ActiveRecord::Encryption::EncryptedAttributeType < ::ActiveRecord::Type::Text + 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. + # + # pkg:gem/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 + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:16 + def accessor(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:31 + def cast(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:13 + def cast_type; end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:51 + def changed_in_place?(raw_old_value, new_value); end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:35 + def deserialize(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:15 + def deterministic?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:15 + def downcase?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:47 + def encrypted?(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:15 + def fixed?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:15 + def key_provider(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:15 + def previous_schemes(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:56 + def previous_types; end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:13 + def scheme; end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:39 + def serialize(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:61 + def support_unencrypted_data?; end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:15 + def with_context(*, **, &); end + + private + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:74 + def build_previous_types_for(schemes); end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:150 + def clean_text_scheme; end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:84 + def decrypt(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:146 + def decryption_options; end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:132 + def encrypt(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:142 + def encryption_options; end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:138 + def encryptor; end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:110 + def handle_deserialize_error(error, value); end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:66 + def previous_schemes_including_clean_text; end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:80 + def previous_type?; end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:70 + def previous_types_without_clean_text; end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:126 + def serialize_with_current(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:122 + def serialize_with_oldest(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:118 + def serialize_with_oldest?; end + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_attribute_type.rb:102 + def try_to_deserialize_with_previous_encrypted_types(value); end +end + +# pkg:gem/activerecord#lib/active_record/encryption/encrypted_fixtures.rb:5 +module ActiveRecord::Encryption::EncryptedFixtures + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_fixtures.rb:6 + def initialize(fixture, model_class); end + + private + + # pkg:gem/activerecord#lib/active_record/encryption/encrypted_fixtures.rb:14 + def encrypt_fixture_data(fixture, model_class); end + + # pkg:gem/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. +# +# pkg:gem/activerecord#lib/active_record/encryption/encrypting_only_encryptor.rb:6 +class ActiveRecord::Encryption::EncryptingOnlyEncryptor < ::ActiveRecord::Encryption::Encryptor + # pkg:gem/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. +# +# pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:14 +class ActiveRecord::Encryption::Encryptor + # Decrypts a +clean_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+ + # + # pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:52 + 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 Base 64 + # + # === 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+ + # + # pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:34 + def encrypt(clear_text, key_provider: T.unsafe(nil), cipher_options: T.unsafe(nil)); end + + # Returns whether the text is encrypted or not + # + # pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:62 + def encrypted?(text); end + + private + + # pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:88 + def build_encrypted_message(clear_text, key_provider:, cipher_options:); end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:84 + def cipher; end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:122 + def compress(data); end + + # Under certain threshold, ZIP compression is actually worse that not compressing + # + # pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:114 + def compress_if_worth_it(string); end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:74 + def default_key_provider; end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:102 + def deserialize_message(message); end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:142 + def force_encoding_if_needed(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:150 + def forced_encoding_for_deterministic_encryption; end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:98 + def serialize_message(message); end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:109 + def serializer; end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:136 + def uncompress(data); end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:128 + def uncompress_if_needed(data, compressed); end + + # pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:78 + def validate_payload_type(clear_text); end +end + +# pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:70 +ActiveRecord::Encryption::Encryptor::DECRYPT_ERRORS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:71 +ActiveRecord::Encryption::Encryptor::ENCODING_ERRORS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/active_record/encryption/encryptor.rb:72 +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. +# +# pkg:gem/activerecord#lib/active_record/encryption/envelope_encryption_key_provider.rb:17 +class ActiveRecord::Encryption::EnvelopeEncryptionKeyProvider + # pkg:gem/activerecord#lib/active_record/encryption/envelope_encryption_key_provider.rb:31 + def active_primary_key; end + + # pkg:gem/activerecord#lib/active_record/encryption/envelope_encryption_key_provider.rb:26 + def decryption_keys(encrypted_message); end + + # pkg:gem/activerecord#lib/active_record/encryption/envelope_encryption_key_provider.rb:18 + def encryption_key; end + + private + + # pkg:gem/activerecord#lib/active_record/encryption/envelope_encryption_key_provider.rb:40 + def decrypt_data_key(encrypted_message); end + + # pkg:gem/activerecord#lib/active_record/encryption/envelope_encryption_key_provider.rb:36 + def encrypt_data_key(random_secret); end + + # pkg:gem/activerecord#lib/active_record/encryption/envelope_encryption_key_provider.rb:50 + def generate_random_secret; end + + # pkg:gem/activerecord#lib/active_record/encryption/envelope_encryption_key_provider.rb:46 + def primary_key_provider; end +end + +# pkg:gem/activerecord#lib/active_record/encryption/errors.rb:5 +module ActiveRecord::Encryption::Errors; end + +# pkg:gem/activerecord#lib/active_record/encryption/errors.rb:6 +class ActiveRecord::Encryption::Errors::Base < ::StandardError; end + +# pkg:gem/activerecord#lib/active_record/encryption/errors.rb:10 +class ActiveRecord::Encryption::Errors::Configuration < ::ActiveRecord::Encryption::Errors::Base; end + +# pkg:gem/activerecord#lib/active_record/encryption/errors.rb:8 +class ActiveRecord::Encryption::Errors::Decryption < ::ActiveRecord::Encryption::Errors::Base; end + +# pkg:gem/activerecord#lib/active_record/encryption/errors.rb:7 +class ActiveRecord::Encryption::Errors::Encoding < ::ActiveRecord::Encryption::Errors::Base; end + +# pkg:gem/activerecord#lib/active_record/encryption/errors.rb:12 +class ActiveRecord::Encryption::Errors::EncryptedContentIntegrity < ::ActiveRecord::Encryption::Errors::Base; end + +# pkg:gem/activerecord#lib/active_record/encryption/errors.rb:9 +class ActiveRecord::Encryption::Errors::Encryption < ::ActiveRecord::Encryption::Errors::Base; end + +# pkg:gem/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`. +# +# pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:23 +module ActiveRecord::Encryption::ExtendedDeterministicQueries + class << self + # pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:24 + def install_support; end + end +end + +# pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:132 +class ActiveRecord::Encryption::ExtendedDeterministicQueries::AdditionalValue + # pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:135 + def initialize(value, type); end + + # pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:133 + def type; end + + # pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:133 + def value; end + + private + + # pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:141 + def process(value); end +end + +# pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:122 +module ActiveRecord::Encryption::ExtendedDeterministicQueries::CoreQueries + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Encryption::ExtendedDeterministicQueries::CoreQueries::ClassMethods +end + +# pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:125 +module ActiveRecord::Encryption::ExtendedDeterministicQueries::CoreQueries::ClassMethods + # pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:126 + 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. +# +# @TODO We will extend this to support previous "encryption context" versions in future iterations +# @TODO Experimental. Support for every kind of query is pending +# @TODO It should not patch anything if not needed (no previous schemes or no support for previous encryption schemes) +# +# pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:41 +module ActiveRecord::Encryption::ExtendedDeterministicQueries::EncryptedQuery + class << self + # pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:43 + def process_arguments(owner, args, check_for_additional_values); end + + private + + # pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:87 + def additional_values_for(value, type); end + + # pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:69 + def process_encrypted_query_argument(value, check_for_additional_values, type); end + end +end + +# pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:146 +module ActiveRecord::Encryption::ExtendedDeterministicQueries::ExtendedEncryptableType + # pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:147 + def serialize(data); end +end + +# pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:95 +module ActiveRecord::Encryption::ExtendedDeterministicQueries::RelationQueries + # pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:100 + def exists?(*args); end + + # pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:104 + def scope_for_create; end + + # pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_queries.rb:96 + def where(*args); end +end + +# pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_uniqueness_validator.rb:5 +module ActiveRecord::Encryption::ExtendedDeterministicUniquenessValidator + class << self + # pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_uniqueness_validator.rb:6 + def install_support; end + end +end + +# pkg:gem/activerecord#lib/active_record/encryption/extended_deterministic_uniqueness_validator.rb:10 +module ActiveRecord::Encryption::ExtendedDeterministicUniquenessValidator::EncryptedUniquenessValidator + # pkg:gem/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. +# +# pkg:gem/activerecord#lib/active_record/encryption/key.rb:10 +class ActiveRecord::Encryption::Key + # pkg:gem/activerecord#lib/active_record/encryption/key.rb:13 + def initialize(secret); end + + # pkg:gem/activerecord#lib/active_record/encryption/key.rb:23 + def id; end + + # pkg:gem/activerecord#lib/active_record/encryption/key.rb:11 + def public_tags; end + + # pkg:gem/activerecord#lib/active_record/encryption/key.rb:11 + def secret; end + + class << self + # pkg:gem/activerecord#lib/active_record/encryption/key.rb:18 + def derive_from(password); end + end +end + +# Utility for generating and deriving random keys. +# +# pkg:gem/activerecord#lib/active_record/encryption/key_generator.rb:8 +class ActiveRecord::Encryption::KeyGenerator + # pkg:gem/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+ + # + # pkg:gem/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*") + # + # pkg:gem/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) + # + # pkg:gem/activerecord#lib/active_record/encryption/key_generator.rb:16 + def generate_random_key(length: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/encryption/key_generator.rb:9 + def hash_digest_class; end + + private + + # pkg:gem/activerecord#lib/active_record/encryption/key_generator.rb:44 + def key_derivation_salt; end + + # pkg:gem/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 +# +# pkg:gem/activerecord#lib/active_record/encryption/key_provider.rb:10 +class ActiveRecord::Encryption::KeyProvider + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/encryption/key_provider.rb:32 + def decryption_keys(encrypted_message); end + + # Returns the first 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 + # + # pkg:gem/activerecord#lib/active_record/encryption/key_provider.rb:20 + def encryption_key; end + + private + + # pkg:gem/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 +# +# pkg:gem/activerecord#lib/active_record/encryption/message.rb:11 +class ActiveRecord::Encryption::Message + # pkg:gem/activerecord#lib/active_record/encryption/message.rb:14 + def initialize(payload: T.unsafe(nil), headers: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/encryption/message.rb:21 + def ==(other_message); end + + # pkg:gem/activerecord#lib/active_record/encryption/message.rb:12 + def headers; end + + # pkg:gem/activerecord#lib/active_record/encryption/message.rb:12 + def headers=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/encryption/message.rb:12 + def payload; end + + # pkg:gem/activerecord#lib/active_record/encryption/message.rb:12 + def payload=(_arg0); end + + private + + # pkg:gem/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. +# +# pkg:gem/activerecord#lib/active_record/encryption/message_serializer.rb:23 +class ActiveRecord::Encryption::MessageSerializer + # pkg:gem/activerecord#lib/active_record/encryption/message_serializer.rb:31 + def dump(message); end + + # pkg:gem/activerecord#lib/active_record/encryption/message_serializer.rb:24 + def load(serialized_content); end + + private + + # pkg:gem/activerecord#lib/active_record/encryption/message_serializer.rb:81 + def decode_if_needed(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/message_serializer.rb:73 + def encode_if_needed(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/message_serializer.rb:67 + def headers_to_json(headers); end + + # pkg:gem/activerecord#lib/active_record/encryption/message_serializer.rb:60 + def message_to_json(message); end + + # pkg:gem/activerecord#lib/active_record/encryption/message_serializer.rb:37 + def parse_message(data, level); end + + # pkg:gem/activerecord#lib/active_record/encryption/message_serializer.rb:52 + def parse_properties(headers, level); end + + # pkg:gem/activerecord#lib/active_record/encryption/message_serializer.rb:42 + def validate_message_data_format(data, level); end +end + +# An encryptor that won't decrypt or encrypt. It will just return the passed +# values +# +# pkg:gem/activerecord#lib/active_record/encryption/null_encryptor.rb:7 +class ActiveRecord::Encryption::NullEncryptor + # pkg:gem/activerecord#lib/active_record/encryption/null_encryptor.rb:12 + def decrypt(encrypted_text, key_provider: T.unsafe(nil), cipher_options: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/encryption/null_encryptor.rb:8 + def encrypt(clean_text, key_provider: T.unsafe(nil), cipher_options: T.unsafe(nil)); end + + # pkg:gem/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 +# +# pkg:gem/activerecord#lib/active_record/encryption/properties.rb:16 +class ActiveRecord::Encryption::Properties + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:42 + def initialize(initial_properties = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:20 + def ==(arg); end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:20 + def [](*, **, &); end + + # Set a value for a given key + # + # It will raise an +EncryptedContentIntegrity+ if the value exists + # + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:50 + def []=(key, value); end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:62 + def add(other_properties); end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:33 + def auth_tag; end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:37 + def auth_tag=(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:33 + def compressed; end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:37 + def compressed=(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:20 + def each(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:33 + def encoding; end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:37 + def encoding=(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:33 + def encrypted_data_key; end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:37 + def encrypted_data_key=(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:33 + def encrypted_data_key_id; end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:37 + def encrypted_data_key_id=(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:33 + def iv; end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:37 + def iv=(value); end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:20 + def key?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:19 + def method_missing(method, *args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:68 + def to_h; end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:56 + def validate_value_type(value); end + + private + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:73 + def data; end + + # pkg:gem/activerecord#lib/active_record/encryption/properties.rb:19 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end +end + +# pkg:gem/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 +# +# pkg:gem/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. +# +# pkg:gem/activerecord#lib/active_record/encryption/read_only_null_encryptor.rb:10 +class ActiveRecord::Encryption::ReadOnlyNullEncryptor + # pkg:gem/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 + + # pkg:gem/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 + + # pkg:gem/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 +# +# pkg:gem/activerecord#lib/active_record/encryption/scheme.rb:10 +class ActiveRecord::Encryption::Scheme + # pkg:gem/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), **context_properties); end + + # pkg:gem/activerecord#lib/active_record/encryption/scheme.rb:73 + def compatible_with?(other_scheme); end + + # pkg:gem/activerecord#lib/active_record/encryption/scheme.rb:39 + def deterministic?; end + + # pkg:gem/activerecord#lib/active_record/encryption/scheme.rb:35 + def downcase?; end + + # pkg:gem/activerecord#lib/active_record/encryption/scheme.rb:47 + def fixed?; end + + # pkg:gem/activerecord#lib/active_record/encryption/scheme.rb:31 + def ignore_case?; end + + # pkg:gem/activerecord#lib/active_record/encryption/scheme.rb:52 + def key_provider; end + + # pkg:gem/activerecord#lib/active_record/encryption/scheme.rb:56 + def merge(other_scheme); end + + # pkg:gem/activerecord#lib/active_record/encryption/scheme.rb:11 + def previous_schemes; end + + # pkg:gem/activerecord#lib/active_record/encryption/scheme.rb:11 + def previous_schemes=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/encryption/scheme.rb:43 + def support_unencrypted_data?; end + + # pkg:gem/activerecord#lib/active_record/encryption/scheme.rb:60 + def to_h; end + + # pkg:gem/activerecord#lib/active_record/encryption/scheme.rb:65 + def with_context(&block); end + + private + + # pkg:gem/activerecord#lib/active_record/encryption/scheme.rb:83 + def build_key_provider; end + + # pkg:gem/activerecord#lib/active_record/encryption/scheme.rb:91 + def default_key_provider; end + + # pkg:gem/activerecord#lib/active_record/encryption/scheme.rb:78 + 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 +# +# If you want the enum value to be validated before saving, use the option +:validate+: +# +# 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 +# +# It is also possible to 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 +# +# Otherwise +ArgumentError+ will raise: +# +# class Conversation < ActiveRecord::Base +# enum :status, [ :active, :archived ] +# end +# +# conversation = Conversation.new +# +# conversation.status = :unknown # 'unknown' is not a valid status (ArgumentError) +# +# pkg:gem/activerecord#lib/active_record/enum.rb:165 +module ActiveRecord::Enum + # pkg:gem/activerecord#lib/active_record/enum.rb:216 + def enum(name = T.unsafe(nil), values = T.unsafe(nil), **options); end + + private + + # pkg:gem/activerecord#lib/active_record/enum.rb:234 + 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 + + # pkg:gem/activerecord#lib/active_record/enum.rb:329 + def _enum_methods_module; end + + # pkg:gem/activerecord#lib/active_record/enum.rb:337 + def assert_valid_enum_definition_values(values); end + + # pkg:gem/activerecord#lib/active_record/enum.rb:370 + def detect_enum_conflict!(enum_name, method_name, klass_method = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/enum.rb:394 + def detect_negative_enum_conditions!(method_names); end + + # pkg:gem/activerecord#lib/active_record/enum.rb:229 + def inherited(base); end + + # pkg:gem/activerecord#lib/active_record/enum.rb:384 + def raise_conflict_error(enum_name, method_name, type: T.unsafe(nil), source: T.unsafe(nil)); end + + class << self + # pkg:gem/activerecord#lib/active_record/enum.rb:166 + def extended(base); end + end +end + +# pkg:gem/activerecord#lib/active_record/enum.rb:364 +ActiveRecord::Enum::ENUM_CONFLICT_MESSAGE = T.let(T.unsafe(nil), String) + +# pkg:gem/activerecord#lib/active_record/enum.rb:297 +class ActiveRecord::Enum::EnumMethods < ::Module + # pkg:gem/activerecord#lib/active_record/enum.rb:298 + def initialize(klass); end + + private + + # pkg:gem/activerecord#lib/active_record/enum.rb:305 + def define_enum_methods(name, value_method_name, value, scopes, instance_methods); end + + # pkg:gem/activerecord#lib/active_record/enum.rb:303 + def klass; end +end + +# pkg:gem/activerecord#lib/active_record/enum.rb:170 +class ActiveRecord::Enum::EnumType < ::ActiveModel::Type::Value + # pkg:gem/activerecord#lib/active_record/enum.rb:173 + def initialize(name, mapping, subtype, raise_on_invalid_values: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/enum.rb:202 + def assert_valid_value(value); end + + # pkg:gem/activerecord#lib/active_record/enum.rb:180 + def cast(value); end + + # pkg:gem/activerecord#lib/active_record/enum.rb:190 + def deserialize(value); end + + # pkg:gem/activerecord#lib/active_record/enum.rb:198 + def serializable?(value, &block); end + + # pkg:gem/activerecord#lib/active_record/enum.rb:194 + def serialize(value); end + + # pkg:gem/activerecord#lib/active_record/enum.rb:210 + def subtype; end + + # pkg:gem/activerecord#lib/active_record/enum.rb:171 + def type(*, **, &); end + + private + + # pkg:gem/activerecord#lib/active_record/enum.rb:213 + def mapping; end + + # pkg:gem/activerecord#lib/active_record/enum.rb:213 + def name; end +end + +# pkg:gem/activerecord#lib/active_record/migration.rb:204 +class ActiveRecord::EnvironmentMismatchError < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/migration.rb:205 + def initialize(current: T.unsafe(nil), stored: T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/active_record/migration.rb:218 +class ActiveRecord::EnvironmentStorageError < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/migration.rb:219 + def initialize; end +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!]. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:119 +class ActiveRecord::ExclusiveConnectionTimeoutError < ::ActiveRecord::ConnectionTimeoutError; end + +# pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/explain.rb:19 + def exec_explain(queries, options = T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/active_record/explain.rb:54 + def build_explain_clause(options = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/explain.rb:62 + def connection_explain(sql, binds, options); end + + # pkg:gem/activerecord#lib/active_record/explain.rb:39 + def render_bind(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. +# +# pkg:gem/activerecord#lib/active_record/explain_registry.rb:11 +class ActiveRecord::ExplainRegistry + # pkg:gem/activerecord#lib/active_record/explain_registry.rb:24 + def initialize; end + + # pkg:gem/activerecord#lib/active_record/explain_registry.rb:21 + def collect; end + + # pkg:gem/activerecord#lib/active_record/explain_registry.rb:21 + def collect=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/explain_registry.rb:28 + def collect?; end + + # pkg:gem/activerecord#lib/active_record/explain_registry.rb:22 + def queries; end + + # pkg:gem/activerecord#lib/active_record/explain_registry.rb:32 + def reset; end + + class << self + # pkg:gem/activerecord#lib/active_record/explain_registry.rb:13 + def collect(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/explain_registry.rb:13 + def collect=(arg); end + + # pkg:gem/activerecord#lib/active_record/explain_registry.rb:13 + def collect?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/explain_registry.rb:13 + def queries(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/explain_registry.rb:13 + def reset(*, **, &); end + + private + + # pkg:gem/activerecord#lib/active_record/explain_registry.rb:16 + def instance; end + end +end + +# pkg:gem/activerecord#lib/active_record/explain_subscriber.rb:7 +class ActiveRecord::ExplainSubscriber + # pkg:gem/activerecord#lib/active_record/explain_subscriber.rb:12 + def finish(name, id, payload); end + + # pkg:gem/activerecord#lib/active_record/explain_subscriber.rb:25 + def ignore_payload?(payload); end + + # pkg:gem/activerecord#lib/active_record/explain_subscriber.rb:8 + def start(name, id, payload); end +end + +# pkg:gem/activerecord#lib/active_record/explain_subscriber.rb:24 +ActiveRecord::ExplainSubscriber::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. +# +# pkg:gem/activerecord#lib/active_record/explain_subscriber.rb:23 +ActiveRecord::ExplainSubscriber::IGNORED_PAYLOADS = T.let(T.unsafe(nil), Array) + +# pkg:gem/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? + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:349 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:263 + def fifth; end + + # Same as #fifth but raises ActiveRecord::RecordNotFound if no record + # is found. + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:269 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:90 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:103 + def find_by(arg, *args); end + + # Like #find_by, except that if no record is found, raises + # an ActiveRecord::RecordNotFound error. + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:109 + 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]) + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:152 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:165 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:175 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:279 + def forty_two; end + + # Same as #forty_two but raises ActiveRecord::RecordNotFound if no record + # is found. + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:285 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:247 + def fourth; end + + # Same as #fourth but raises ActiveRecord::RecordNotFound if no record + # is found. + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:253 + 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?. + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:377 + 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: + # + # [#, #, #] + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:194 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:205 + def last!; end + + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:395 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:405 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:215 + def second; end + + # Same as #second but raises ActiveRecord::RecordNotFound if no record + # is found. + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:221 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:311 + def second_to_last; end + + # Same as #second_to_last but raises ActiveRecord::RecordNotFound if no record + # is found. + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:317 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:135 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:120 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:126 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:231 + def third; end + + # Same as #third but raises ActiveRecord::RecordNotFound if no record + # is found. + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:237 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:295 + def third_to_last; end + + # Same as #third_to_last but raises ActiveRecord::RecordNotFound if no record + # is found. + # + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:301 + def third_to_last!; end + + private + + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:634 + def _order_columns; end + + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:445 + def apply_join_dependency(eager_loading: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:426 + def construct_relation_for_exists(conditions); end + + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:622 + def find_last(limit); end + + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:584 + def find_nth(index); end + + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:608 + def find_nth_from_last(index); end + + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:589 + def find_nth_with_limit(index, limit); end + + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:506 + def find_one(id); end + + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:527 + def find_some(ids); end + + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:553 + def find_some_ordered(ids); end + + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:568 + def find_take; end + + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:576 + def find_take_with_limit(limit); end + + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:477 + def find_with_ids(*ids); end + + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:626 + def ordered_relation; end + + # pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:473 + def using_limitable_reflections?(reflections); end +end + +# pkg:gem/activerecord#lib/active_record/relation/finder_methods.rb:7 +ActiveRecord::FinderMethods::ONE_AS_ONE = T.let(T.unsafe(nil), String) + +# pkg:gem/activerecord#lib/active_record/fixtures.rb:802 +class ActiveRecord::Fixture + include ::Enumerable + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:813 + def initialize(fixture, model_class); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:826 + def [](key); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:818 + def class_name; end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:822 + def each(&block); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:832 + def find; end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:811 + def fixture; end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:811 + def model_class; end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:830 + def to_hash; end +end + +# pkg:gem/activerecord#lib/active_record/fixtures.rb:805 +class ActiveRecord::Fixture::FixtureError < ::StandardError; end + +# pkg:gem/activerecord#lib/active_record/fixtures.rb:808 +class ActiveRecord::Fixture::FormatError < ::ActiveRecord::Fixture::FixtureError; end + +# pkg:gem/activerecord#lib/active_record/fixtures.rb:12 +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 +# +# 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: 503576764 +# name: George the Monkey +# +# reginald: # generated id: 324201669 +# 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, query_constraints: [:shop_id, :order_id] +# belongs_to :book, query_constraints: [: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. +# +# pkg:gem/activerecord#lib/active_record/fixtures.rb:523 +class ActiveRecord::FixtureSet + # pkg:gem/activerecord#lib/active_record/fixtures.rb:709 + def initialize(_, name, class_name, path, config = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:720 + def [](x); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:724 + def []=(k, v); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:537 + def all_loaded_fixtures; end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:537 + def all_loaded_fixtures=(val); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:707 + def config; end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:728 + def each(&block); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:707 + def fixtures; end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:707 + def ignored_fixtures; end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:707 + def model_class; end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:707 + def name; end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:732 + def size; end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:707 + 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. + # + # pkg:gem/activerecord#lib/active_record/fixtures.rb:738 + def table_rows; end + + private + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:796 + def default_fixture_model_class; end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:758 + def ignored_fixtures=(base); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:750 + 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. + # + # pkg:gem/activerecord#lib/active_record/fixtures.rb:777 + def read_fixture_files(path); end + + class << self + # pkg:gem/activerecord#lib/active_record/fixtures.rb:537 + def all_loaded_fixtures; end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:537 + def all_loaded_fixtures=(val); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:572 + def cache_fixtures(connection, fixtures_map); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:556 + def cache_for_connection(connection); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:564 + def cached_fixtures(connection, 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 } + # + # pkg:gem/activerecord#lib/active_record/fixtures.rb:631 + def composite_identify(label, key); end + + # Superclass for the evaluation contexts used by \ERB fixtures. + # + # pkg:gem/activerecord#lib/active_record/fixtures.rb:639 + def context_class; end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:591 + def create_fixtures(fixtures_directories, fixture_set_names, class_names = T.unsafe(nil), config = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:540 + def default_fixture_model_name(fixture_set_name, config = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:546 + def default_fixture_table_name(fixture_set_name, config = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:560 + def fixture_is_cached?(connection, 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. + # + # pkg:gem/activerecord#lib/active_record/fixtures.rb:617 + def identify(label, column_type = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:585 + def instantiate_all_loaded_fixtures(object, load_instances = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:576 + def instantiate_fixtures(object, fixture_set, load_instances = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:552 + def reset_cache; end + + private + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:692 + def check_all_foreign_keys_valid!(conn); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:663 + def insert(fixture_sets, connection); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:644 + def read_and_insert(fixtures_directories, fixture_files, class_names, connection); end + + # pkg:gem/activerecord#lib/active_record/fixtures.rb:702 + def update_all_loaded_fixtures(fixtures_map); end + end +end + +# pkg:gem/activerecord#lib/active_record/fixture_set/file.rb:7 +class ActiveRecord::FixtureSet::File + include ::Enumerable + + # pkg:gem/activerecord#lib/active_record/fixture_set/file.rb:19 + def initialize(file); end + + # pkg:gem/activerecord#lib/active_record/fixture_set/file.rb:23 + def each(&block); end + + # pkg:gem/activerecord#lib/active_record/fixture_set/file.rb:31 + def ignored_fixtures; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/file.rb:27 + def model_class; end + + private + + # pkg:gem/activerecord#lib/active_record/fixture_set/file.rb:40 + def config_row; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/file.rb:51 + def raw_rows; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/file.rb:36 + def rows; end + + # Validate our unmarshalled data. + # + # pkg:gem/activerecord#lib/active_record/fixture_set/file.rb:76 + def validate(data); end + + # pkg:gem/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. + # + # pkg:gem/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. +# ++ +# +# pkg:gem/activerecord#lib/active_record/fixtures.rb:533 +ActiveRecord::FixtureSet::MAX_ID = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activerecord#lib/active_record/fixture_set/model_metadata.rb:5 +class ActiveRecord::FixtureSet::ModelMetadata + # pkg:gem/activerecord#lib/active_record/fixture_set/model_metadata.rb:6 + def initialize(model_class); end + + # pkg:gem/activerecord#lib/active_record/fixture_set/model_metadata.rb:29 + def column_names; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/model_metadata.rb:18 + def column_type(column_name); end + + # pkg:gem/activerecord#lib/active_record/fixture_set/model_metadata.rb:25 + def has_column?(column_name); end + + # pkg:gem/activerecord#lib/active_record/fixture_set/model_metadata.rb:37 + def inheritance_column_name; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/model_metadata.rb:10 + def primary_key_name; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/model_metadata.rb:14 + def primary_key_type; end + + # pkg:gem/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. +# +# pkg:gem/activerecord#lib/active_record/fixture_set/render_context.rb:7 +class ActiveRecord::FixtureSet::RenderContext + class << self + # pkg:gem/activerecord#lib/active_record/fixture_set/render_context.rb:8 + def create_subclass; end + end +end + +# pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:5 +class ActiveRecord::FixtureSet::TableRow + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:65 + def initialize(fixture, table_rows:, label:, now:); end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:73 + def to_hash; end + + private + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:186 + def add_join_records(association); end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:136 + def column_defined?(col); end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:86 + def fill_row_model_attributes; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:103 + def fill_timestamps; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:127 + def generate_composite_primary_key; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:119 + def generate_primary_key; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:112 + def interpolate_label; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:82 + def model_class; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:78 + def model_metadata; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:95 + def reflection_class; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:140 + def resolve_enums; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:148 + def resolve_sti_reflections; end +end + +# pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:24 +class ActiveRecord::FixtureSet::TableRow::HasManyThroughProxy < ::ActiveRecord::FixtureSet::TableRow::ReflectionProxy + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:33 + def join_table; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:29 + def lhs_key; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:25 + def rhs_key; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:37 + def timestamp_column_names; end +end + +# pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:42 +class ActiveRecord::FixtureSet::TableRow::PrimaryKeyError < ::StandardError + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:43 + def initialize(label, association, value); end +end + +# pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:6 +class ActiveRecord::FixtureSet::TableRow::ReflectionProxy + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:7 + def initialize(association); end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:11 + def join_table; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:15 + def name; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_row.rb:19 + def primary_key_type; end +end + +# pkg:gem/activerecord#lib/active_record/fixture_set/table_rows.rb:8 +class ActiveRecord::FixtureSet::TableRows + # pkg:gem/activerecord#lib/active_record/fixture_set/table_rows.rb:9 + def initialize(table_name, model_class:, fixtures:); end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_rows.rb:21 + def model_class; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_rows.rb:27 + def model_metadata; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_rows.rb:21 + def tables; end + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_rows.rb:23 + def to_hash; end + + private + + # pkg:gem/activerecord#lib/active_record/fixture_set/table_rows.rb:32 + def build_table_rows_from(table_name, fixtures); end +end + +# pkg:gem/activerecord#lib/active_record/future_result.rb:4 +class ActiveRecord::FutureResult + # pkg:gem/activerecord#lib/active_record/future_result.rb:55 + def initialize(pool, *args, **kwargs); end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:83 + def cancel; end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:124 + def canceled?; end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:50 + def empty?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:79 + def execute!(connection); end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:89 + def execute_or_skip; end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:53 + def lock_wait; end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:51 + def method_missing(method, *args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:120 + def pending?; end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:107 + def result; end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:74 + def schedule!(session); end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:70 + def then(&block); end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:50 + def to_a(*, **, &); end + + private + + # pkg:gem/activerecord#lib/active_record/future_result.rb:152 + def exec_query(connection, *args, **kwargs); end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:129 + def execute_or_wait; end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:144 + def execute_query(connection, async: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:51 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/active_record/future_result.rb:48 +class ActiveRecord::FutureResult::Canceled < ::ActiveRecord::ActiveRecordError; end + +# pkg:gem/activerecord#lib/active_record/future_result.rb:5 +class ActiveRecord::FutureResult::Complete + # pkg:gem/activerecord#lib/active_record/future_result.rb:9 + def initialize(result); end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:17 + def canceled?; end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:7 + def empty?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:13 + def pending?; end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:6 + def result; end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:21 + def then(&block); end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:7 + def to_a(*, **, &); end +end + +# pkg:gem/activerecord#lib/active_record/future_result.rb:26 +class ActiveRecord::FutureResult::EventBuffer + # pkg:gem/activerecord#lib/active_record/future_result.rb:27 + def initialize(future_result, instrumenter); end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:39 + def flush; end + + # pkg:gem/activerecord#lib/active_record/future_result.rb:33 + def instrument(name, payload = T.unsafe(nil), &block); end +end + +# pkg:gem/activerecord#lib/active_record/future_result.rb:156 +class ActiveRecord::FutureResult::SelectAll < ::ActiveRecord::FutureResult + private + + # pkg:gem/activerecord#lib/active_record/future_result.rb:158 + def exec_query(*, **); end +end + +# pkg:gem/activerecord#lib/active_record/associations.rb:74 +class ActiveRecord::HasManyThroughAssociationNotFoundError < ::ActiveRecord::ActiveRecordError + include ::DidYouMean::Correctable + + # pkg:gem/activerecord#lib/active_record/associations.rb:77 + def initialize(owner_class = T.unsafe(nil), reflection = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/associations.rb:90 + def corrections; end + + # pkg:gem/activerecord#lib/active_record/associations.rb:75 + def owner_class; end + + # pkg:gem/activerecord#lib/active_record/associations.rb:75 + def reflection; end +end + +# pkg:gem/activerecord#lib/active_record/associations.rb:124 +class ActiveRecord::HasManyThroughAssociationPointlessSourceTypeError < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/associations.rb:125 + def initialize(owner_class_name = T.unsafe(nil), reflection = T.unsafe(nil), source_reflection = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/active_record/associations.rb:104 +class ActiveRecord::HasManyThroughAssociationPolymorphicSourceError < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/associations.rb:105 + def initialize(owner_class_name = T.unsafe(nil), reflection = T.unsafe(nil), source_reflection = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/active_record/associations.rb:114 +class ActiveRecord::HasManyThroughAssociationPolymorphicThroughError < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/associations.rb:115 + def initialize(owner_class_name = T.unsafe(nil), reflection = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/active_record/associations.rb:218 +class ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection < ::ActiveRecord::ThroughCantAssociateThroughHasOneOrManyReflection; end + +# pkg:gem/activerecord#lib/active_record/associations.rb:234 +class ActiveRecord::HasManyThroughNestedAssociationsAreReadonly < ::ActiveRecord::ThroughNestedAssociationsAreReadonly; end + +# pkg:gem/activerecord#lib/active_record/associations.rb:167 +class ActiveRecord::HasManyThroughOrderError < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/associations.rb:168 + def initialize(owner_class_name = T.unsafe(nil), reflection = T.unsafe(nil), through_reflection = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/active_record/associations.rb:154 +class ActiveRecord::HasManyThroughSourceAssociationNotFoundError < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/associations.rb:155 + def initialize(reflection = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/active_record/associations.rb:144 +class ActiveRecord::HasOneAssociationPolymorphicThroughError < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/associations.rb:145 + def initialize(owner_class_name = T.unsafe(nil), reflection = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/active_record/associations.rb:134 +class ActiveRecord::HasOneThroughCantAssociateThroughCollection < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/associations.rb:135 + def initialize(owner_class_name = T.unsafe(nil), reflection = T.unsafe(nil), through_reflection = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/active_record/associations.rb:221 +class ActiveRecord::HasOneThroughCantAssociateThroughHasOneOrManyReflection < ::ActiveRecord::ThroughCantAssociateThroughHasOneOrManyReflection; end + +# pkg:gem/activerecord#lib/active_record/associations.rb:237 +class ActiveRecord::HasOneThroughNestedAssociationsAreReadonly < ::ActiveRecord::ThroughNestedAssociationsAreReadonly; end + +# pkg:gem/activerecord#lib/active_record/migration.rb:124 +class ActiveRecord::IllegalMigrationNameError < ::ActiveRecord::MigrationError + # pkg:gem/activerecord#lib/active_record/migration.rb:125 + def initialize(name = T.unsafe(nil)); end +end + +# Raised when a relation cannot be mutated because it's already loaded. +# +# class Task < ActiveRecord::Base +# end +# +# relation = Task.all +# relation.loaded? # => true +# +# # Methods which try to mutate a loaded relation fail. +# relation.where!(title: 'TODO') # => ActiveRecord::ImmutableRelation +# relation.limit!(5) # => ActiveRecord::ImmutableRelation +# +# pkg:gem/activerecord#lib/active_record/errors.rb:471 +class ActiveRecord::ImmutableRelation < ::ActiveRecord::ActiveRecordError; 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 +# +# pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/inheritance.rb:357 + def ensure_proper_type; end + + # pkg:gem/activerecord#lib/active_record/inheritance.rb:341 + def initialize_dup(other); end + + # pkg:gem/activerecord#lib/active_record/inheritance.rb:347 + 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 + +# pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/inheritance.rb:164 + def abstract_class=(_arg0); end + + # Returns whether this class is an abstract class or not. + # + # pkg:gem/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 behaviour: + # + # 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 + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/inheritance.rb:82 + def descends_from_active_record?; end + + # pkg:gem/activerecord#lib/active_record/inheritance.rb:224 + def dup; end + + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/inheritance.rb:216 + def polymorphic_class_for(name); end + + # Returns the value to be stored in the polymorphic type column for Polymorphic Associations. + # + # pkg:gem/activerecord#lib/active_record/inheritance.rb:209 + 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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/inheritance.rb:240 + def compute_type(type_name); end + + # pkg:gem/activerecord#lib/active_record/inheritance.rb:268 + 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. + # + # pkg:gem/activerecord#lib/active_record/inheritance.rb:297 + def discriminate_class_for_record(record); end + + # pkg:gem/activerecord#lib/active_record/inheritance.rb:309 + def find_sti_class(type_name); end + + # pkg:gem/activerecord#lib/active_record/inheritance.rb:285 + def inherited(subclass); end + + # pkg:gem/activerecord#lib/active_record/inheritance.rb:232 + 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 + # + # pkg:gem/activerecord#lib/active_record/inheritance.rb:329 + def subclass_from_attributes(attrs); end + + # pkg:gem/activerecord#lib/active_record/inheritance.rb:320 + def type_condition(table = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/inheritance.rb:305 + def using_single_table_inheritance?(record); end +end + +# pkg:gem/activerecord#lib/active_record/insert_all.rb:6 +class ActiveRecord::InsertAll + # pkg:gem/activerecord#lib/active_record/insert_all.rb:10 + def initialize(model, inserts, on_duplicate:, update_only: T.unsafe(nil), returning: T.unsafe(nil), unique_by: T.unsafe(nil), record_timestamps: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:7 + def connection; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:41 + def execute; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:7 + def inserts; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:7 + def keys; end + + # TODO: Consider renaming this method, as it only conditionally extends keys, not always + # + # pkg:gem/activerecord#lib/active_record/insert_all.rb:86 + def keys_including_timestamps; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:67 + def map_key_with_value; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:7 + def model; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:8 + def on_duplicate; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:54 + def primary_keys; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:81 + def record_timestamps?; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:8 + def returning; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:59 + def skip_duplicates?; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:8 + def unique_by; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:50 + def updatable_columns; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:63 + def update_duplicates?; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:8 + def update_only; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:8 + def update_sql; end + + private + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:125 + def configure_on_duplicate_update_logic; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:141 + def custom_update_sql_provided?; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:209 + def disallow_raw_sql!(value); end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:170 + def ensure_valid_options_for_connection!; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:145 + def find_unique_index_for(unique_by); end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:97 + def has_attribute_aliases?(attributes); end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:194 + def readonly_columns; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:121 + def resolve_attribute_alias(attribute); end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:110 + def resolve_attribute_aliases; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:101 + def resolve_sti; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:95 + def scope_attributes; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:218 + def timestamps_for_create; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:189 + def to_sql; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:198 + def unique_by_columns; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:165 + def unique_indexes; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:203 + def verify_attributes(attributes); end +end + +# pkg:gem/activerecord#lib/active_record/insert_all.rb:222 +class ActiveRecord::InsertAll::Builder + # pkg:gem/activerecord#lib/active_record/insert_all.rb:227 + def initialize(insert_all); end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:262 + def conflict_target; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:231 + def into; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:225 + def keys(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:225 + def keys_including_timestamps(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:223 + def model; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:286 + def raw_update_sql; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:290 + def raw_update_sql?; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:225 + def record_timestamps?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:246 + def returning; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:225 + def skip_duplicates?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:276 + def touch_model_timestamps_unless(&block); end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:272 + def updatable_columns; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:225 + def update_duplicates?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:235 + def values_list; end + + private + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:299 + def columns_list; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:293 + def connection; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:303 + def extract_types_from_columns_on(table_name, keys:); end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:312 + def format_columns(columns); end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:293 + def insert_all; end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:320 + def quote_column(column); end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:316 + def quote_columns(columns); end + + # pkg:gem/activerecord#lib/active_record/insert_all.rb:295 + def touch_timestamp_attribute?(column_name); end +end + +# pkg:gem/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) + # + # pkg:gem/activerecord#lib/active_record/integration.rb:72 + def cache_key; end + + # Returns a cache key along with the version. + # + # pkg:gem/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+. + # + # pkg:gem/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" + # + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/integration.rb:197 + 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 + +# pkg:gem/activerecord#lib/active_record/integration.rb:122 +module ActiveRecord::Integration::ClassMethods + # pkg:gem/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 + # + # pkg:gem/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. +# +# pkg:gem/activerecord#lib/active_record/internal_metadata.rb:12 +class ActiveRecord::InternalMetadata + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:18 + def initialize(connection); end + + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:45 + def [](key); end + + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:39 + def []=(key, value); end + + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:16 + def arel_table; end + + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:16 + def connection; end + + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:59 + def count; end + + # Creates an internal metadata table with columns +key+ and +value+ + # + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:75 + def create_table; end + + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:66 + def create_table_and_set_flags(environment, schema_sha1 = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:53 + def delete_all_entries; end + + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:87 + def drop_table; end + + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:23 + def enabled?; end + + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:27 + def primary_key; end + + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:93 + def table_exists?; end + + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:35 + def table_name; end + + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:31 + def value_key; end + + private + + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:116 + def create_entry(key, value); end + + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:112 + def current_time; end + + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:140 + def select_entry(key); end + + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:128 + def update_entry(key, new_value); end + + # pkg:gem/activerecord#lib/active_record/internal_metadata.rb:98 + def update_or_create_entry(key, value); end +end + +# pkg:gem/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. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:213 +class ActiveRecord::InvalidForeignKey < ::ActiveRecord::WrappedDatabaseException; end + +# pkg:gem/activerecord#lib/active_record/associations.rb:33 +class ActiveRecord::InverseOfAssociationNotFoundError < ::ActiveRecord::ActiveRecordError + include ::DidYouMean::Correctable + + # pkg:gem/activerecord#lib/active_record/associations.rb:36 + def initialize(reflection = T.unsafe(nil), associated_class = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/associations.rb:34 + def associated_class; end + + # pkg:gem/activerecord#lib/active_record/associations.rb:49 + def corrections; end + + # pkg:gem/activerecord#lib/active_record/associations.rb:34 + def reflection; end +end + +# pkg:gem/activerecord#lib/active_record/associations.rb:62 +class ActiveRecord::InverseOfAssociationRecursiveError < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/associations.rb:64 + def initialize(reflection = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/associations.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[7.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[7.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[7.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 +# +# pkg:gem/activerecord#lib/active_record/migration.rb:91 +class ActiveRecord::IrreversibleMigration < ::ActiveRecord::MigrationError; end + +# IrreversibleOrderError is raised when a relation's order is too complex for +# +reverse_order+ to automatically reverse. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:530 +class ActiveRecord::IrreversibleOrderError < ::ActiveRecord::ActiveRecordError; end + +# pkg:gem/activerecord#lib/active_record/legacy_yaml_adapter.rb:4 +module ActiveRecord::LegacyYamlAdapter + class << self + # pkg:gem/activerecord#lib/active_record/legacy_yaml_adapter.rb:5 + def convert(coder); end + end +end + +# LockWaitTimeout will be raised when lock wait timeout exceeded. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:538 +class ActiveRecord::LockWaitTimeout < ::ActiveRecord::StatementInvalid; end + +# pkg:gem/activerecord#lib/active_record.rb:143 +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. +# +# pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:205 +class ActiveRecord::Locking::LockingType + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:210 + def deserialize(value); end + + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:222 + def encode_with(coder); end + + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:218 + def init_with(coder); end + + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:214 + def serialize(value); end + + class << self + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:206 + 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 +lock_version+ column 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 +# +# pkg:gem/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 + + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:63 + def increment!(*, **); end + + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:59 + def locking_enabled?; end + + private + + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:142 + def _clear_locking_column; end + + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:78 + def _create_record(attribute_names = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:134 + def _lock_value_for_database(locking_column); end + + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:147 + def _query_constraints_hash; end + + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:87 + def _touch_row(attribute_names, time); end + + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:92 + def _update_row(attribute_names, attempted_action = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:124 + def destroy_row; end + + # pkg:gem/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 + +# pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:154 +module ActiveRecord::Locking::Optimistic::ClassMethods + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:185 + def define_attribute(name, cast_type, **); end + + # The version column used for optimistic locking. Defaults to +lock_version+. + # + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:171 + def locking_column; end + + # Set the column to use for optimistic locking. Defaults to +lock_version+. + # + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:165 + 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+). + # + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:160 + def locking_enabled?; end + + # Reset the column used for optimistic locking back to the +lock_version+ default. + # + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:174 + def reset_locking_column; end + + # Make sure the lock version column gets updated when counters are + # updated. + # + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:180 + def update_counters(id, counters); end + + private + + # pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:193 + def inherited(base); end +end + +# pkg:gem/activerecord#lib/active_record/locking/optimistic.rb:155 +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 +# +# pkg:gem/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. + # + # pkg:gem/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). + # + # pkg:gem/activerecord#lib/active_record/locking/pessimistic.rb:92 + def with_lock(*args); end +end + +# pkg:gem/activerecord#lib/active_record/log_subscriber.rb:4 +class ActiveRecord::LogSubscriber < ::ActiveSupport::LogSubscriber + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:7 + def backtrace_cleaner; end + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:7 + def backtrace_cleaner=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:7 + def backtrace_cleaner?; end + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:39 + def sql(event); end + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:30 + def strict_loading_violation(event); end + + private + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:101 + def colorize_payload_name(name, payload_name); end + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:134 + def debug(progname = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:164 + def filter(name, value); end + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:142 + def log_query_source; end + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:130 + def logger; end + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:151 + def query_source_location; end + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:86 + def render_bind(attr, value); end + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:109 + def sql_color(sql); end + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:82 + def type_casted_binds(casted_binds); end + + class << self + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:7 + def backtrace_cleaner; end + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:7 + def backtrace_cleaner=(value); end + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:7 + def backtrace_cleaner?; end + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:37 + def log_levels; end + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:23 + def reset_runtime; end + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:16 + def runtime; end + + # pkg:gem/activerecord#lib/active_record/log_subscriber.rb:9 + def runtime=(value); end + end +end + +# pkg:gem/activerecord#lib/active_record/log_subscriber.rb:5 +ActiveRecord::LogSubscriber::IGNORE_PAYLOAD_NAMES = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/active_record/marshalling.rb:4 +module ActiveRecord::Marshalling + class << self + # pkg:gem/activerecord#lib/active_record/marshalling.rb:8 + def format_version; end + + # pkg:gem/activerecord#lib/active_record/marshalling.rb:10 + def format_version=(version); end + end +end + +# pkg:gem/activerecord#lib/active_record/marshalling.rb:23 +module ActiveRecord::Marshalling::Methods + # pkg:gem/activerecord#lib/active_record/marshalling.rb:24 + def _marshal_dump_7_1; end + + # pkg:gem/activerecord#lib/active_record/marshalling.rb:40 + def marshal_load(state); end +end + +# pkg:gem/activerecord#lib/active_record.rb:161 +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+ +# +# pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver/session.rb:5 +class ActiveRecord::Middleware::DatabaseSelector + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/middleware/database_selector.rb:63 + def call(env); end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector.rb:59 + def context_klass; end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector.rb:59 + def options; end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector.rb:59 + def resolver_klass; end + + private + + # pkg:gem/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. +# +# pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver/session.rb:6 +class ActiveRecord::Middleware::DatabaseSelector::Resolver + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver.rb:26 + def initialize(context, options = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver.rb:33 + def context; end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver.rb:33 + def delay; end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver.rb:33 + def instrumenter; end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver.rb:35 + def read(&blk); end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver.rb:51 + def reading_request?(request); end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver.rb:47 + def update_context(response); end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver.rb:43 + def write(&blk); end + + private + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver.rb:56 + def read_from_primary(&blk); end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver.rb:78 + def read_from_primary?; end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver.rb:62 + def read_from_replica(&blk); end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver.rb:82 + def send_to_replica_delay; end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver.rb:86 + def time_since_last_write_ok?; end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver.rb:68 + def write_to_primary; end + + class << self + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver.rb:22 + def call(context, options = T.unsafe(nil)); end + end +end + +# pkg:gem/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. +# +# pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver/session.rb:12 +class ActiveRecord::Middleware::DatabaseSelector::Resolver::Session + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver/session.rb:28 + def initialize(session); end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver/session.rb:34 + def last_write_timestamp; end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver/session.rb:42 + def save(response); end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver/session.rb:32 + def session; end + + # pkg:gem/activerecord#lib/active_record/middleware/database_selector/resolver/session.rb:38 + def update_last_write_timestamp; end + + class << self + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. +# +# The ShardSelector takes a set of options (currently only +lock+ is supported) +# that can be used by the middleware to alter behavior. +lock+ is +# true by default and will prohibit the request from switching shards once +# inside the block. If +lock+ is false, then shard swapping will be allowed. +# For tenant based sharding, +lock+ should always be true to prevent application +# code from mistakenly switching between tenants. +# +# Options can be set in the config: +# +# config.active_record.shard_selector = { lock: true } +# +# Applications must also provide the code for the resolver as it depends on application +# specific models. An example resolver would look like this: +# +# config.active_record.shard_resolver = ->(request) { +# subdomain = request.subdomain +# tenant = Tenant.find_by_subdomain!(subdomain) +# tenant.shard +# } +# +# pkg:gem/activerecord#lib/active_record/middleware/shard_selector.rb:31 +class ActiveRecord::Middleware::ShardSelector + # pkg:gem/activerecord#lib/active_record/middleware/shard_selector.rb:32 + def initialize(app, resolver, options = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/middleware/shard_selector.rb:40 + def call(env); end + + # pkg:gem/activerecord#lib/active_record/middleware/shard_selector.rb:38 + def options; end + + # pkg:gem/activerecord#lib/active_record/middleware/shard_selector.rb:38 + def resolver; end + + private + + # pkg:gem/activerecord#lib/active_record/middleware/shard_selector.rb:51 + def selected_shard(request); end + + # pkg:gem/activerecord#lib/active_record/middleware/shard_selector.rb:55 + 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[7.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[7.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(name): Drops the table called +name+. +# * 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[7.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[7.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[7.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[7.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[7.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). +# +# 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[7.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[7.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!. +# +# pkg:gem/activerecord#lib/active_record/migration.rb:555 +class ActiveRecord::Migration + # pkg:gem/activerecord#lib/active_record/migration.rb:796 + def initialize(name = T.unsafe(nil), version = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1000 + def announce(message); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1031 + def connection; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1052 + def copy(destination, sources, options = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:789 + def disable_ddl_transaction; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:952 + def down; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:980 + def exec_migration(conn, direction); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:802 + def execution_strategy; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1035 + def method_missing(method, *arguments, **, &block); end + + # Execute this migration in the named direction + # + # pkg:gem/activerecord#lib/active_record/migration.rb:959 + def migrate(direction); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:794 + def name; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:794 + def name=(_arg0); end + + # Determines the version number of the next migration. + # + # pkg:gem/activerecord#lib/active_record/migration.rb:1119 + 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. + # + # pkg:gem/activerecord#lib/active_record/migration.rb:1110 + 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[7.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 + # + # pkg:gem/activerecord#lib/active_record/migration.rb:904 + 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[7.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[7.1] + # def change + # revert TenderloveMigration + # + # create_table(:apples) do |t| + # t.string :variety + # end + # end + # end + # + # This command can be nested. + # + # pkg:gem/activerecord#lib/active_record/migration.rb:847 + def revert(*migration_classes, &block); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:864 + def reverting?; end + + # Runs the given migration classes. + # Last argument can specify options: + # + # - +:direction+ - Default is +:up+. + # - +:revert+ - Default is +false+. + # + # pkg:gem/activerecord#lib/active_record/migration.rb:932 + 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. + # + # pkg:gem/activerecord#lib/active_record/migration.rb:1008 + 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. + # + # pkg:gem/activerecord#lib/active_record/migration.rb:1014 + def say_with_time(message); end + + # Takes a block as an argument and suppresses any output generated by the block. + # + # pkg:gem/activerecord#lib/active_record/migration.rb:1024 + 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 + # + # pkg:gem/activerecord#lib/active_record/migration.rb:1129 + def table_name_options(config = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:946 + 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[7.1] + # def change + # add_column :posts, :published, :boolean, default: false + # up_only do + # execute "update posts set published = 'true'" + # end + # end + # end + # + # pkg:gem/activerecord#lib/active_record/migration.rb:923 + def up_only(&block); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:793 + def verbose; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:793 + def verbose=(val); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:794 + def version; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:794 + def version=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:996 + def write(text = T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/active_record/migration.rb:1161 + def command_recorder; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1137 + def execute_block; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1145 + def format_arguments(arguments); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1157 + def internal_option?(option_name); end + + class << self + # pkg:gem/activerecord#lib/active_record/migration.rb:613 + def [](version); end + + # Raises ActiveRecord::PendingMigrationError error if any migrations are pending + # for all database configurations in an environment. + # + # pkg:gem/activerecord#lib/active_record/migration.rb:698 + def check_all_pending!; end + + # Raises ActiveRecord::PendingMigrationError error if any migrations are pending. + # + # This is deprecated in favor of +check_all_pending!+ + # + # pkg:gem/activerecord#lib/active_record/migration.rb:682 + def check_pending!(connection = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:751 + def check_pending_migrations; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:617 + def current_version; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:672 + def delegate; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:672 + def delegate=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:673 + 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]. + # + # pkg:gem/activerecord#lib/active_record/migration.rb:747 + def disable_ddl_transaction!; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:673 + def disable_ddl_transaction=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:601 + def inherited(subclass); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:714 + def load_schema_if_pending!; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:728 + def maintain_test_schema!; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:734 + def method_missing(name, *args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:739 + def migrate(direction); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:675 + def nearest_delegate; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:623 + def valid_version_format?(version_string); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:793 + def verbose; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:793 + def verbose=(val); end + + private + + # pkg:gem/activerecord#lib/active_record/migration.rb:760 + def any_schema_needs_update?; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:766 + def db_configs_in_current_env; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:784 + def env; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:770 + def pending_migrations; 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+. +# +# pkg:gem/activerecord#lib/active_record/migration.rb:632 +class ActiveRecord::Migration::CheckPending + # pkg:gem/activerecord#lib/active_record/migration.rb:633 + def initialize(app, file_watcher: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:640 + def call(env); end + + private + + # pkg:gem/activerecord#lib/active_record/migration.rb:659 + def build_watcher(&block); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:666 + def connection; 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_table +# * disable_extension +# * drop_enum (must supply a list of values) +# * drop_join_table +# * 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 (must supply a +:to+ option) +# * rename_enum_value (must supply a +:from+ and +:to+ option) +# * rename_index +# * rename_table +# +# pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:45 +class ActiveRecord::Migration::CommandRecorder + include ::ActiveRecord::Migration::JoinTable + include ::ActiveRecord::Migration::CommandRecorder::StraightReversions + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:63 + def initialize(delegate = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:129 + def add_belongs_to(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def add_check_constraint(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def add_column(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def add_enum_value(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def add_exclusion_constraint(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def add_foreign_key(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def add_index(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def add_reference(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def add_timestamps(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def add_unique_constraint(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def change_column(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def change_column_comment(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def change_column_default(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def change_column_null(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:132 + def change_table(table_name, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def change_table_comment(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:61 + def commands; end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:61 + def commands=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def create_enum(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def create_join_table(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def create_table(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:61 + def delegate; end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:61 + def delegate=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def disable_extension(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def drop_enum(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def drop_join_table(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def drop_table(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def enable_extension(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def execute(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def execute_block(*args, **, &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+. + # + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:110 + def inverse_of(command, args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:256 + def invert_add_belongs_to(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:257 + 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]) + # + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:90 + def record(*command, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:130 + def remove_belongs_to(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def remove_check_constraint(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def remove_column(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def remove_columns(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def remove_exclusion_constraint(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def remove_foreign_key(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def remove_index(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def remove_reference(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def remove_timestamps(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def remove_unique_constraint(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def rename_column(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def rename_enum(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def rename_enum_value(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def rename_index(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def rename_table(*args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:144 + 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]) + # + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:76 + def revert; end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:61 + def reverting; end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:61 + def reverting=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:122 + def transaction(*args, **, &block); end + + private + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:313 + def invert_add_check_constraint(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:274 + def invert_add_foreign_key(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:335 + def invert_add_unique_constraint(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:293 + def invert_change_column_comment(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:259 + def invert_change_column_default(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:269 + def invert_change_column_null(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:303 + def invert_change_table_comment(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:191 + def invert_create_table(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:349 + def invert_drop_enum(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:198 + def invert_drop_table(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:321 + def invert_remove_check_constraint(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:215 + def invert_remove_column(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:220 + def invert_remove_columns(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:330 + def invert_remove_exclusion_constraint(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:279 + def invert_remove_foreign_key(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:238 + def invert_remove_index(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:342 + def invert_remove_unique_constraint(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:233 + def invert_rename_column(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:355 + def invert_rename_enum(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:365 + def invert_rename_enum_value(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:228 + def invert_rename_index(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:208 + def invert_rename_table(args); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:180 + def invert_transaction(args, &block); end + + # Forwards any missing method call to the \target. + # + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:380 + def method_missing(method, *args, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:375 + def respond_to_missing?(method, _); end +end + +# pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:46 +ActiveRecord::Migration::CommandRecorder::ReversibleAndIrreversibleMethods = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:151 +module ActiveRecord::Migration::CommandRecorder::StraightReversions + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_add_check_constraint(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_add_column(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_add_exclusion_constraint(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_add_foreign_key(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_add_index(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_add_reference(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_add_timestamps(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_add_unique_constraint(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_create_enum(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_create_join_table(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_create_table(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_disable_extension(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_drop_enum(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_drop_join_table(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_drop_table(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_enable_extension(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_execute_block(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_remove_check_constraint(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_remove_column(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_remove_exclusion_constraint(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_remove_foreign_key(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_remove_index(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_remove_reference(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_remove_timestamps(args, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/command_recorder.rb:169 + def invert_remove_unique_constraint(args, &block); end +end + +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:5 +module ActiveRecord::Migration::Compatibility + class << self + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:6 + def find(version); end + end +end + +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:405 +class ActiveRecord::Migration::Compatibility::V4_2 < ::ActiveRecord::Migration::Compatibility::V5_0 + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:427 + def add_belongs_to(table_name, ref_name, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:423 + def add_reference(table_name, ref_name, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:429 + def add_timestamps(table_name, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:434 + def index_exists?(table_name, column_name, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:445 + def remove_index(table_name, column_name = T.unsafe(nil), **options); end + + private + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:451 + def compatible_table_definition(t); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:458 + def index_name_for_remove(table_name, column_name, options); end +end + +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:406 +module ActiveRecord::Migration::Compatibility::V4_2::TableDefinition + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:411 + def belongs_to(*, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:407 + def references(*, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:413 + def timestamps(**options); end + + private + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:419 + def raise_on_if_exist_options(options); end +end + +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:336 +class ActiveRecord::Migration::Compatibility::V5_0 < ::ActiveRecord::Migration::Compatibility::V5_1 + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:394 + def add_belongs_to(table_name, ref_name, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:381 + def add_column(table_name, column_name, type, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:391 + def add_reference(table_name, ref_name, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:376 + def create_join_table(table_1, table_2, column_options: T.unsafe(nil), **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:353 + def create_table(table_name, **options); end + + private + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:397 + def compatible_table_definition(t); end +end + +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:337 +module ActiveRecord::Migration::Compatibility::V5_0::TableDefinition + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:346 + def belongs_to(*args, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:338 + def primary_key(name, type = T.unsafe(nil), **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:343 + def references(*args, **options); end + + private + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:349 + def raise_on_if_exist_options(options); end +end + +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:315 +class ActiveRecord::Migration::Compatibility::V5_1 < ::ActiveRecord::Migration::Compatibility::V5_2 + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:316 + def change_column(table_name, column_name, type, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:327 + def create_table(table_name, **options); end +end + +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:259 +class ActiveRecord::Migration::Compatibility::V5_2 < ::ActiveRecord::Migration::Compatibility::V6_0 + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:293 + def add_timestamps(table_name, **options); end + + private + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:306 + def command_recorder; end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:299 + def compatible_table_definition(t); end +end + +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:279 +module ActiveRecord::Migration::Compatibility::V5_2::CommandRecorder + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:284 + def invert_change_column_comment(args); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:288 + def invert_change_table_comment(args); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:280 + def invert_transaction(args, &block); end +end + +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:260 +module ActiveRecord::Migration::Compatibility::V5_2::TableDefinition + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:266 + def column(name, type, index: T.unsafe(nil), **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:261 + def timestamps(**options); end + + private + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:275 + def raise_on_duplicate_column(name); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:272 + def raise_on_if_exist_options(options); end +end + +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:216 +class ActiveRecord::Migration::Compatibility::V6_0 < ::ActiveRecord::Migration::Compatibility::V6_1 + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:248 + def add_belongs_to(table_name, ref_name, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:240 + def add_reference(table_name, ref_name, **options); end + + private + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:251 + def compatible_table_definition(t); end +end + +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:217 +class ActiveRecord::Migration::Compatibility::V6_0::ReferenceDefinition < ::ActiveRecord::ConnectionAdapters::ReferenceDefinition + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:218 + def index_options(table_name); end +end + +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:223 +module ActiveRecord::Migration::Compatibility::V6_0::TableDefinition + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:228 + def belongs_to(*args, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:230 + def column(name, type, index: T.unsafe(nil), **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:224 + def references(*args, **options); end + + private + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:236 + def raise_on_if_exist_options(options); end +end + +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:153 +class ActiveRecord::Migration::Compatibility::V6_1 < ::ActiveRecord::Migration::Compatibility::V7_0 + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:168 + def add_column(table_name, column_name, type, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:177 + def change_column(table_name, column_name, type, **options); end + + private + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:208 + def compatible_table_definition(t); end +end + +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:154 +class ActiveRecord::Migration::Compatibility::V6_1::PostgreSQLCompat + class << self + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:155 + def compatible_timestamp_type(type, connection); end + end +end + +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:186 +module ActiveRecord::Migration::Compatibility::V6_1::TableDefinition + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:192 + def change(name, type, index: T.unsafe(nil), **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:197 + def column(name, type, index: T.unsafe(nil), **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:187 + def new_column_definition(name, type, **options); end + + private + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:203 + def raise_on_if_exist_options(options); end +end + +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:35 +class ActiveRecord::Migration::Compatibility::V7_0 < ::ActiveRecord::Migration::Current + include ::ActiveRecord::Migration::Compatibility::V7_0::LegacyIndexName + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:104 + def add_belongs_to(table_name, ref_name, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:90 + def add_column(table_name, column_name, type, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:137 + def add_foreign_key(from_table, to_table, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:95 + def add_index(table_name, column_name, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:100 + def add_reference(table_name, ref_name, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:118 + def change_column(table_name, column_name, type, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:126 + def change_column_null(table_name, column_name, null, default = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:106 + def create_table(table_name, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:130 + def disable_extension(name, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:113 + def rename_table(table_name, new_name, **options); end + + private + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:145 + def compatible_table_definition(t); end +end + +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:36 +module ActiveRecord::Migration::Compatibility::V7_0::LegacyIndexName + private + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:60 + def expression_column_name?(column_name); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:52 + def index_name_options(column_names); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:38 + def legacy_index_name(table_name, options); end +end + +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:65 +module ActiveRecord::Migration::Compatibility::V7_0::TableDefinition + include ::ActiveRecord::Migration::Compatibility::V7_0::LegacyIndexName + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:73 + def change(name, type, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:68 + def column(name, type, **options); end + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:78 + def index(column_name, **options); end + + private + + # pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:84 + def raise_on_if_exist_options(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: +# 7.0 < 7.1 +# 5.2 < 6.0 < 6.1 < 7.0 < 7.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. +# +# pkg:gem/activerecord#lib/active_record/migration/compatibility.rb:33 +ActiveRecord::Migration::Compatibility::V7_1 = ActiveRecord::Migration::Current + +# This must be defined before the inherited hook, below +# +# pkg:gem/activerecord#lib/active_record/migration.rb:563 +class ActiveRecord::Migration::Current < ::ActiveRecord::Migration + # pkg:gem/activerecord#lib/active_record/migration.rb:572 + def change_table(table_name, **options); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:596 + def compatible_table_definition(t); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:580 + def create_join_table(table_1, table_2, **options); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:564 + def create_table(table_name, **options); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:588 + def drop_table(table_name, **options); end +end + +# The default strategy for executing migrations. Delegates method calls +# to the connection adapter. +# +# pkg:gem/activerecord#lib/active_record/migration/default_strategy.rb:7 +class ActiveRecord::Migration::DefaultStrategy < ::ActiveRecord::Migration::ExecutionStrategy + private + + # pkg:gem/activerecord#lib/active_record/migration/default_strategy.rb:18 + def connection; end + + # pkg:gem/activerecord#lib/active_record/migration/default_strategy.rb:9 + def method_missing(method, *arguments, **, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/default_strategy.rb:14 + def respond_to_missing?(method, *); 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. +# +# pkg:gem/activerecord#lib/active_record/migration/execution_strategy.rb:10 +class ActiveRecord::Migration::ExecutionStrategy + # pkg:gem/activerecord#lib/active_record/migration/execution_strategy.rb:11 + def initialize(migration); end + + private + + # pkg:gem/activerecord#lib/active_record/migration/execution_strategy.rb:16 + def migration; end +end + +# pkg:gem/activerecord#lib/active_record/migration/join_table.rb:5 +module ActiveRecord::Migration::JoinTable + private + + # pkg:gem/activerecord#lib/active_record/migration/join_table.rb:7 + def find_join_table_name(table_1, table_2, options = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/migration/join_table.rb:11 + def join_table_name(table_1, table_2); end +end + +# pkg:gem/activerecord#lib/active_record/migration.rb:621 +ActiveRecord::Migration::MigrationFilenameRegexp = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activerecord#lib/active_record/migration.rb:868 +class ActiveRecord::Migration::ReversibleBlockHelper < ::Struct + # pkg:gem/activerecord#lib/active_record/migration.rb:873 + def down; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:868 + def reverting; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:868 + def reverting=(_); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:869 + def up; end + + class << self + # pkg:gem/activerecord#lib/active_record/migration.rb:868 + def [](*_arg0); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:868 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:868 + def keyword_init?; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:868 + def members; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:868 + 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. +# +# pkg:gem/activerecord#lib/active_record/migration.rb:1202 +class ActiveRecord::MigrationContext + # pkg:gem/activerecord#lib/active_record/migration.rb:1205 + def initialize(migrations_paths, schema_migration = T.unsafe(nil), internal_metadata = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1347 + def current_environment; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1303 + def current_version; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1277 + def down(target_version = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1263 + def forward(steps = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1295 + def get_all_versions; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1203 + def internal_metadata; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1355 + 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+. + # + # pkg:gem/activerecord#lib/active_record/migration.rb:1246 + def migrate(target_version = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1316 + def migrations; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1203 + def migrations_paths; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1329 + def migrations_status; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1308 + def needs_migration?; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1291 + def open; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1312 + def pending_migration_versions; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1351 + def protected_environment?; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1259 + def rollback(steps = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1287 + def run(direction, target_version); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1203 + def schema_migration; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1267 + def up(target_version = T.unsafe(nil), &block); end + + private + + # pkg:gem/activerecord#lib/active_record/migration.rb:1366 + def connection; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1370 + def migration_files; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1379 + def move(direction, steps); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1375 + def parse_migration_filename(filename); end +end + +# pkg:gem/activerecord#lib/active_record/migration.rb:13 +class ActiveRecord::MigrationError < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/migration.rb:14 + def initialize(message = T.unsafe(nil)); end +end + +# MigrationProxy is used to defer loading of the actual migration classes +# until they are needed +# +# pkg:gem/activerecord#lib/active_record/migration.rb:1168 +class ActiveRecord::MigrationProxy < ::Struct + # pkg:gem/activerecord#lib/active_record/migration.rb:1169 + def initialize(name, version, filename, scope); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1178 + def announce(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1174 + def basename; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1178 + def disable_ddl_transaction(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1168 + def filename; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1168 + def filename=(_); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1178 + def migrate(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1168 + def name; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1168 + def name=(_); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1168 + def scope; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1168 + def scope=(_); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1168 + def version; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1168 + def version=(_); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1178 + def write(*, **, &); end + + private + + # pkg:gem/activerecord#lib/active_record/migration.rb:1185 + def load_migration; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1181 + def migration; end + + class << self + # pkg:gem/activerecord#lib/active_record/migration.rb:1168 + def [](*_arg0); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1168 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1168 + def keyword_init?; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1168 + def members; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1168 + def new(*_arg0); end + end +end + +# pkg:gem/activerecord#lib/active_record/migration.rb:1399 +class ActiveRecord::Migrator + # pkg:gem/activerecord#lib/active_record/migration.rb:1415 + def initialize(direction, migrations, schema_migration, internal_metadata, target_version = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1436 + def current; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1433 + def current_migration; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1429 + def current_version; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1478 + def load_migrated; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1446 + def migrate; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1474 + def migrated; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1465 + def migrations; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1469 + def pending_migrations; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1438 + def run; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1454 + def runnable; end + + private + + # pkg:gem/activerecord#lib/active_record/migration.rb:1483 + def connection; end + + # Wrap the migration in a transaction only if supported by the adapter. + # + # pkg:gem/activerecord#lib/active_record/migration.rb:1578 + def ddl_transaction(migration, &block); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1573 + def down?; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1522 + def execute_migration_in_transaction(migration); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1543 + def finish; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1610 + def generate_migrator_advisory_lock_id; end + + # Return true if a valid version is not provided. + # + # pkg:gem/activerecord#lib/active_record/migration.rb:1518 + def invalid_target?; end + + # Used for running multiple migrations up to or down to a certain value. + # + # pkg:gem/activerecord#lib/active_record/migration.rb:1497 + def migrate_without_lock; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1513 + def ran?(migration); end + + # Stores the current environment in the database. + # + # pkg:gem/activerecord#lib/active_record/migration.rb:1507 + def record_environment; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1559 + def record_version_state_after_migrating(version); end + + # Used for running a specific migration. + # + # pkg:gem/activerecord#lib/active_record/migration.rb:1488 + def run_without_lock; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1547 + def start; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1539 + def target; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1569 + def up?; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1590 + def use_advisory_lock?; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1586 + def use_transaction?(migration); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1551 + def validate(migrations); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1594 + def with_advisory_lock; end + + class << self + # For cases where a table doesn't exist like loading from schema cache + # + # pkg:gem/activerecord#lib/active_record/migration.rb:1404 + def current_version; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1401 + def migrations_paths; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:1401 + def migrations_paths=(_arg0); end + end +end + +# pkg:gem/activerecord#lib/active_record/migration.rb:1609 +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. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:217 +class ActiveRecord::MismatchedForeignKey < ::ActiveRecord::StatementInvalid + # pkg:gem/activerecord#lib/active_record/errors.rb:218 + 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 + + # pkg:gem/activerecord#lib/active_record/errors.rb:254 + def set_query(sql, binds); end +end + +# pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:191 + 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 + +# pkg:gem/activerecord#lib/active_record/model_schema.rb:195 +module ActiveRecord::ModelSchema::ClassMethods + # pkg:gem/activerecord#lib/active_record/model_schema.rb:498 + def _default_attributes; end + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:434 + def _returning_columns_for_insert; end + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:440 + def attribute_types; end + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:416 + 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. + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:493 + 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) + # # => #, ...> + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:484 + def column_for_attribute(name); end + + # Returns an array of column names as strings. + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:504 + def column_names; end + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:429 + def columns; end + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:424 + 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. + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:515 + def content_columns; end + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:298 + def full_table_name_prefix; end + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:302 + 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. + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:327 + 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 + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:362 + def ignored_columns=(columns); end + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:558 + def load_schema; end + + # Returns the next value that will be used as the primary key on + # an insert statement. + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:407 + def next_sequence_value; end + + # Determines if the primary key values should be selected from their + # corresponding sequence before the insert statement. + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:401 + def prefetch_primary_key?; end + + # The array of names of environments where destructive actions should be prohibited. By default, + # the value is ["production"]. + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:308 + def protected_environments; end + + # Sets an array of names of environments where destructive actions should be prohibited. + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:317 + def protected_environments=(environments); end + + # Returns a quoted version of the table name, used to construct SQL statements. + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:281 + def quoted_table_name; end + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:321 + 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[7.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 + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:549 + def reset_column_information; end + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:375 + def reset_sequence_name; end + + # Computes the table name, (re)sets it internally, and returns it. + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:286 + def reset_table_name; end + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:367 + 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 + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:394 + def sequence_name=(value); end + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:508 + def symbol_column_to_string(name_symbol); end + + # Indicates whether the table associated with this class exists + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:412 + 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 + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:255 + def table_name; end + + # Sets the table name explicitly. Example: + # + # class Project < ActiveRecord::Base + # self.table_name = "project" + # end + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:265 + def table_name=(value); end + + # Returns the type of the attribute with the given name, after applying + # all modifiers. This method is the only valid source of information for + # anything related to the types of a model's attributes. This method will + # access the database and load the model's schema if it is required. + # + # The return value of this method will implement the interface described + # by ActiveModel::Type::Value (though the object itself may not subclass + # it). + # + # +attr_name+ The name of the attribute to retrieve the type for. Must be + # a string or a symbol. + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:460 + def type_for_attribute(attr_name, &block); end + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:445 + def yaml_encoder; end + + protected + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:573 + def initialize_load_schema_monitor; end + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:577 + def reload_schema_from_cache(recursive = T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:657 + def _convert_type_from_options(type); end + + # Computes and returns a table name according to default conventions. + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:641 + def compute_table_name; end + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:600 + def inherited(child_class); end + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:613 + def load_schema!; end + + # pkg:gem/activerecord#lib/active_record/model_schema.rb:609 + def schema_loaded?; end + + # Guesses the table name, but does not decorate it with prefix and suffix information. + # + # pkg:gem/activerecord#lib/active_record/model_schema.rb:635 + 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: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. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:436 +class ActiveRecord::MultiparameterAssignmentErrors < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/errors.rb:439 + def initialize(errors = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/errors.rb:437 + def errors; end +end + +# pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/nested_attributes.rb:401 + def _destroy; end + + private + + # pkg:gem/activerecord#lib/active_record/nested_attributes.rb:606 + 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 } + # ]) + # + # pkg:gem/activerecord#lib/active_record/nested_attributes.rb:482 + 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. + # + # pkg:gem/activerecord#lib/active_record/nested_attributes.rb:423 + 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+. + # + # pkg:gem/activerecord#lib/active_record/nested_attributes.rb:568 + 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. + # + # pkg:gem/activerecord#lib/active_record/nested_attributes.rb:590 + 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. + # + # pkg:gem/activerecord#lib/active_record/nested_attributes.rb:548 + def check_record_limit!(limit, attributes_collection); end + + # Determines if a hash contains a truthy _destroy key. + # + # pkg:gem/activerecord#lib/active_record/nested_attributes.rb:574 + def has_destroy_flag?(hash); end + + # pkg:gem/activerecord#lib/active_record/nested_attributes.rb:610 + 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+. + # + # pkg:gem/activerecord#lib/active_record/nested_attributes.rb:581 + def reject_new_record?(association_name, attributes); end + + # Only take into account the destroy flag if :allow_destroy is true + # + # pkg:gem/activerecord#lib/active_record/nested_attributes.rb:602 + 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' } +# } +# } +# } +# +# pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/nested_attributes.rb:386 + def generate_association_writer(association_name, type); end +end + +# pkg:gem/activerecord#lib/active_record/nested_attributes.rb:302 +ActiveRecord::NestedAttributes::ClassMethods::REJECT_ALL_BLANK_PROC = T.let(T.unsafe(nil), Proc) + +# pkg:gem/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. +# +# pkg:gem/activerecord#lib/active_record/nested_attributes.rb:408 +ActiveRecord::NestedAttributes::UNASSIGNABLE_KEYS = T.let(T.unsafe(nil), Array) + +# Raised when a given database does not exist. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:307 +class ActiveRecord::NoDatabaseError < ::ActiveRecord::StatementInvalid + include ::ActiveSupport::ActionableError + extend ::ActiveSupport::ActionableError::ClassMethods + + # pkg:gem/activerecord#lib/active_record/errors.rb:314 + def initialize(message = T.unsafe(nil), connection_pool: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/errors.rb:308 + def _actions; end + + # pkg:gem/activerecord#lib/active_record/errors.rb:308 + def _actions=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/errors.rb:308 + def _actions?; end + + class << self + # pkg:gem/activerecord#lib/active_record/errors.rb:308 + def _actions; end + + # pkg:gem/activerecord#lib/active_record/errors.rb:308 + def _actions=(value); end + + # pkg:gem/activerecord#lib/active_record/errors.rb:308 + def _actions?; end + + # pkg:gem/activerecord#lib/active_record/errors.rb:319 + def db_error(db_name); end + end +end + +# pkg:gem/activerecord#lib/active_record/migration.rb:184 +class ActiveRecord::NoEnvironmentInSchemaError < ::ActiveRecord::MigrationError + # pkg:gem/activerecord#lib/active_record/migration.rb:185 + def initialize; end +end + +# = Active Record No Touching +# +# pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/no_touching.rb:53 + def no_touching?; end + + # pkg:gem/activerecord#lib/active_record/no_touching.rb:61 + def touch(*, **); end + + # pkg:gem/activerecord#lib/active_record/no_touching.rb:57 + def touch_later(*); end + + class << self + # pkg:gem/activerecord#lib/active_record/no_touching.rb:36 + def applied_to?(klass); end + + # pkg:gem/activerecord#lib/active_record/no_touching.rb:29 + def apply_to(klass); end + + private + + # pkg:gem/activerecord#lib/active_record/no_touching.rb:41 + def klasses; end + end +end + +# pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/no_touching.rb:23 + def no_touching(&block); end +end + +# pkg:gem/activerecord#lib/active_record/normalization.rb:4 +module ActiveRecord::Normalization + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::ActiveRecord::Normalization::ClassMethods + + # Normalizes a specified attribute using its declared normalizations. + # + # ==== Examples + # + # class User < ActiveRecord::Base + # normalizes :email, with: -> email { email.strip.downcase } + # end + # + # legacy_user = User.find(1) + # legacy_user.email # => " CRUISE-CONTROL@EXAMPLE.COM\n" + # legacy_user.normalize_attribute(:email) + # legacy_user.email # => "cruise-control@example.com" + # legacy_user.save + # + # pkg:gem/activerecord#lib/active_record/normalization.rb:26 + def normalize_attribute(name); end + + private + + # pkg:gem/activerecord#lib/active_record/normalization.rb:114 + def normalize_changed_in_place_attributes; end + + module GeneratedClassMethods + def normalized_attributes; end + def normalized_attributes=(value); end + def normalized_attributes?; end + end + + module GeneratedInstanceMethods + def normalized_attributes; end + def normalized_attributes=(value); end + def normalized_attributes?; end + end +end + +# pkg:gem/activerecord#lib/active_record/normalization.rb:31 +module ActiveRecord::Normalization::ClassMethods + # Normalizes a given +value+ using normalizations declared for +name+. + # + # ==== Examples + # + # class User < ActiveRecord::Base + # normalizes :email, with: -> email { email.strip.downcase } + # end + # + # User.normalize_value_for(:email, " CRUISE-CONTROL@EXAMPLE.COM\n") + # # => "cruise-control@example.com" + # + # pkg:gem/activerecord#lib/active_record/normalization.rb:108 + 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 updated, and the normalized + # value will be persisted to the database. The normalization is also + # applied to the corresponding keyword argument of query methods. This + # allows a record to be created and later queried using unnormalized + # values. + # + # However, to prevent confusion, the 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. + # + # 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. + # + # 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+. + # + # ==== 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 < 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" + # + # pkg:gem/activerecord#lib/active_record/normalization.rb:88 + def normalizes(*names, with:, apply_to_nil: T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/active_record/normalization.rb:120 +class ActiveRecord::Normalization::NormalizedValueType + include ::ActiveModel::Type::SerializeCastValue + extend ::ActiveModel::Type::SerializeCastValue::ClassMethods + + # pkg:gem/activerecord#lib/active_record/normalization.rb:126 + def initialize(cast_type:, normalizer:, normalize_nil:); end + + # pkg:gem/activerecord#lib/active_record/normalization.rb:145 + def ==(other); end + + # pkg:gem/activerecord#lib/active_record/normalization.rb:133 + def cast(value); end + + # pkg:gem/activerecord#lib/active_record/normalization.rb:123 + def cast_type; end + + # pkg:gem/activerecord#lib/active_record/normalization.rb:151 + def eql?(other); end + + # pkg:gem/activerecord#lib/active_record/normalization.rb:153 + def hash; end + + # pkg:gem/activerecord#lib/active_record/normalization.rb:157 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/normalization.rb:123 + def normalize_nil; end + + # pkg:gem/activerecord#lib/active_record/normalization.rb:124 + def normalize_nil?; end + + # pkg:gem/activerecord#lib/active_record/normalization.rb:123 + def normalizer; end + + # pkg:gem/activerecord#lib/active_record/normalization.rb:137 + def serialize(value); end + + # pkg:gem/activerecord#lib/active_record/normalization.rb:141 + def serialize_cast_value(value); end + + private + + # pkg:gem/activerecord#lib/active_record/normalization.rb:162 + def normalize(value); end +end + +# Raised when a record cannot be inserted or updated because it would violate a not null constraint. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:272 +class ActiveRecord::NotNullViolation < ::ActiveRecord::StatementInvalid; end + +# pkg:gem/activerecord#lib/active_record/migration/pending_migration_connection.rb:4 +class ActiveRecord::PendingMigrationConnection + class << self + # pkg:gem/activerecord#lib/active_record/migration/pending_migration_connection.rb:17 + def current_preventing_writes; end + + # pkg:gem/activerecord#lib/active_record/migration/pending_migration_connection.rb:5 + def establish_temporary_connection(db_config, &block); end + + # pkg:gem/activerecord#lib/active_record/migration/pending_migration_connection.rb:13 + def primary_class?; end + end +end + +# pkg:gem/activerecord#lib/active_record/migration.rb:134 +class ActiveRecord::PendingMigrationError < ::ActiveRecord::MigrationError + include ::ActiveSupport::ActionableError + extend ::ActiveSupport::ActionableError::ClassMethods + + # pkg:gem/activerecord#lib/active_record/migration.rb:146 + def initialize(message = T.unsafe(nil), pending_migrations: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:135 + def _actions; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:135 + def _actions=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:135 + def _actions?; end + + private + + # pkg:gem/activerecord#lib/active_record/migration.rb:170 + def connection; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:156 + def detailed_migration_message(pending_migrations); end + + class << self + # pkg:gem/activerecord#lib/active_record/migration.rb:135 + def _actions; end + + # pkg:gem/activerecord#lib/active_record/migration.rb:135 + def _actions=(value); end + + # pkg:gem/activerecord#lib/active_record/migration.rb:135 + def _actions?; end + end +end + +# = Active Record \Persistence +# +# pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:814 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:835 + 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+. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:982 + 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+. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:992 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:766 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:780 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:796 + def destroy!; end + + # Returns true if this object has been destroyed, otherwise returns false. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:682 + 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+. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:959 + 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. + # Returns +self+. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:971 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:665 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:688 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:672 + def previously_new_record?; end + + # Returns true if this object was previously persisted but now it has been deleted. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:677 + 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 + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:1069 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:717 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:750 + 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 + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:1008 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:1017 + 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 + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:1120 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:890 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:901 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:857 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:879 + def update_attribute!(name, value); end + + # Equivalent to update_columns(name => value). + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:911 + def update_column(name, value); 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 not updated. + # * 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:931 + def update_columns(attributes); end + + private + + # Creates a record with values matching those of the instance attributes + # and returns its id. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:1247 + def _create_record(attribute_names = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:1197 + def _delete_row; end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:1153 + def _find_record(options); end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:1164 + def _in_memory_query_constraints_hash; end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:1179 + def _query_constraints_hash; end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:1281 + def _raise_readonly_record_error; end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:1273 + def _raise_record_not_destroyed; end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:1285 + def _raise_record_not_touched_error; end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:1201 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:1227 + def _update_record(attribute_names = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:1211 + def _update_row(attribute_names, attempted_action = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:1174 + def apply_scoping?(options); end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:1218 + def create_or_update(**, &block); end + + # A hook to be overridden by association modules. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:1190 + def destroy_associations; end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:1193 + def destroy_row; end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:1141 + def init_internals; end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:1147 + def strict_loaded_associations; end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:1269 + def verify_readonly_attribute(name); end +end + +# pkg:gem/activerecord#lib/active_record/persistence.rb:10 +module ActiveRecord::Persistence::ClassMethods + # pkg:gem/activerecord#lib/active_record/persistence.rb:611 + def _delete_record(constraints); end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:569 + def _insert_record(values, returning); end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:594 + 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 + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:510 + 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 + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:50 + def create!(attributes = T.unsafe(nil), &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]) + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:565 + def delete(id_or_array); 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) + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:533 + def destroy(id); end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:495 + def has_query_constraints?; 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:96 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:185 + 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 and SQLite3 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" } + # ]) + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:175 + 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 and SQLite3 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" } + # ]) + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:242 + def insert_all!(attributes, returning: T.unsafe(nil), record_timestamps: T.unsafe(nil)); 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:376 + 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 attribute used in the query_by 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 + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:488 + def query_constraints(*columns_list); end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:499 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:408 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:434 + def update!(id = T.unsafe(nil), attributes); 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:252 + 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 and SQLite3 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 + # + # 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 SQL update sentence that will be used in case of conflict. + # + # 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" + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:362 + 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 + + private + + # Called by +_update_record+ and +_delete_record+ + # to build `where` clause from default scopes. + # Skips empty scopes. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:655 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:648 + def discriminate_class_for_record(record); end + + # pkg:gem/activerecord#lib/active_record/persistence.rb:628 + 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. + # + # pkg:gem/activerecord#lib/active_record/persistence.rb:638 + def instantiate_instance_of(klass, attributes, column_types = T.unsafe(nil), &block); end +end + +# pkg:gem/activerecord#lib/active_record/relation/predicate_builder.rb:4 +class ActiveRecord::PredicateBuilder + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder.rb:12 + def initialize(table); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder.rb:53 + def [](attr_name, value, operator = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder.rb:57 + def build(attribute, value, operator = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder.rb:67 + def build_bind_attribute(column_name, value); end + + # pkg:gem/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) + # + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder.rb:49 + def register_handler(klass, handler); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder.rb:71 + def resolve_arel_attribute(table_name, column_name, &block); end + + protected + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder.rb:76 + def expand_from_hash(attributes, &block); end + + private + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder.rb:150 + def convert_dot_notation_to_hash(attributes); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder.rb:140 + def grouping_queries(queries); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder.rb:172 + def handler_for(object); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder.rb:138 + def table; end + + class << self + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder.rb:28 + def references(attributes); end + end +end + +# pkg:gem/activerecord#lib/active_record/relation/predicate_builder/array_handler.rb:7 +class ActiveRecord::PredicateBuilder::ArrayHandler + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/array_handler.rb:8 + def initialize(predicate_builder); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/array_handler.rb:12 + def call(attribute, value); end + + private + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/array_handler.rb:39 + def predicate_builder; end +end + +# pkg:gem/activerecord#lib/active_record/relation/predicate_builder/array_handler.rb:41 +module ActiveRecord::PredicateBuilder::ArrayHandler::NullPredicate + class << self + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/array_handler.rb:42 + def or(other); end + end +end + +# pkg:gem/activerecord#lib/active_record/relation/predicate_builder/association_query_value.rb:5 +class ActiveRecord::PredicateBuilder::AssociationQueryValue + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/association_query_value.rb:6 + def initialize(associated_table, value); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/association_query_value.rb:11 + def queries; end + + private + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/association_query_value.rb:23 + def associated_table; end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/association_query_value.rb:59 + def convert_to_id(value); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/association_query_value.rb:25 + def ids; end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/association_query_value.rb:55 + def polymorphic_clause?; end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/association_query_value.rb:47 + def polymorphic_name; end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/association_query_value.rb:39 + def primary_key; end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/association_query_value.rb:43 + def primary_type; end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/association_query_value.rb:51 + def select_clause?; end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/association_query_value.rb:23 + def value; end +end + +# pkg:gem/activerecord#lib/active_record/relation/predicate_builder/basic_object_handler.rb:5 +class ActiveRecord::PredicateBuilder::BasicObjectHandler + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/basic_object_handler.rb:6 + def initialize(predicate_builder); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/basic_object_handler.rb:10 + def call(attribute, value); end + + private + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/basic_object_handler.rb:16 + def predicate_builder; end +end + +# pkg:gem/activerecord#lib/active_record/relation/predicate_builder/polymorphic_array_value.rb:5 +class ActiveRecord::PredicateBuilder::PolymorphicArrayValue + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/polymorphic_array_value.rb:6 + def initialize(associated_table, values); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/polymorphic_array_value.rb:11 + def queries; end + + private + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/polymorphic_array_value.rb:23 + def associated_table; end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/polymorphic_array_value.rb:44 + def convert_to_id(value); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/polymorphic_array_value.rb:36 + def klass(value); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/polymorphic_array_value.rb:32 + def primary_key(value); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/polymorphic_array_value.rb:25 + def type_to_ids_mapping; end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/polymorphic_array_value.rb:23 + def values; end +end + +# pkg:gem/activerecord#lib/active_record/relation/predicate_builder/range_handler.rb:5 +class ActiveRecord::PredicateBuilder::RangeHandler + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/range_handler.rb:8 + def initialize(predicate_builder); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/range_handler.rb:12 + def call(attribute, value); end + + private + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/range_handler.rb:19 + def predicate_builder; end +end + +# pkg:gem/activerecord#lib/active_record/relation/predicate_builder/range_handler.rb:6 +class ActiveRecord::PredicateBuilder::RangeHandler::RangeWithBinds < ::Struct + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/range_handler.rb:6 + def begin; end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/range_handler.rb:6 + def begin=(_); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/range_handler.rb:6 + def end; end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/range_handler.rb:6 + def end=(_); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/range_handler.rb:6 + def exclude_end?; end + + class << self + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/range_handler.rb:6 + def [](*_arg0); end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/range_handler.rb:6 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/range_handler.rb:6 + def keyword_init?; end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/range_handler.rb:6 + def members; end + + # pkg:gem/activerecord#lib/active_record/relation/predicate_builder/range_handler.rb:6 + def new(*_arg0); end + end +end + +# pkg:gem/activerecord#lib/active_record/relation/predicate_builder/relation_handler.rb:5 +class ActiveRecord::PredicateBuilder::RelationHandler + # pkg:gem/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) +# +# pkg:gem/activerecord#lib/active_record/errors.rb:341 +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) +# +# pkg:gem/activerecord#lib/active_record/errors.rb:303 +class ActiveRecord::PreparedStatementInvalid < ::ActiveRecord::ActiveRecordError; end + +# pkg:gem/activerecord#lib/active_record/promise.rb:4 +class ActiveRecord::Promise < ::BasicObject + # pkg:gem/activerecord#lib/active_record/promise.rb:7 + def initialize(future_result, block); end + + # pkg:gem/activerecord#lib/active_record/promise.rb:41 + def class; end + + # pkg:gem/activerecord#lib/active_record/promise.rb:44 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/promise.rb:41 + def is_a?(_arg0); end + + # Returns whether the associated query is still being executed or not. + # + # pkg:gem/activerecord#lib/active_record/promise.rb:13 + def pending?; end + + # pkg:gem/activerecord#lib/active_record/promise.rb:48 + def pretty_print(q); end + + # pkg:gem/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" + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/promise.rb:20 + def value; end + + private + + # pkg:gem/activerecord#lib/active_record/promise.rb:53 + def status; end +end + +# pkg:gem/activerecord#lib/active_record/promise.rb:63 +class ActiveRecord::Promise::Complete < ::ActiveRecord::Promise + # pkg:gem/activerecord#lib/active_record/promise.rb:66 + def initialize(value); end + + # pkg:gem/activerecord#lib/active_record/promise.rb:74 + def pending?; end + + # pkg:gem/activerecord#lib/active_record/promise.rb:70 + def then; end + + # pkg:gem/activerecord#lib/active_record/promise.rb:64 + def value; end + + private + + # pkg:gem/activerecord#lib/active_record/promise.rb:79 + def status; end +end + +# pkg:gem/activerecord#lib/active_record/migration.rb:195 +class ActiveRecord::ProtectedEnvironmentError < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/migration.rb:196 + def initialize(env = T.unsafe(nil)); end +end + +# Superclass for errors that have been aborted (either by client or server). +# +# pkg:gem/activerecord#lib/active_record/errors.rb:534 +class ActiveRecord::QueryAborted < ::ActiveRecord::StatementInvalid; end + +# = Active Record Query Cache +# +# pkg:gem/activerecord#lib/active_record/query_cache.rb:5 +class ActiveRecord::QueryCache + class << self + # pkg:gem/activerecord#lib/active_record/query_cache.rb:32 + def complete(pools); end + + # pkg:gem/activerecord#lib/active_record/query_cache.rb:40 + def install_executor_hooks(executor = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/query_cache.rb:28 + def run; end + end +end + +# pkg:gem/activerecord#lib/active_record/query_cache.rb:6 +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. + # + # pkg:gem/activerecord#lib/active_record/query_cache.rb:9 + def cache(&block); end + + # Disable the query cache within the block if Active Record is configured. + # If it's not, it will execute the given block. + # + # pkg:gem/activerecord#lib/active_record/query_cache.rb:19 + def uncached(&block); end +end + +# QueryCanceled will be raised when canceling statement due to user request. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:546 +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+ +# +# 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: +# +# ActiveRecord::QueryLogs.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 +# +# pkg:gem/activerecord#lib/active_record/query_logs_formatter.rb:4 +module ActiveRecord::QueryLogs + class << self + # pkg:gem/activerecord#lib/active_record/query_logs.rb:77 + def cache_query_log_tags; end + + # pkg:gem/activerecord#lib/active_record/query_logs.rb:77 + def cache_query_log_tags=(val); end + + # pkg:gem/activerecord#lib/active_record/query_logs.rb:79 + def cached_comment; end + + # pkg:gem/activerecord#lib/active_record/query_logs.rb:79 + def cached_comment=(obj); end + + # pkg:gem/activerecord#lib/active_record/query_logs.rb:82 + def call(sql, connection); end + + # pkg:gem/activerecord#lib/active_record/query_logs.rb:94 + def clear_cache; end + + # pkg:gem/activerecord#lib/active_record/query_logs.rb:76 + def prepend_comment; end + + # pkg:gem/activerecord#lib/active_record/query_logs.rb:76 + def prepend_comment=(val); end + + # pkg:gem/activerecord#lib/active_record/query_logs.rb:74 + def taggings; end + + # pkg:gem/activerecord#lib/active_record/query_logs.rb:74 + def taggings=(val); end + + # pkg:gem/activerecord#lib/active_record/query_logs.rb:75 + def tags; end + + # pkg:gem/activerecord#lib/active_record/query_logs.rb:75 + def tags=(val); end + + # pkg:gem/activerecord#lib/active_record/query_logs.rb:78 + def tags_formatter; end + + # pkg:gem/activerecord#lib/active_record/query_logs.rb:78 + def tags_formatter=(val); end + + # Updates the formatter to be what the passed in format is. + # + # pkg:gem/activerecord#lib/active_record/query_logs.rb:99 + def update_formatter(format); end + + private + + # Returns an SQL comment +String+ containing the query log tags. + # Sets and returns a cached comment if cache_query_log_tags is +true+. + # + # pkg:gem/activerecord#lib/active_record/query_logs.rb:116 + def comment(connection); end + + # pkg:gem/activerecord#lib/active_record/query_logs.rb:136 + def escape_sql_comment(content); end + + # pkg:gem/activerecord#lib/active_record/query_logs.rb:124 + def formatter; end + + # pkg:gem/activerecord#lib/active_record/query_logs.rb:149 + def tag_content(connection); end + + # pkg:gem/activerecord#lib/active_record/query_logs.rb:128 + def uncached_comment(connection); end + end +end + +# pkg:gem/activerecord#lib/active_record/query_logs_formatter.rb:5 +class ActiveRecord::QueryLogs::LegacyFormatter + # pkg:gem/activerecord#lib/active_record/query_logs_formatter.rb:6 + def initialize; end + + # Formats the key value pairs into a string. + # + # pkg:gem/activerecord#lib/active_record/query_logs_formatter.rb:11 + def format(pairs); end + + private + + # pkg:gem/activerecord#lib/active_record/query_logs_formatter.rb:20 + def format_value(value); end + + # pkg:gem/activerecord#lib/active_record/query_logs_formatter.rb:18 + def key_value_separator; end +end + +# pkg:gem/activerecord#lib/active_record/query_logs_formatter.rb:25 +class ActiveRecord::QueryLogs::SQLCommenter < ::ActiveRecord::QueryLogs::LegacyFormatter + # pkg:gem/activerecord#lib/active_record/query_logs_formatter.rb:26 + def initialize; end + + # pkg:gem/activerecord#lib/active_record/query_logs_formatter.rb:30 + def format(pairs); end + + private + + # pkg:gem/activerecord#lib/active_record/query_logs_formatter.rb:36 + def format_value(value); end +end + +# pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:9 +module ActiveRecord::QueryMethods + include ::ActiveModel::ForbiddenAttributesProtection + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:405 + def _select!(*fields); 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) + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1034 + def and(other); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1042 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1428 + def annotate(*args); end + + # Like #annotate, but modifies relation in place. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1434 + def annotate!(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def annotate_values; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def annotate_values=(value); end + + # Returns the Arel object associated with the relation. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1489 + def arel(aliases = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1493 + 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' + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1245 + def create_with(value); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1249 + def create_with!(value); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def create_with_value; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1309 + def distinct(value = T.unsafe(nil)); end + + # Like #distinct, but modifies relation in place. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1314 + def distinct!(value = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def distinct_value; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:267 + def eager_load(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:272 + def eager_load!(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def eager_load_values; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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) + # + # 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. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1470 + def excluding(*records); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1482 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1355 + def extending(*modules, &block); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1363 + def extending!(*modules, &block); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def extending_values; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def extending_values=(value); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:166 + 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) + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:318 + 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') + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1290 + def from(value, subquery_name = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1294 + def from!(value, subquery_name = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def from_clause; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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) + # # => [#, #, #] + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:512 + def group(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:517 + def group!(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def group_values; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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') + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1096 + def having(opts, *rest); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1100 + def having!(opts, *rest); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def having_clause; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def having_clause=(value); end + + # Allows to specify an order 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 + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:620 + def in_order_of(column, values); 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. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:231 + def includes(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:236 + def includes!(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def includes_values; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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) + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1000 + def invert_where; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1004 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:767 + def joins(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:772 + def joins!(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def joins_values; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def joins_values=(value); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:786 + 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" + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:782 + def left_outer_joins(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:788 + def left_outer_joins!(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def left_outer_joins_values; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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' + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1110 + def limit(value); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1114 + def limit!(value); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def limit_value; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def limit_value=(value); end + + # Specifies locking settings (default to +true+). For more information + # on locking, please see ActiveRecord::Locking. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1137 + def lock(locks = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1141 + def lock!(locks = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def lock_value; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1180 + def none; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1184 + def none!; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1192 + 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") + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1126 + def offset(value); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1130 + def offset!(value); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def offset_value; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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" + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1384 + def optimizer_hints(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1389 + def optimizer_hints!(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def optimizer_hints_values; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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)) + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1066 + def or(other); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1078 + 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' + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:595 + def order(*args); end + + # Same as #order but operates on relation in-place instead of copying. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:603 + def order!(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def order_values; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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 ... + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:299 + def preload(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:304 + def preload!(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def preload_values; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1208 + def readonly(value = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1212 + def readonly!(value = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def readonly_value; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:332 + def references(*table_names); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:337 + def references!(*table_names); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def references_values; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:532 + def regroup(*args); end + + # Same as #regroup but operates on relation in-place instead of copying. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:538 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:651 + def reorder(*args); end + + # Same as #reorder but operates on relation in-place instead of copying. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:659 + def reorder!(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def reordering_value; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:480 + def reselect(*args); end + + # Same as #reselect but operates on relation in-place instead of copying. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:487 + 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' + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1397 + def reverse_order; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1401 + def reverse_order!; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def reverse_order_value; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:960 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:390 + def select(*fields); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def select_values; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def select_values=(value); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1412 + def skip_preloading!; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1407 + def skip_query_cache!(value = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def skip_query_cache_value; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1223 + def strict_loading(value = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1227 + def strict_loading!(value = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def strict_loading_value; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1020 + def structurally_compatible?(other); end + + # Deduplicate multiple values. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1440 + 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) } + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:705 + def unscope(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:710 + def unscope!(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def unscope_values; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:932 + def where(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:942 + def where!(opts, *rest); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def where_clause; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + 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 + # + # 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)) + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:459 + def with(*args); end + + # Like #with, but modifies relation in place. + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:465 + def with!(*args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def with_values; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:154 + def with_values=(value); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1480 + def without(*records); end + + protected + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1539 + def async!; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1537 + def build_having_clause(opts, rest = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1500 + def build_subquery(subquery_alias, select_value); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1508 + def build_where_clause(opts, rest = T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1792 + def arel_column(field); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1775 + def arel_columns(columns); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1573 + def assert_mutability!; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1545 + def async; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1578 + def build_arel(aliases = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1936 + def build_case_for_value_position(column, values); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1607 + def build_cast_value(name, value); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1611 + def build_from; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1653 + def build_join_buckets; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1562 + def build_join_dependencies; end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1709 + def build_joins(join_sources, aliases = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1854 + def build_order(arel); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1731 + def build_select(arel); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1741 + def build_with(arel); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1767 + def build_with_join_node(name, kind = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1753 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1985 + def check_if_method_has_arguments!(method_name, args, message = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1911 + def column_references(order_args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1843 + def does_not_support_reverse?(order); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1556 + def each_join_dependencies(join_dependencies = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1549 + def lookup_table_klass_from_join_dependencies(table_name); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1926 + def order_column(field); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1874 + def preprocess_order_args(order_args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1996 + def process_select_args(fields); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1945 + def resolve_arel_attributes(attrs); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1814 + def reverse_sql_order(order_query); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1905 + def sanitize_order_arguments(order_args); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1638 + def select_association_list(associations, stashed_joins = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1626 + def select_named_joins(join_names, stashed_joins = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:2036 + def structurally_incompatible_values_for(other); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1808 + def table_name_matches?(from); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:2006 + def transform_select_hash_values(fields); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1862 + def validate_order_args(args); end +end + +# A wrapper to distinguish CTE joins from other nodes. +# +# pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:132 +class ActiveRecord::QueryMethods::CTEJoin + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:135 + def initialize(name); end + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:133 + def name; end +end + +# pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:140 +ActiveRecord::QueryMethods::FROZEN_EMPTY_ARRAY = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:141 +ActiveRecord::QueryMethods::FROZEN_EMPTY_HASH = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:2031 +ActiveRecord::QueryMethods::STRUCTURAL_VALUE_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:1859 +ActiveRecord::QueryMethods::VALID_DIRECTIONS = T.let(T.unsafe(nil), Set) + +# pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:667 +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. +# +# pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:14 +class ActiveRecord::QueryMethods::WhereChain + # pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:75 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:107 + 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') + # # => [] + # + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:49 + def not(opts, *rest); end + + private + + # pkg:gem/activerecord#lib/active_record/relation/query_methods.rb:122 + def scope_association_reflection(association); end +end + +# pkg:gem/activerecord#lib/active_record/querying.rb:4 +module ActiveRecord::Querying + # pkg:gem/activerecord#lib/active_record/querying.rb:65 + def _load_from_sql(result_set, &block); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:61 + def _query_by_sql(sql, binds = T.unsafe(nil), preparable: T.unsafe(nil), async: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def and(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def annotate(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def any?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def async_average(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def async_count(*, **, &); end + + # Same as #count_by_sql but perform the query asynchronously and returns an ActiveRecord::Promise. + # + # pkg:gem/activerecord#lib/active_record/querying.rb:106 + def async_count_by_sql(sql); end + + # Same as #find_by_sql but perform the query asynchronously and returns an ActiveRecord::Promise. + # + # pkg:gem/activerecord#lib/active_record/querying.rb:55 + def async_find_by_sql(sql, binds = T.unsafe(nil), preparable: T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def async_ids(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def async_maximum(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def async_minimum(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def async_pick(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def async_pluck(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def async_sum(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def average(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def calculate(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def count(*, **, &); 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. + # + # pkg:gem/activerecord#lib/active_record/querying.rb:101 + def count_by_sql(sql); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def create_or_find_by(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def create_or_find_by!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def create_with(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def delete_all(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def delete_by(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def destroy_all(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def destroy_by(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def distinct(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def eager_load(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def except(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def excluding(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def exists?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def extending(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def extract_associated(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def fifth(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def fifth!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def find(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def find_by(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def find_by!(*, **, &); 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). + # + # pkg:gem/activerecord#lib/active_record/querying.rb:50 + def find_by_sql(sql, binds = T.unsafe(nil), preparable: T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def find_each(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def find_in_batches(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def find_or_create_by(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def find_or_create_by!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def find_or_initialize_by(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def find_sole_by(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def first(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def first!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def first_or_create(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def first_or_create!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def first_or_initialize(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def forty_two(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def forty_two!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def fourth(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def fourth!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def from(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def group(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def having(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def ids(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def in_batches(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def in_order_of(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def includes(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def invert_where(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def joins(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def last(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def last!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def left_joins(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def left_outer_joins(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def limit(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def lock(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def many?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def maximum(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def merge(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def minimum(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def none(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def none?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def offset(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def one?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def only(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def optimizer_hints(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def or(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def order(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def pick(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def pluck(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def preload(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def readonly(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def references(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def regroup(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def reorder(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def reselect(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def rewhere(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def second(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def second!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def second_to_last(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def second_to_last!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def select(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def sole(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def strict_loading(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def sum(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def take(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def take!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def third(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def third!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def third_to_last(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def third_to_last!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def touch_all(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def unscope(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def update_all(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def where(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def with(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/querying.rb:23 + def without(*, **, &); end +end + +# pkg:gem/activerecord#lib/active_record/querying.rb:5 +ActiveRecord::Querying::QUERYING_METHODS = T.let(T.unsafe(nil), Array) + +# = Active Record Railtie +# +# pkg:gem/activerecord#lib/active_record/railtie.rb:16 +class ActiveRecord::Railtie < ::Rails::Railtie; end + +# pkg:gem/activerecord#lib/active_record/railtie.rb:230 +ActiveRecord::Railtie::SQLITE3_PRODUCTION_WARN = T.let(T.unsafe(nil), String) + +# Raised when values that executed are out of range. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:280 +class ActiveRecord::RangeError < ::ActiveRecord::StatementInvalid; end + +# Raised when a write to the database is attempted on a read only connection. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:123 +class ActiveRecord::ReadOnlyError < ::ActiveRecord::ActiveRecordError; end + +# Raised on attempt to update record that is instantiated as read only. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:373 +class ActiveRecord::ReadOnlyRecord < ::ActiveRecord::ActiveRecordError; end + +# pkg:gem/activerecord#lib/active_record/readonly_attributes.rb:4 +class ActiveRecord::ReadonlyAttributeError < ::ActiveRecord::ActiveRecordError; end + +# pkg:gem/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 + +# pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/readonly_attributes.rb:30 + def attr_readonly(*attributes); end + + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/readonly_attributes.rb:39 + def readonly_attributes; end +end + +# pkg:gem/activerecord#lib/active_record/readonly_attributes.rb:48 +module ActiveRecord::ReadonlyAttributes::HasReadonlyAttributes + # pkg:gem/activerecord#lib/active_record/readonly_attributes.rb:57 + def _write_attribute(attr_name, value); end + + # pkg:gem/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 +# +# pkg:gem/activerecord#lib/active_record/validations.rb:15 +class ActiveRecord::RecordInvalid < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/validations.rb:18 + def initialize(record = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/validations.rb:16 + def record; end +end + +# Raised by {ActiveRecord::Base#destroy!}[rdoc-ref:Persistence#destroy!] +# when a call to {#destroy}[rdoc-ref:Persistence#destroy] +# would return false. +# +# begin +# complex_operation_that_internally_calls_destroy! +# rescue ActiveRecord::RecordNotDestroyed => invalid +# puts invalid.record.errors +# end +# +# pkg:gem/activerecord#lib/active_record/errors.rb:161 +class ActiveRecord::RecordNotDestroyed < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/errors.rb:164 + def initialize(message = T.unsafe(nil), record = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/errors.rb:162 + def record; end +end + +# Raised when Active Record cannot find a record by given id or set of ids. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:127 +class ActiveRecord::RecordNotFound < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/errors.rb:130 + def initialize(message = T.unsafe(nil), model = T.unsafe(nil), primary_key = T.unsafe(nil), id = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/errors.rb:128 + def id; end + + # pkg:gem/activerecord#lib/active_record/errors.rb:128 + def model; end + + # pkg:gem/activerecord#lib/active_record/errors.rb:128 + def primary_key; end +end + +# Raised by {ActiveRecord::Base#save!}[rdoc-ref:Persistence#save!] and +# {ActiveRecord::Base.create!}[rdoc-ref:Persistence::ClassMethods#create!] +# methods when a record is invalid and cannot be saved. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:142 +class ActiveRecord::RecordNotSaved < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/errors.rb:145 + def initialize(message = T.unsafe(nil), record = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/errors.rb:143 + def record; end +end + +# Raised when a record cannot be inserted or updated because it would violate a uniqueness constraint. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:208 +class ActiveRecord::RecordNotUnique < ::ActiveRecord::WrappedDatabaseException; end + +# = Active Record Reflection +# +# pkg:gem/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 + # pkg:gem/activerecord#lib/active_record/reflection.rb:28 + def add_aggregate_reflection(ar, name, reflection); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:22 + def add_reflection(ar, name, reflection); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:17 + def create(macro, name, scope, options, ar); end + + private + + # pkg:gem/activerecord#lib/active_record/reflection.rb:33 + 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 + 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 + end +end + +# Holds all the methods that are shared between MacroReflection and ThroughReflection. +# +# AbstractReflection +# MacroReflection +# AggregateReflection +# AssociationReflection +# HasManyReflection +# HasOneReflection +# BelongsToReflection +# HasAndBelongsToManyReflection +# ThroughReflection +# PolymorphicReflection +# RuntimeReflection +# +# pkg:gem/activerecord#lib/active_record/reflection.rb:156 +class ActiveRecord::Reflection::AbstractReflection + # pkg:gem/activerecord#lib/active_record/reflection.rb:157 + def initialize; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:308 + def alias_candidate(name); end + + # Returns a new, unsaved instance of the associated class. +attributes+ will + # be passed to the class's constructor. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:175 + def build_association(attributes, &block); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:316 + def build_scope(table, predicate_builder = T.unsafe(nil), klass = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:312 + def chain; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:255 + 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' + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:183 + def class_name; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:233 + def constraints; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:237 + def counter_cache_column; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:304 + def counter_must_be_updated_by_has_many?; end + + # Returns whether a counter cache should be used for this association. + # + # The counter_cache option must be given on either the owner or inverse + # association, and the column must be present on the owner. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:298 + def has_cached_counter?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:249 + def inverse_of; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:288 + def inverse_updates_counter_cache?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:290 + 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. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:276 + def inverse_which_updates_counter_cache; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:193 + def join_scope(table, foreign_table, foreign_klass); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:220 + def join_scopes(table, predicate_builder, klass = T.unsafe(nil), record = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:228 + def klass_join_scope(table, predicate_builder); end + + # Returns a list of scopes that should be applied for this Reflection + # object when querying the database. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:189 + def scopes; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:324 + def strict_loading?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:328 + def strict_loading_violation_message(owner); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:169 + def table_name; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:165 + def through_reflection?; end + + protected + + # pkg:gem/activerecord#lib/active_record/reflection.rb:335 + def actual_source_reflection; end + + private + + # pkg:gem/activerecord#lib/active_record/reflection.rb:348 + def ensure_option_not_given_as_class!(option_name); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:340 + def predicate_builder(table); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:344 + def primary_key(klass); end +end + +# Holds all the metadata about an aggregation as it was specified in the +# Active Record class. +# +# pkg:gem/activerecord#lib/active_record/reflection.rb:452 +class ActiveRecord::Reflection::AggregateReflection < ::ActiveRecord::Reflection::MacroReflection + # pkg:gem/activerecord#lib/active_record/reflection.rb:453 + def mapping; end +end + +# Holds all the metadata about an association as it was specified in the +# Active Record class. +# +# pkg:gem/activerecord#lib/active_record/reflection.rb:461 +class ActiveRecord::Reflection::AssociationReflection < ::ActiveRecord::Reflection::MacroReflection + # Reflection + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:489 + def initialize(name, scope, options, active_record); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:537 + def active_record_primary_key; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:683 + def add_as_polymorphic_through(reflection, seed); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:679 + def add_as_source(seed); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:687 + def add_as_through(seed); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:669 + def association_class; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:529 + def association_foreign_key; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:533 + def association_primary_key(klass = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:501 + def association_scope_cache(klass, owner, &block); end + + # Returns +true+ if +self+ is a +belongs_to+ reflection. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:664 + def belongs_to?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:580 + def check_eager_loadable!; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:568 + def check_validity!; end + + # This is for clearing cache on the reflection. Useful for tests that need to compare + # SQL queries on associations. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:612 + def clear_association_scope_cache; end + + # A chain of reflections from this one back to the owner. For more see the explanation in + # ThroughReflection. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:606 + 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. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:646 + def collection?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:462 + def compute_class(name); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:691 + def extensions; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:513 + def foreign_key(infer_from_inverse_of: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:486 + def foreign_type; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:624 + def has_inverse?; end + + # Returns +true+ if +self+ is a +has_one+ reflection. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:667 + def has_one?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:620 + def has_scope?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:564 + def join_foreign_key; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:592 + def join_id_for(owner); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:556 + def join_primary_key(klass = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:560 + def join_primary_type; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:509 + def join_table; end + + # Returns the macro type. + # + # has_many :clients returns :has_many + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:641 + def macro; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:616 + def nested?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:487 + def parent_reflection; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:487 + def parent_reflection=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:671 + def polymorphic?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:628 + def polymorphic_inverse_of(associated_class); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:675 + def polymorphic_name; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:600 + def source_reflection; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:596 + def through_reflection; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:486 + 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 + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:659 + def validate?; end + + private + + # returns either +nil+ or the inverse association name that it finds. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:708 + 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. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:746 + def can_find_inverse_of_automatically?(reflection, inverse_reflection = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:767 + def derive_class_name; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:785 + def derive_fk_query_constraints(foreign_key); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:773 + def derive_foreign_key(infer_from_inverse_of: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:823 + 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+. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:699 + 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). + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:759 + 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. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:732 + def valid_inverse_reflection?(reflection); end +end + +# pkg:gem/activerecord#lib/active_record/reflection.rb:856 +class ActiveRecord::Reflection::BelongsToReflection < ::ActiveRecord::Reflection::AssociationReflection + # pkg:gem/activerecord#lib/active_record/reflection.rb:861 + def association_class; end + + # klass option is necessary to support loading polymorphic associations + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:870 + def association_primary_key(klass = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:859 + def belongs_to?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:888 + def join_foreign_key; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:892 + def join_foreign_type; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:884 + def join_primary_key(klass = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:857 + def macro; end + + private + + # pkg:gem/activerecord#lib/active_record/reflection.rb:897 + def can_find_inverse_of_automatically?(*); 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. +# +# pkg:gem/activerecord#lib/active_record/reflection.rb:59 +module ActiveRecord::Reflection::ClassMethods + # pkg:gem/activerecord#lib/active_record/reflection.rb:121 + def _reflect_on_association(association); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:130 + def clear_reflections_cache; end + + # Returns the AggregateReflection object for the named +aggregation+ (use the symbol). + # + # Account.reflect_on_aggregation(:balance) # => the balance AggregateReflection + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:69 + def reflect_on_aggregation(aggregation); end + + # Returns an array of AggregateReflection objects for all the aggregations in the class. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:61 + 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 + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:106 + def reflect_on_all_associations(macro = T.unsafe(nil)); end + + # Returns an array of AssociationReflection objects for all associations which have :autosave enabled. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:126 + 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 + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:117 + 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} + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:77 + def reflections; end + + private + + # pkg:gem/activerecord#lib/active_record/reflection.rb:135 + def inherited(subclass); end +end + +# pkg:gem/activerecord#lib/active_record/reflection.rb:902 +class ActiveRecord::Reflection::HasAndBelongsToManyReflection < ::ActiveRecord::Reflection::AssociationReflection + # pkg:gem/activerecord#lib/active_record/reflection.rb:905 + def collection?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:903 + def macro; end +end + +# pkg:gem/activerecord#lib/active_record/reflection.rb:828 +class ActiveRecord::Reflection::HasManyReflection < ::ActiveRecord::Reflection::AssociationReflection + # pkg:gem/activerecord#lib/active_record/reflection.rb:833 + def association_class; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:831 + def collection?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:829 + def macro; end +end + +# pkg:gem/activerecord#lib/active_record/reflection.rb:842 +class ActiveRecord::Reflection::HasOneReflection < ::ActiveRecord::Reflection::AssociationReflection + # pkg:gem/activerecord#lib/active_record/reflection.rb:847 + def association_class; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:845 + def has_one?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:843 + def macro; end +end + +# Base class for AggregateReflection and AssociationReflection. Objects of +# AggregateReflection and AssociationReflection are returned by the Reflection::ClassMethods. +# +# pkg:gem/activerecord#lib/active_record/reflection.rb:357 +class ActiveRecord::Reflection::MacroReflection < ::ActiveRecord::Reflection::AbstractReflection + # pkg:gem/activerecord#lib/active_record/reflection.rb:376 + 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. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:421 + def ==(other_aggregation); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:372 + def active_record; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:388 + def autosave=(autosave); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:415 + 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. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:411 + def klass; end + + # Returns the name of the macro. + # + # composed_of :balance, class_name: 'Money' returns :balance + # has_many :clients returns :clients + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:362 + 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 {} + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:370 + def options; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:374 + def plural_name; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:364 + def scope; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:429 + def scope_for(relation, owner = T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/active_record/reflection.rb:434 + def derive_class_name; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:438 + def validate_reflection!; end +end + +# pkg:gem/activerecord#lib/active_record/reflection.rb:1166 +class ActiveRecord::Reflection::PolymorphicReflection < ::ActiveRecord::Reflection::AbstractReflection + # pkg:gem/activerecord#lib/active_record/reflection.rb:1170 + def initialize(reflection, previous_reflection); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1181 + def constraints; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1167 + def join_foreign_key(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1167 + def join_primary_key(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1176 + def join_scopes(table, predicate_builder, klass = T.unsafe(nil), record = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1167 + def klass(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1167 + def name(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1167 + def plural_name(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1167 + def scope(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1167 + def scope_for(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1167 + def type(*, **, &); end + + private + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1186 + def source_type_scope; end +end + +# pkg:gem/activerecord#lib/active_record/reflection.rb:1193 +class ActiveRecord::Reflection::RuntimeReflection < ::ActiveRecord::Reflection::AbstractReflection + # pkg:gem/activerecord#lib/active_record/reflection.rb:1196 + def initialize(reflection, association); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1206 + def aliased_table; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1214 + def all_includes; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1194 + def constraints(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1194 + def join_foreign_key(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1210 + def join_primary_key(klass = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1202 + def klass; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1194 + def scope(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1194 + def type(*, **, &); end +end + +# Holds all the metadata about a :through association as it was specified +# in the Active Record class. +# +# pkg:gem/activerecord#lib/active_record/reflection.rb:912 +class ActiveRecord::Reflection::ThroughReflection < ::ActiveRecord::Reflection::AbstractReflection + # pkg:gem/activerecord#lib/active_record/reflection.rb:916 + def initialize(delegate_reflection); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def active_record(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:913 + def active_record_primary_key(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1128 + def add_as_polymorphic_through(reflection, seed); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1124 + def add_as_source(seed); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1132 + def add_as_through(seed); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def association_class(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:913 + def association_foreign_key(*, **, &); 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. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:1021 + def association_primary_key(klass = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def association_scope_cache(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def autosave=(arg); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def belongs_to?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def check_eager_loadable!(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1078 + def check_validity!; end + + # This is for clearing cache on the reflection. Useful for tests that need to compare + # SQL queries on associations. + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:993 + 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 + # # => [, + # ] + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:987 + def collect_join_chain; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def collection?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def compute_class(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1118 + def constraints; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def extensions(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:913 + def foreign_key(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:913 + def foreign_type(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def has_inverse?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def has_one?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1007 + def has_scope?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:913 + def join_foreign_key(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:913 + def join_id_for(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1031 + def join_primary_key(klass = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def join_primary_type(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1003 + def join_scopes(table, predicate_builder, klass = T.unsafe(nil), record = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def join_table(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:929 + def klass; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def macro(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def name(*, **, &); end + + # A through association is nested if there would be more than one join table + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:1014 + def nested?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def options(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def parent_reflection(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def parent_reflection=(arg); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def plural_name(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def polymorphic?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def polymorphic_inverse_of(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def polymorphic_name(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def scope(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def scope_for(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:999 + def scopes; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1070 + 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 + # # => + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:950 + def source_reflection; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1050 + 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] + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:1046 + def source_reflection_names; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1074 + 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 + # # => + # + # pkg:gem/activerecord#lib/active_record/reflection.rb:966 + def through_reflection; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:925 + def through_reflection?; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:913 + def type(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1163 + def validate?(*, **, &); end + + protected + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1137 + def actual_source_reflection; end + + private + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1144 + def collect_join_reflections(seed); end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1142 + def delegate_reflection; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1155 + def derive_class_name; end + + # pkg:gem/activerecord#lib/active_record/reflection.rb:1153 + def inverse_name; end +end + +# = Active Record \Relation +# +# pkg:gem/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 + extend ::ActiveRecord::Delegation::ClassMethods + + # pkg:gem/activerecord#lib/active_record/relation.rb:28 + def initialize(klass, table: T.unsafe(nil), predicate_builder: T.unsafe(nil), values: T.unsafe(nil)); end + + # Compares two relations for equality. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:813 + def ==(other); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:471 + def _exec_scope(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:863 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation.rb:312 + def any?(*args); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:46 + def bind_attribute(name, value); end + + # Returns true if relation is blank. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:834 + def blank?; end + + # pkg:gem/activerecord#lib/active_record/relation.rb:77 + 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) + # + # pkg:gem/activerecord#lib/active_record/relation.rb:359 + def cache_key(timestamp_column = T.unsafe(nil)); end + + # Returns a cache key along with the version. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:438 + 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%') + # + # pkg:gem/activerecord#lib/active_record/relation.rb:386 + 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 + # # => # + # + # pkg:gem/activerecord#lib/active_record/relation.rb:98 + 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!]. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:113 + 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). + # + # 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. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:215 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:228 + def create_or_find_by!(attributes, &block); 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 + # + # pkg:gem/activerecord#lib/active_record/relation.rb:646 + 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) + # + # pkg:gem/activerecord#lib/active_record/relation.rb:689 + def delete_by(*args); 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 + # + # pkg:gem/activerecord#lib/active_record/relation.rb:624 + 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) + # + # pkg:gem/activerecord#lib/active_record/relation.rb:676 + def destroy_by(*args); end + + # Returns true if relation needs eager loading. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:798 + def eager_loading?; end + + # Returns true if there are no records. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:283 + def empty?; end + + # pkg:gem/activerecord#lib/active_record/relation.rb:855 + def empty_scope?; end + + # Serializes the relation objects Array. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:269 + 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. + # + # 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. + # + # Please see further details in the + # {Active Record Query Interface guide}[https://guides.rubyonrails.org/active_record_querying.html#running-explain]. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:253 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:175 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:182 + 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]. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:240 + def find_or_initialize_by(attributes, &block); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:122 + def first_or_create(attributes = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:126 + def first_or_create!(attributes = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:130 + def first_or_initialize(attributes = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:859 + def has_limit_or_offset?; end + + # pkg:gem/activerecord#lib/active_record/relation.rb:846 + 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] } + # + # pkg:gem/activerecord#lib/active_record/relation.rb:808 + def joined_includes_values; end + + # pkg:gem/activerecord#lib/active_record/relation.rb:22 + 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 # => # + # + # pkg:gem/activerecord#lib/active_record/relation.rb:740 + 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. + # + # +load_async+ will also fall back to executing in the foreground in the test environment when transactional + # fixtures are enabled. + # + # 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 + # + # pkg:gem/activerecord#lib/active_record/relation.rb:711 + def load_async; end + + # pkg:gem/activerecord#lib/active_record/relation.rb:22 + def loaded; end + + # pkg:gem/activerecord#lib/active_record/relation.rb:25 + def loaded?; end + + # pkg:gem/activerecord#lib/active_record/relation.rb:26 + def locked?; end + + # Returns true if there is more than one record. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:334 + def many?; end + + # pkg:gem/activerecord#lib/active_record/relation.rb:24 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation.rb:69 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation.rb:299 + 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 + # + # pkg:gem/activerecord#lib/active_record/relation.rb:325 + def one?(*args); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:22 + def predicate_builder; end + + # pkg:gem/activerecord#lib/active_record/relation.rb:877 + def preload_associations(records); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:824 + def pretty_print(pp); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:263 + def records; end + + # Forces reloading of relation. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:750 + def reload; end + + # pkg:gem/activerecord#lib/active_record/relation.rb:755 + def reset; end + + # Returns true if the relation was scheduled on the background + # thread pool. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:730 + def scheduled?; end + + # pkg:gem/activerecord#lib/active_record/relation.rb:791 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:460 + def scoping(all_queries: T.unsafe(nil), &block); end + + # Returns size of the records. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:274 + def size; end + + # pkg:gem/activerecord#lib/active_record/relation.rb:23 + def skip_preloading_value; end + + # pkg:gem/activerecord#lib/active_record/relation.rb:23 + def skip_preloading_value=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:22 + def table; end + + # pkg:gem/activerecord#lib/active_record/relation.rb:261 + def to_a; end + + # Converts relation objects to Array. + # + # pkg:gem/activerecord#lib/active_record/relation.rb:258 + def to_ary; end + + # Returns sql statement for the relation. + # + # User.where(name: 'Oscar').to_sql + # # SELECT "users".* FROM "users" WHERE "users"."name" = 'Oscar' + # + # pkg:gem/activerecord#lib/active_record/relation.rb:771 + 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'" + # + # pkg:gem/activerecord#lib/active_record/relation.rb:604 + def touch_all(*names, time: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:533 + def update(id = T.unsafe(nil), attributes); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:541 + 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'")) + # + # pkg:gem/activerecord#lib/active_record/relation.rb:507 + 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) + # + # pkg:gem/activerecord#lib/active_record/relation.rb:561 + def update_counters(counters); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:838 + def values; end + + # pkg:gem/activerecord#lib/active_record/relation.rb:842 + def values_for_queries; end + + # Returns a hash of where conditions. + # + # User.where(name: 'Oscar').where_values_hash + # # => {name: "Oscar"} + # + # pkg:gem/activerecord#lib/active_record/relation.rb:787 + def where_values_hash(relation_table_name = T.unsafe(nil)); end + + protected + + # pkg:gem/activerecord#lib/active_record/relation.rb:887 + def load_records(records); end + + private + + # pkg:gem/activerecord#lib/active_record/relation.rb:913 + def _create(attributes, &block); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:917 + def _create!(attributes, &block); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:948 + def _increment_attribute(attribute, value = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:909 + def _new(attributes, &block); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:921 + def _scoping(scope, registry, all_queries = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:937 + def _substitute_values(values); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:893 + def already_in_scope?(registry); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:364 + def compute_cache_key(timestamp_column = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:393 + def compute_cache_version(timestamp_column); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:901 + def current_scope_restoring_block(&block); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:975 + def exec_main_query(async: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:955 + def exec_queries(&block); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:897 + def global_scope?(registry); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:41 + def initialize_copy(other); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:1003 + def instantiate_records(rows, &block); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:1046 + def limited_count; end + + # pkg:gem/activerecord#lib/active_record/relation.rb:1022 + def references_eager_loaded_tables?; end + + # pkg:gem/activerecord#lib/active_record/relation.rb:1014 + def skip_query_cache_if_necessary(&block); end + + # pkg:gem/activerecord#lib/active_record/relation.rb:1039 + def tables_in_string(string); end +end + +# pkg:gem/activerecord#lib/active_record/relation.rb:14 +ActiveRecord::Relation::CLAUSE_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/active_record/relation/from_clause.rb:5 +class ActiveRecord::Relation::FromClause + # pkg:gem/activerecord#lib/active_record/relation/from_clause.rb:8 + def initialize(value, name); end + + # pkg:gem/activerecord#lib/active_record/relation/from_clause.rb:21 + def ==(other); end + + # pkg:gem/activerecord#lib/active_record/relation/from_clause.rb:17 + def empty?; end + + # pkg:gem/activerecord#lib/active_record/relation/from_clause.rb:13 + def merge(other); end + + # pkg:gem/activerecord#lib/active_record/relation/from_clause.rb:6 + def name; end + + # pkg:gem/activerecord#lib/active_record/relation/from_clause.rb:6 + def value; end + + class << self + # pkg:gem/activerecord#lib/active_record/relation/from_clause.rb:25 + def empty; end + end +end + +# pkg:gem/activerecord#lib/active_record/relation/merger.rb:7 +class ActiveRecord::Relation::HashMerger + # pkg:gem/activerecord#lib/active_record/relation/merger.rb:10 + def initialize(relation, hash, rewhere = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/merger.rb:8 + def hash; end + + # pkg:gem/activerecord#lib/active_record/relation/merger.rb:18 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation/merger.rb:26 + def other; end + + # pkg:gem/activerecord#lib/active_record/relation/merger.rb:8 + def relation; end +end + +# pkg:gem/activerecord#lib/active_record/relation.rb:15 +ActiveRecord::Relation::INVALID_METHODS_FOR_DELETE_ALL = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/active_record/relation.rb:6 +ActiveRecord::Relation::MULTI_VALUE_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/active_record/relation/merger.rb:44 +class ActiveRecord::Relation::Merger + # pkg:gem/activerecord#lib/active_record/relation/merger.rb:47 + def initialize(relation, other, rewhere = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/merger.rb:60 + def merge; end + + # pkg:gem/activerecord#lib/active_record/relation/merger.rb:45 + def other; end + + # pkg:gem/activerecord#lib/active_record/relation/merger.rb:45 + def relation; end + + # pkg:gem/activerecord#lib/active_record/relation/merger.rb:45 + def values; end + + private + + # pkg:gem/activerecord#lib/active_record/relation/merger.rb:178 + def merge_clauses; end + + # pkg:gem/activerecord#lib/active_record/relation/merger.rb:119 + def merge_joins; end + + # pkg:gem/activerecord#lib/active_record/relation/merger.rb:157 + def merge_multi_values; end + + # pkg:gem/activerecord#lib/active_record/relation/merger.rb:138 + def merge_outer_joins; end + + # pkg:gem/activerecord#lib/active_record/relation/merger.rb:98 + def merge_preloads; end + + # pkg:gem/activerecord#lib/active_record/relation/merger.rb:86 + def merge_select_values; end + + # pkg:gem/activerecord#lib/active_record/relation/merger.rb:170 + def merge_single_values; end + + # pkg:gem/activerecord#lib/active_record/relation/merger.rb:188 + def replace_from_clause?; end +end + +# pkg:gem/activerecord#lib/active_record/relation/merger.rb:54 +ActiveRecord::Relation::Merger::NORMAL_VALUES = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/active_record/relation/query_attribute.rb:7 +class ActiveRecord::Relation::QueryAttribute < ::ActiveModel::Attribute + # pkg:gem/activerecord#lib/active_record/relation/query_attribute.rb:8 + def initialize(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/query_attribute.rb:53 + def ==(other); end + + # pkg:gem/activerecord#lib/active_record/relation/query_attribute.rb:56 + def eql?(other); end + + # pkg:gem/activerecord#lib/active_record/relation/query_attribute.rb:58 + def hash; end + + # pkg:gem/activerecord#lib/active_record/relation/query_attribute.rb:42 + def infinite?; end + + # pkg:gem/activerecord#lib/active_record/relation/query_attribute.rb:35 + def nil?; end + + # pkg:gem/activerecord#lib/active_record/relation/query_attribute.rb:22 + def type_cast(value); end + + # pkg:gem/activerecord#lib/active_record/relation/query_attribute.rb:46 + def unboundable?; end + + # pkg:gem/activerecord#lib/active_record/relation/query_attribute.rb:26 + def value_for_database; end + + # pkg:gem/activerecord#lib/active_record/relation/query_attribute.rb:31 + def with_cast_value(value); end + + private + + # pkg:gem/activerecord#lib/active_record/relation/query_attribute.rb:63 + def infinity?(value); end +end + +# pkg:gem/activerecord#lib/active_record/relation.rb:11 +ActiveRecord::Relation::SINGLE_VALUE_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/active_record/relation.rb:867 +class ActiveRecord::Relation::StrictLoadingScope + class << self + # pkg:gem/activerecord#lib/active_record/relation.rb:868 + def empty_scope?; end + + # pkg:gem/activerecord#lib/active_record/relation.rb:872 + def strict_loading_value; end + end +end + +# pkg:gem/activerecord#lib/active_record/relation.rb:17 +ActiveRecord::Relation::VALUE_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:7 +class ActiveRecord::Relation::WhereClause + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:10 + def initialize(predicates); end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:14 + def +(other); end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:18 + def -(other); end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:75 + def ==(other); end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:8 + def any?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:70 + def ast; end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:99 + def contradiction?; end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:8 + def empty?(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:79 + def eql?(other); end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:36 + def except(*columns); end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:110 + def extract_attributes; end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:81 + def hash; end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:85 + def invert; end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:26 + def merge(other, rewhere = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:40 + def or(other); end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:61 + def to_h(table_name = T.unsafe(nil), equality_only: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:22 + def |(other); end + + protected + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:117 + def predicates; end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:119 + def referenced_columns; end + + private + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:126 + def each_attributes; end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:145 + def equalities(predicates, equality_only); end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:171 + def equality_node?(node); end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:186 + def except_predicates(columns); end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:136 + def extract_attribute(node); end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:221 + def extract_node_value(node); end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:175 + def invert_predicate(node); end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:210 + def non_empty_predicates; end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:159 + def predicates_unreferenced_by(other); end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:199 + def predicates_with_wrapped_sql_literals; end + + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:214 + def wrap_sql_literal(node); end + + class << self + # pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:95 + def empty; end + end +end + +# pkg:gem/activerecord#lib/active_record/relation/where_clause.rb:209 +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.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"}, +# ... +# ] +# +# # ActiveRecord::Result also includes Enumerable. +# result.each do |row| +# puts row['title'] + " " + row['body'] +# end +# +# pkg:gem/activerecord#lib/active_record/result.rb:36 +class ActiveRecord::Result + include ::Enumerable + + # pkg:gem/activerecord#lib/active_record/result.rb:49 + def initialize(columns, rows, column_types = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/result.rb:90 + def [](idx); end + + # pkg:gem/activerecord#lib/active_record/result.rb:103 + def cancel; end + + # pkg:gem/activerecord#lib/active_record/result.rb:107 + def cast_values(type_overrides = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/result.rb:39 + def column_types; end + + # pkg:gem/activerecord#lib/active_record/result.rb:39 + def columns; end + + # Calls the given block once for each element in row collection, passing + # row as parameter. + # + # Returns an +Enumerator+ if no block is given. + # + # pkg:gem/activerecord#lib/active_record/result.rb:70 + def each(&block); end + + # Returns true if there are no records, otherwise false. + # + # pkg:gem/activerecord#lib/active_record/result.rb:79 + def empty?; end + + # pkg:gem/activerecord#lib/active_record/result.rb:140 + def freeze; end + + # Returns true if this result set includes the column named +name+ + # + # pkg:gem/activerecord#lib/active_record/result.rb:57 + def includes_column?(name); end + + # Returns the last record from the rows collection. + # + # pkg:gem/activerecord#lib/active_record/result.rb:95 + def last(n = T.unsafe(nil)); end + + # Returns the number of elements in the rows array. + # + # pkg:gem/activerecord#lib/active_record/result.rb:62 + def length; end + + # pkg:gem/activerecord#lib/active_record/result.rb:99 + def result; end + + # pkg:gem/activerecord#lib/active_record/result.rb:39 + def rows; end + + # pkg:gem/activerecord#lib/active_record/result.rb:88 + def to_a; end + + # Returns an array of hashes representing each row record. + # + # pkg:gem/activerecord#lib/active_record/result.rb:84 + def to_ary; end + + private + + # pkg:gem/activerecord#lib/active_record/result.rb:146 + def column_type(name, index, type_overrides); end + + # pkg:gem/activerecord#lib/active_record/result.rb:154 + def hash_rows; end + + # pkg:gem/activerecord#lib/active_record/result.rb:133 + def initialize_copy(other); end + + class << self + # pkg:gem/activerecord#lib/active_record/result.rb:41 + def empty(async: T.unsafe(nil)); end + end +end + +# pkg:gem/activerecord#lib/active_record/result.rb:195 +ActiveRecord::Result::EMPTY = T.let(T.unsafe(nil), ActiveRecord::Result) + +# pkg:gem/activerecord#lib/active_record/result.rb:198 +ActiveRecord::Result::EMPTY_ASYNC = T.let(T.unsafe(nil), ActiveRecord::FutureResult::Complete) + +# {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 +# +# pkg:gem/activerecord#lib/active_record/errors.rb:408 +class ActiveRecord::Rollback < ::ActiveRecord::ActiveRecordError; end + +# This is a thread locals registry for Active Record. For example: +# +# ActiveRecord::RuntimeRegistry.sql_runtime +# +# returns the connection handler local to the current unit of execution (either thread of fiber). +# +# pkg:gem/activerecord#lib/active_record/runtime_registry.rb:9 +module ActiveRecord::RuntimeRegistry + extend ::ActiveRecord::RuntimeRegistry + + # pkg:gem/activerecord#lib/active_record/runtime_registry.rb:20 + def async_sql_runtime; end + + # pkg:gem/activerecord#lib/active_record/runtime_registry.rb:24 + def async_sql_runtime=(runtime); end + + # pkg:gem/activerecord#lib/active_record/runtime_registry.rb:28 + def reset; end + + # pkg:gem/activerecord#lib/active_record/runtime_registry.rb:12 + def sql_runtime; end + + # pkg:gem/activerecord#lib/active_record/runtime_registry.rb:16 + def sql_runtime=(runtime); end +end + +# Raised when a statement produces an SQL warning. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:284 +class ActiveRecord::SQLWarning < ::ActiveRecord::AdapterError + # pkg:gem/activerecord#lib/active_record/errors.rb:288 + def initialize(message = T.unsafe(nil), code = T.unsafe(nil), level = T.unsafe(nil), sql = T.unsafe(nil), connection_pool = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/errors.rb:285 + def code; end + + # pkg:gem/activerecord#lib/active_record/errors.rb:285 + def level; end + + # pkg:gem/activerecord#lib/active_record/errors.rb:286 + def sql; end + + # pkg:gem/activerecord#lib/active_record/errors.rb:286 + def sql=(_arg0); end +end + +# pkg:gem/activerecord#lib/active_record/sanitization.rb:4 +module ActiveRecord::Sanitization + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Sanitization::ClassMethods +end + +# pkg:gem/activerecord#lib/active_record/sanitization.rb:7 +module ActiveRecord::Sanitization::ClassMethods + # pkg:gem/activerecord#lib/active_record/sanitization.rb:176 + def disallow_raw_sql!(args, permit: T.unsafe(nil)); end + + # pkg:gem/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'" + # + # pkg:gem/activerecord#lib/active_record/sanitization.rb:163 + 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 a 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'" + # + # pkg:gem/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 a 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'" + # + # pkg:gem/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" + # + # pkg:gem/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" + # + # pkg:gem/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" + # + # pkg:gem/activerecord#lib/active_record/sanitization.rb:131 + def sanitize_sql_like(string, escape_character = T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/active_record/sanitization.rb:227 + def quote_bound_value(value, c = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/sanitization.rb:241 + def raise_if_bind_arity_mismatch(statement, expected, provided); end + + # pkg:gem/activerecord#lib/active_record/sanitization.rb:205 + def replace_bind_variable(value, c = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/sanitization.rb:196 + def replace_bind_variables(statement, values); end + + # pkg:gem/activerecord#lib/active_record/sanitization.rb:213 + def replace_named_bind_variables(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. +# +# pkg:gem/activerecord#lib/active_record/schema.rb:32 +class ActiveRecord::Schema < ::ActiveRecord::Migration::Current + include ::ActiveRecord::Schema::Definition + extend ::ActiveRecord::Schema::Definition::ClassMethods + + class << self + # pkg:gem/activerecord#lib/active_record/schema.rb:68 + def [](version); end + end +end + +# pkg:gem/activerecord#lib/active_record/schema.rb:33 +module ActiveRecord::Schema::Definition + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Schema::Definition::ClassMethods + + # pkg:gem/activerecord#lib/active_record/schema.rb:54 + def define(info, &block); end +end + +# pkg:gem/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 + # + # pkg:gem/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). +# +# pkg:gem/activerecord#lib/active_record/schema_dumper.rb:10 +class ActiveRecord::SchemaDumper + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:71 + def initialize(connection, options = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:29 + def chk_ignore_pattern; end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:29 + def chk_ignore_pattern=(val); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:58 + def dump(stream); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:35 + def excl_ignore_pattern; end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:35 + def excl_ignore_pattern=(val); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:23 + def fk_ignore_pattern; end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:23 + def fk_ignore_pattern=(val); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:17 + def ignore_tables; end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:17 + def ignore_tables=(val); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:41 + def unique_ignore_pattern; end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:41 + def unique_ignore_pattern=(val); end + + private + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:263 + def check_constraints_in_create(table, stream); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:89 + def define_params; end + + # extensions are only supported by PostgreSQL + # + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:116 + def extensions(stream); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:283 + def foreign_keys(table, stream); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:315 + def format_colspec(colspec); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:325 + def format_index_parts(options); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:321 + def format_options(options); end + + # turns 20170404131909 into "2017_04_04_131909" + # + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:83 + def formatted_version; end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:93 + def header(stream); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:343 + def ignored?(table_name); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:245 + def index_parts(index); end + + # Keep it for indexing materialized views + # + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:212 + def indexes(table, stream); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:224 + def indexes_in_create(table, stream); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:333 + def remove_prefix_and_suffix(table); end + + # schemas are only supported by PostgreSQL + # + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:124 + def schemas(stream); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:142 + def table(table, stream); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:69 + def table_name; end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:69 + def table_name=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:127 + def tables(stream); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:111 + def trailer(stream); end + + # (enum) types are only supported by PostgreSQL + # + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:120 + def types(stream); end + + class << self + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:29 + def chk_ignore_pattern; end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:29 + def chk_ignore_pattern=(val); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:44 + def dump(connection = T.unsafe(nil), stream = T.unsafe(nil), config = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:35 + def excl_ignore_pattern; end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:35 + def excl_ignore_pattern=(val); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:23 + def fk_ignore_pattern; end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:23 + def fk_ignore_pattern=(val); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:17 + def ignore_tables; end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:17 + def ignore_tables=(val); end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:41 + def unique_ignore_pattern; end + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:41 + def unique_ignore_pattern=(val); end + + private + + # pkg:gem/activerecord#lib/active_record/schema_dumper.rb:50 + def generate_options(config); end + + # pkg:gem/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. +# +# pkg:gem/activerecord#lib/active_record/schema_migration.rb:8 +class ActiveRecord::SchemaMigration + # pkg:gem/activerecord#lib/active_record/schema_migration.rb:14 + def initialize(connection); end + + # pkg:gem/activerecord#lib/active_record/schema_migration.rb:12 + def arel_table; end + + # pkg:gem/activerecord#lib/active_record/schema_migration.rb:12 + def connection; end + + # pkg:gem/activerecord#lib/active_record/schema_migration.rb:78 + def count; end + + # pkg:gem/activerecord#lib/active_record/schema_migration.rb:46 + def create_table; end + + # pkg:gem/activerecord#lib/active_record/schema_migration.rb:19 + def create_version(version); end + + # pkg:gem/activerecord#lib/active_record/schema_migration.rb:32 + def delete_all_versions; end + + # pkg:gem/activerecord#lib/active_record/schema_migration.rb:25 + def delete_version(version); end + + # pkg:gem/activerecord#lib/active_record/schema_migration.rb:54 + def drop_table; end + + # pkg:gem/activerecord#lib/active_record/schema_migration.rb:74 + def integer_versions; end + + # pkg:gem/activerecord#lib/active_record/schema_migration.rb:58 + def normalize_migration_number(number); end + + # pkg:gem/activerecord#lib/active_record/schema_migration.rb:62 + def normalized_versions; end + + # pkg:gem/activerecord#lib/active_record/schema_migration.rb:38 + def primary_key; end + + # pkg:gem/activerecord#lib/active_record/schema_migration.rb:85 + def table_exists?; end + + # pkg:gem/activerecord#lib/active_record/schema_migration.rb:42 + def table_name; end + + # pkg:gem/activerecord#lib/active_record/schema_migration.rb:66 + def versions; end +end + +# pkg:gem/activerecord#lib/active_record/schema_migration.rb:9 +class ActiveRecord::SchemaMigration::NullSchemaMigration; end + +# = Active Record \Named \Scopes +# +# pkg:gem/activerecord#lib/active_record/scoping.rb:6 +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 + + # pkg:gem/activerecord#lib/active_record/scoping.rb:54 + def initialize_internals_callback; end + + # pkg:gem/activerecord#lib/active_record/scoping.rb:47 + 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 + +# pkg:gem/activerecord#lib/active_record/scoping.rb:14 +module ActiveRecord::Scoping::ClassMethods + # pkg:gem/activerecord#lib/active_record/scoping.rb:26 + def current_scope(skip_inherited_scope = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/scoping.rb:30 + def current_scope=(scope); end + + # pkg:gem/activerecord#lib/active_record/scoping.rb:34 + def global_current_scope(skip_inherited_scope = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/scoping.rb:38 + 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. + # + # pkg:gem/activerecord#lib/active_record/scoping.rb:17 + def scope_attributes; end + + # Are there attributes associated with this scope? + # + # pkg:gem/activerecord#lib/active_record/scoping.rb:22 + def scope_attributes?; end + + # pkg:gem/activerecord#lib/active_record/scoping.rb:42 + def scope_registry; end +end + +# pkg:gem/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 + +# pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/scoping/default.rb:62 + def default_scopes?(all_queries: T.unsafe(nil)); end + + # Are there attributes associated with this scope? + # + # pkg:gem/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" + # } + # + # pkg:gem/activerecord#lib/active_record/scoping/default.rb:50 + def unscoped(&block); end + + private + + # pkg:gem/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 + # + # pkg:gem/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... + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/scoping/default.rb:177 + def execute_scope?(all_queries, default_scope_obj); end + + # pkg:gem/activerecord#lib/active_record/scoping/default.rb:185 + def ignore_default_scope=(ignore); end + + # pkg:gem/activerecord#lib/active_record/scoping/default.rb:181 + def ignore_default_scope?; end +end + +# pkg:gem/activerecord#lib/active_record/scoping/default.rb:5 +class ActiveRecord::Scoping::DefaultScope + # pkg:gem/activerecord#lib/active_record/scoping/default.rb:8 + def initialize(scope, all_queries = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/scoping/default.rb:6 + def all_queries; end + + # pkg:gem/activerecord#lib/active_record/scoping/default.rb:6 + def scope; end +end + +# pkg:gem/activerecord#lib/active_record/scoping/named.rb:6 +module ActiveRecord::Scoping::Named + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Scoping::Named::ClassMethods +end + +# pkg:gem/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]. + # + # pkg:gem/activerecord#lib/active_record/scoping/named.rb:22 + def all(all_queries: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/scoping/named.rb:49 + def default_extensions; end + + # Returns a scope for the model with default scopes. + # + # pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/scoping/named.rb:154 + def scope(name, body, &block); end + + # pkg:gem/activerecord#lib/active_record/scoping/named.rb:36 + def scope_for_association(scope = T.unsafe(nil)); end + + private + + # pkg:gem/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+. +# +# pkg:gem/activerecord#lib/active_record/scoping.rb:76 +class ActiveRecord::Scoping::ScopeRegistry + # pkg:gem/activerecord#lib/active_record/scoping.rb:86 + def initialize; end + + # pkg:gem/activerecord#lib/active_record/scoping.rb:92 + def current_scope(model, skip_inherited_scope = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/scoping.rb:108 + def global_current_scope(model, skip_inherited_scope = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/scoping.rb:100 + def ignore_default_scope(model, skip_inherited_scope = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/scoping.rb:96 + def set_current_scope(model, value); end + + # pkg:gem/activerecord#lib/active_record/scoping.rb:112 + def set_global_current_scope(model, value); end + + # pkg:gem/activerecord#lib/active_record/scoping.rb:104 + def set_ignore_default_scope(model, value); end + + private + + # Sets the +value+ for a given +scope_type+ and +model+. + # + # pkg:gem/activerecord#lib/active_record/scoping.rb:131 + def set_value_for(scope_type, model, value); end + + # Obtains the value for a given +scope_type+ and +model+. + # + # pkg:gem/activerecord#lib/active_record/scoping.rb:118 + def value_for(scope_type, model, skip_inherited_scope = T.unsafe(nil)); end + + class << self + # pkg:gem/activerecord#lib/active_record/scoping.rb:78 + def current_scope(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/scoping.rb:78 + def global_current_scope(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/scoping.rb:78 + def ignore_default_scope(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/scoping.rb:81 + def instance; end + + # pkg:gem/activerecord#lib/active_record/scoping.rb:78 + def set_current_scope(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/scoping.rb:78 + def set_global_current_scope(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/scoping.rb:78 + def set_ignore_default_scope(*, **, &); end + end +end + +# pkg:gem/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 + +# pkg:gem/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 + # + # pkg:gem/activerecord#lib/active_record/secure_password.rb:41 + def authenticate_by(attributes); end +end + +# pkg:gem/activerecord#lib/active_record/secure_token.rb:4 +module ActiveRecord::SecureToken + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::SecureToken::ClassMethods +end + +# pkg:gem/activerecord#lib/active_record/secure_token.rb:11 +module ActiveRecord::SecureToken::ClassMethods + # pkg:gem/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. + # + # pkg:gem/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 + +# pkg:gem/activerecord#lib/active_record/secure_token.rb:7 +ActiveRecord::SecureToken::MINIMUM_TOKEN_LENGTH = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activerecord#lib/active_record/secure_token.rb:5 +class ActiveRecord::SecureToken::MinimumLengthError < ::StandardError; end + +# = Active Record \Serialization +# +# pkg:gem/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 + + # pkg:gem/activerecord#lib/active_record/serialization.rb:13 + def serializable_hash(options = T.unsafe(nil)); end + + private + + # pkg:gem/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. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:517 +class ActiveRecord::SerializationFailure < ::ActiveRecord::TransactionRollbackError; end + +# Raised when unserialized object's type mismatches one specified for serializable field. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:41 +class ActiveRecord::SerializationTypeMismatch < ::ActiveRecord::ActiveRecordError; end + +module ActiveRecord::SessionStore; end + +class ActiveRecord::SessionStore::Session < ::ActiveRecord::Base + class << self + # pkg:gem/activerecord#lib/active_record/enum.rb:167 + def defined_enums; end + end +end + +# = Active Record Signed Id +# +# pkg:gem/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 + + # 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. + # 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. + # + # pkg:gem/activerecord#lib/active_record/signed_id.rb:112 + def signed_id(expires_in: T.unsafe(nil), expires_at: T.unsafe(nil), purpose: T.unsafe(nil)); end + + module GeneratedClassMethods + 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 + +# pkg:gem/activerecord#lib/active_record/signed_id.rb:16 +module ActiveRecord::SignedId::ClassMethods + # pkg:gem/activerecord#lib/active_record/signed_id.rb:92 + 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 + # + # pkg:gem/activerecord#lib/active_record/signed_id.rb:42 + def find_signed(signed_id, purpose: 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 + # + # pkg:gem/activerecord#lib/active_record/signed_id.rb:62 + def find_signed!(signed_id, purpose: T.unsafe(nil)); end + + # The verifier instance that all signed ids are generated and verified from. By default, it'll be initialized + # with the class-level +signed_id_verifier_secret+, which within \Rails comes from the + # Rails.application.key_generator. By default, it's SHA256 for the digest and JSON for the serialization. + # + # pkg:gem/activerecord#lib/active_record/signed_id.rb:71 + 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. + # + # pkg:gem/activerecord#lib/active_record/signed_id.rb:87 + def signed_id_verifier=(verifier); end +end + +# Raised when Active Record finds multiple records but only expected one. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:171 +class ActiveRecord::SoleRecordExceeded < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/errors.rb:174 + def initialize(record = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/errors.rb:172 + def record; end +end + +# pkg:gem/activerecord#lib/active_record/relation/spawn_methods.rb:8 +module ActiveRecord::SpawnMethods + # Removes from the query the condition(s) specified in +skips+. + # + # Post.order('id asc').except(:order) # discards the order condition + # Post.where('id > 10').order('id asc').except(:where) # discards the where condition but keeps the order + # + # pkg:gem/activerecord#lib/active_record/relation/spawn_methods.rb:75 + 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. + # + # pkg:gem/activerecord#lib/active_record/relation/spawn_methods.rb:33 + def merge(other, *rest); end + + # pkg:gem/activerecord#lib/active_record/relation/spawn_methods.rb:43 + def merge!(other, *rest); end + + # Removes any condition from the query other than the one(s) specified in +onlies+. + # + # Post.order('id asc').only(:where) # discards the order condition + # Post.order('id asc').only(:where, :order) # uses the specified order + # + # pkg:gem/activerecord#lib/active_record/relation/spawn_methods.rb:83 + def only(*onlies); end + + # pkg:gem/activerecord#lib/active_record/relation/spawn_methods.rb:9 + def spawn; end + + private + + # pkg:gem/activerecord#lib/active_record/relation/spawn_methods.rb:88 + 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. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:350 +class ActiveRecord::StaleObjectError < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/errors.rb:353 + def initialize(record = T.unsafe(nil), attempted_action = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/errors.rb:351 + def attempted_action; end + + # pkg:gem/activerecord#lib/active_record/errors.rb:351 + 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(Book.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([], Book.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(Book.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"], Book.connection) +# +# pkg:gem/activerecord#lib/active_record/statement_cache.rb:30 +class ActiveRecord::StatementCache + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:139 + def initialize(query_builder, bind_map, klass); end + + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:145 + def execute(params, connection, &block); end + + private + + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:162 + def bind_map; end + + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:162 + def klass; end + + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:162 + def query_builder; end + + class << self + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:132 + def create(connection, callable = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:101 + def partial_query(values); end + + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:105 + def partial_query_collector; end + + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:97 + def query(sql); end + + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:155 + def unsupported_value?(value); end + end +end + +# pkg:gem/activerecord#lib/active_record/statement_cache.rb:113 +class ActiveRecord::StatementCache::BindMap + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:114 + def initialize(bound_attributes); end + + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:125 + def bind(values); end +end + +# pkg:gem/activerecord#lib/active_record/statement_cache.rb:109 +class ActiveRecord::StatementCache::Params + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:110 + def bind; end +end + +# pkg:gem/activerecord#lib/active_record/statement_cache.rb:43 +class ActiveRecord::StatementCache::PartialQuery < ::ActiveRecord::StatementCache::Query + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:44 + def initialize(values); end + + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:51 + def sql_for(binds, connection); end +end + +# pkg:gem/activerecord#lib/active_record/statement_cache.rb:64 +class ActiveRecord::StatementCache::PartialQueryCollector + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:67 + def initialize; end + + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:72 + def <<(str); end + + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:77 + def add_bind(obj); end + + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:83 + def add_binds(binds, proc_for_binds = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:65 + def preparable; end + + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:65 + def preparable=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:92 + def value; end +end + +# pkg:gem/activerecord#lib/active_record/statement_cache.rb:33 +class ActiveRecord::StatementCache::Query + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:34 + def initialize(sql); end + + # pkg:gem/activerecord#lib/active_record/statement_cache.rb:38 + def sql_for(binds, connection); end +end + +# pkg:gem/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+. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:183 +class ActiveRecord::StatementInvalid < ::ActiveRecord::AdapterError + # pkg:gem/activerecord#lib/active_record/errors.rb:184 + def initialize(message = T.unsafe(nil), sql: T.unsafe(nil), binds: T.unsafe(nil), connection_pool: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/errors.rb:190 + def binds; end + + # pkg:gem/activerecord#lib/active_record/errors.rb:192 + def set_query(sql, binds); end + + # pkg:gem/activerecord#lib/active_record/errors.rb:190 + def sql; end +end + +# StatementTimeout will be raised when statement timeout exceeded. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:542 +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+, or MySQL 5.7+ +# +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 +# +# pkg:gem/activerecord#lib/active_record/store.rb:96 +module ActiveRecord::Store + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Store::ClassMethods + + private + + # pkg:gem/activerecord#lib/active_record/store.rb:209 + def read_store_attribute(store_attribute, key); end + + # pkg:gem/activerecord#lib/active_record/store.rb:219 + def store_accessor_for(store_attribute); end + + # pkg:gem/activerecord#lib/active_record/store.rb:214 + def write_store_attribute(store_attribute, key, value); end +end + +# pkg:gem/activerecord#lib/active_record/store.rb:105 +module ActiveRecord::Store::ClassMethods + # pkg:gem/activerecord#lib/active_record/store.rb:191 + def _store_accessors_module; end + + # pkg:gem/activerecord#lib/active_record/store.rb:106 + def store(store_attribute, options = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/store.rb:112 + def store_accessor(store_attribute, *keys, prefix: T.unsafe(nil), suffix: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/store.rb:199 + def stored_attributes; end +end + +# pkg:gem/activerecord#lib/active_record/store.rb:223 +class ActiveRecord::Store::HashAccessor + class << self + # pkg:gem/activerecord#lib/active_record/store.rb:234 + def prepare(object, attribute); end + + # pkg:gem/activerecord#lib/active_record/store.rb:224 + def read(object, attribute, key); end + + # pkg:gem/activerecord#lib/active_record/store.rb:229 + def write(object, attribute, key, value); end + end +end + +# pkg:gem/activerecord#lib/active_record/store.rb:260 +class ActiveRecord::Store::IndifferentCoder + # pkg:gem/activerecord#lib/active_record/store.rb:261 + def initialize(attr_name, coder_or_class_name); end + + # pkg:gem/activerecord#lib/active_record/store.rb:270 + def dump(obj); end + + # pkg:gem/activerecord#lib/active_record/store.rb:274 + def load(yaml); end + + private + + # pkg:gem/activerecord#lib/active_record/store.rb:290 + def as_regular_hash(obj); end + + class << self + # pkg:gem/activerecord#lib/active_record/store.rb:278 + def as_indifferent_hash(obj); end + end +end + +# pkg:gem/activerecord#lib/active_record/store.rb:249 +class ActiveRecord::Store::IndifferentHashAccessor < ::ActiveRecord::Store::HashAccessor + class << self + # pkg:gem/activerecord#lib/active_record/store.rb:250 + def prepare(object, store_attribute); end + end +end + +# pkg:gem/activerecord#lib/active_record/store.rb:239 +class ActiveRecord::Store::StringKeyedHashAccessor < ::ActiveRecord::Store::HashAccessor + class << self + # pkg:gem/activerecord#lib/active_record/store.rb:240 + def read(object, attribute, key); end + + # pkg:gem/activerecord#lib/active_record/store.rb:244 + def write(object, attribute, key, value); end + end +end + +# Raised on attempt to lazily load records that are marked as strict loading. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:377 +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::ClassMethods#inheritance_column] +# points to). +# +# pkg:gem/activerecord#lib/active_record/errors.rb:22 +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 +# +# pkg:gem/activerecord#lib/active_record/suppressor.rb:32 +module ActiveRecord::Suppressor + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Suppressor::ClassMethods + + # pkg:gem/activerecord#lib/active_record/suppressor.rb:51 + def save(**); end + + # pkg:gem/activerecord#lib/active_record/suppressor.rb:55 + def save!(**); end + + class << self + # pkg:gem/activerecord#lib/active_record/suppressor.rb:36 + def registry; end + end +end + +# pkg:gem/activerecord#lib/active_record/suppressor.rb:41 +module ActiveRecord::Suppressor::ClassMethods + # pkg:gem/activerecord#lib/active_record/suppressor.rb:42 + def suppress(&block); end +end + +# pkg:gem/activerecord#lib/active_record/table_metadata.rb:4 +class ActiveRecord::TableMetadata + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:7 + def initialize(klass, arel_table, reflection = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:77 + def aggregated_with?(aggregation_name); end + + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:89 + def arel_table; end + + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:38 + def associated_table(table_name); end + + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:25 + def associated_with?(table_name); end + + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:21 + def has_column?(column_name); end + + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:5 + def join_foreign_key(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:5 + def join_foreign_type(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:5 + def join_primary_key(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:5 + def join_primary_type(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:62 + def polymorphic_association?; end + + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:66 + def polymorphic_name_association; end + + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:79 + def predicate_builder; end + + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:13 + def primary_key; end + + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:74 + def reflect_on_aggregation(aggregation_name); end + + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:70 + def through_association?; end + + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:17 + def type(column_name); end + + private + + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:92 + def klass; end + + # pkg:gem/activerecord#lib/active_record/table_metadata.rb:92 + def reflection; end +end + +# Raised when a model makes a query but it has not specified an associated table. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:50 +class ActiveRecord::TableNotSpecified < ::ActiveRecord::ActiveRecordError; end + +# pkg:gem/activerecord#lib/active_record.rb:168 +module ActiveRecord::Tasks + extend ::ActiveSupport::Autoload +end + +# pkg:gem/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') +# +# pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:40 +module ActiveRecord::Tasks::DatabaseTasks + extend ::ActiveRecord::Tasks::DatabaseTasks + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:440 + def cache_dump_filename(db_config_name, schema_cache_path: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:305 + def charset(configuration, *arguments); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:300 + def charset_current(env_name = T.unsafe(nil), db_name = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:65 + def check_protected_environments!(environment = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:458 + def check_schema_file(filename); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:290 + def check_target_version; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:484 + def clear_schema_cache(filename); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:315 + def collation(configuration, *arguments); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:310 + def collation_current(env_name = T.unsafe(nil), db_name = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:115 + def create(configuration, *arguments); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:127 + def create_all; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:170 + def create_current(environment = T.unsafe(nil), name = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:61 + def database_configuration; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:61 + def database_configuration=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:258 + def db_configs_with_versions(db_configs); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:83 + def db_dir; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:60 + def db_dir=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:204 + def drop(configuration, *arguments); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:216 + def drop_all; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:220 + def drop_current(environment = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:403 + 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.connection, "tmp/schema_dump.yaml") + # + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:480 + def dump_schema_cache(conn, filename); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:103 + def env; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:60 + def env=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:91 + def fixtures_path; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:60 + def fixtures_path=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:141 + def for_each(databases); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:349 + def load_schema(db_config, format = T.unsafe(nil), file = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:450 + def load_schema_current(format = T.unsafe(nil), file = T.unsafe(nil), environment = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:466 + def load_seed; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:237 + def migrate(version = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:275 + def migrate_status; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:505 + def migration_class; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:509 + def migration_connection; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:87 + def migrations_paths; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:60 + def migrations_paths=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:107 + def name; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:176 + def prepare_all; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:320 + def purge(configuration); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:325 + def purge_all; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:329 + def purge_current(environment = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:156 + def raise_for_multi_db(environment = T.unsafe(nil), command:); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:385 + def reconstruct_from_schema(db_config, format = T.unsafe(nil), file = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:73 + def register_task(pattern, task); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:99 + def root; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:60 + def root=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:427 + def schema_dump_path(db_config, format = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:370 + def schema_up_to_date?(configuration, format = T.unsafe(nil), file = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:111 + def seed_loader; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:60 + def seed_loader=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:135 + def setup_initial_database_yaml; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:335 + def structure_dump(configuration, *arguments); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:342 + def structure_load(configuration, *arguments); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:296 + def target_version; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:231 + def truncate_all(environment = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:499 + def with_temporary_connection(db_config, clobber: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:488 + def with_temporary_connection_for_each(env: T.unsafe(nil), name: T.unsafe(nil), clobber: T.unsafe(nil), &block); end + + private + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:604 + def check_current_protected_environment!(db_config); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:546 + def class_for_adapter(adapter); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:523 + 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` + # + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:538 + def database_adapter_for(db_config, *arguments); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:554 + def each_current_configuration(environment, name = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:567 + def each_local_configuration; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:579 + def local_database?(db_config); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:527 + def resolve_configuration(configuration); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:584 + def schema_sha1(file); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:588 + def structure_dump_flags_for(adapter); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:596 + def structure_load_flags_for(adapter); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:224 + def truncate_tables(db_config); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:531 + def verbose?; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:514 + def with_temporary_pool(db_config, clobber: T.unsafe(nil)); end + + class << self + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:50 + def structure_dump_flags; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:50 + def structure_dump_flags=(val); end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:56 + def structure_load_flags; end + + # pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:56 + def structure_load_flags=(val); end + end +end + +# pkg:gem/activerecord#lib/active_record/tasks/database_tasks.rb:63 +ActiveRecord::Tasks::DatabaseTasks::LOCAL_HOSTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:5 +class ActiveRecord::Tasks::MySQLDatabaseTasks + # pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:12 + def initialize(db_config); end + + # pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:34 + def charset; end + + # pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:38 + def collation; end + + # pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:17 + def create; end + + # pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:23 + def drop; end + + # pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:28 + def purge; end + + # pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:42 + def structure_dump(filename, extra_flags); end + + # pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:61 + def structure_load(filename, extra_flags); end + + private + + # pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:71 + def configuration_hash; end + + # pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:81 + def configuration_hash_without_database; end + + # pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:73 + def connection; end + + # pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:85 + def creation_options; end + + # pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:71 + def db_config; end + + # pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:77 + def establish_connection(config = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:92 + def prepare_command_options; end + + # pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:111 + def run_cmd(cmd, args, action); end + + # pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:115 + def run_cmd_error(cmd, args, action); end + + class << self + # pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:8 + def using_database_configurations?; end + end +end + +# pkg:gem/activerecord#lib/active_record/tasks/mysql_database_tasks.rb:6 +ActiveRecord::Tasks::MySQLDatabaseTasks::ER_DB_CREATE_EXISTS = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:7 +class ActiveRecord::Tasks::PostgreSQLDatabaseTasks + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:16 + def initialize(db_config); end + + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:32 + def charset; end + + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:36 + def collation; end + + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:21 + def create(connection_already_established = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:27 + def drop; end + + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:40 + def purge; end + + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:46 + def structure_dump(filename, extra_flags); end + + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:80 + def structure_load(filename, extra_flags); end + + private + + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:88 + def configuration_hash; end + + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:90 + def connection; end + + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:88 + def db_config; end + + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:98 + def encoding; end + + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:94 + def establish_connection(config = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:106 + def psql_env; end + + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:102 + def public_schema_config; end + + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:130 + def remove_sql_header_comments(filename); end + + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:119 + def run_cmd(cmd, args, action); end + + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:123 + def run_cmd_error(cmd, args, action); end + + class << self + # pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:12 + def using_database_configurations?; end + end +end + +# pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:8 +ActiveRecord::Tasks::PostgreSQLDatabaseTasks::DEFAULT_ENCODING = T.let(T.unsafe(nil), String) + +# pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:9 +ActiveRecord::Tasks::PostgreSQLDatabaseTasks::ON_ERROR_STOP_1 = T.let(T.unsafe(nil), String) + +# pkg:gem/activerecord#lib/active_record/tasks/postgresql_database_tasks.rb:10 +ActiveRecord::Tasks::PostgreSQLDatabaseTasks::SQL_COMMENT_BEGIN = T.let(T.unsafe(nil), String) + +# pkg:gem/activerecord#lib/active_record/tasks/sqlite_database_tasks.rb:5 +class ActiveRecord::Tasks::SQLiteDatabaseTasks + # pkg:gem/activerecord#lib/active_record/tasks/sqlite_database_tasks.rb:10 + def initialize(db_config, root = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/sqlite_database_tasks.rb:40 + def charset; end + + # pkg:gem/activerecord#lib/active_record/tasks/sqlite_database_tasks.rb:15 + def create; end + + # pkg:gem/activerecord#lib/active_record/tasks/sqlite_database_tasks.rb:22 + def drop; end + + # pkg:gem/activerecord#lib/active_record/tasks/sqlite_database_tasks.rb:31 + def purge; end + + # pkg:gem/activerecord#lib/active_record/tasks/sqlite_database_tasks.rb:44 + def structure_dump(filename, extra_flags); end + + # pkg:gem/activerecord#lib/active_record/tasks/sqlite_database_tasks.rb:60 + def structure_load(filename, extra_flags); end + + private + + # pkg:gem/activerecord#lib/active_record/tasks/sqlite_database_tasks.rb:68 + def connection; end + + # pkg:gem/activerecord#lib/active_record/tasks/sqlite_database_tasks.rb:66 + def db_config; end + + # pkg:gem/activerecord#lib/active_record/tasks/sqlite_database_tasks.rb:72 + def establish_connection(config = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/tasks/sqlite_database_tasks.rb:66 + def root; end + + # pkg:gem/activerecord#lib/active_record/tasks/sqlite_database_tasks.rb:76 + def run_cmd(cmd, args, out); end + + # pkg:gem/activerecord#lib/active_record/tasks/sqlite_database_tasks.rb:80 + def run_cmd_error(cmd, args); end + + class << self + # pkg:gem/activerecord#lib/active_record/tasks/sqlite_database_tasks.rb:6 + def using_database_configurations?; end + end +end + +# pkg:gem/activerecord#lib/active_record/test_databases.rb:6 +module ActiveRecord::TestDatabases + class << self + # pkg:gem/activerecord#lib/active_record/test_databases.rb:11 + def create_and_load_schema(i, env_name:); end + end +end + +# pkg:gem/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 + + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:14 + def after_teardown; end + + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:9 + def before_setup; end + + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:205 + def enlist_fixture_connections; end + + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:112 + def fixture_path; end + + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:121 + def run_in_transaction?; end + + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:126 + def setup_fixtures(config = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:188 + def teardown_fixtures; end + + private + + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:290 + def access_fixture(fs_name, *fixture_names); end + + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:258 + def instantiate_fixtures; end + + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:254 + def load_fixtures(config); end + + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:270 + def load_instances?; end + + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:274 + def method_missing(name, *args, **kwargs, &block); end + + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:282 + def respond_to_missing?(name, include_private = 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. + # + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:218 + def setup_shared_connection_pool; end + + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:237 + def teardown_shared_connection_pool; end + + module GeneratedClassMethods + 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 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 + +# pkg:gem/activerecord#lib/active_record/test_fixtures.rb:42 +module ActiveRecord::TestFixtures::ClassMethods + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:55 + def fixture_path; end + + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:64 + def fixture_path=(path); end + + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:69 + 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. + # + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:51 + def set_fixture_class(class_names = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:85 + def setup_fixture_accessors(fixture_set_names = 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. + # + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:101 + def uses_transaction(*methods); end + + # pkg:gem/activerecord#lib/active_record/test_fixtures.rb:106 + def uses_transaction?(method); end +end + +# pkg:gem/activerecord#lib/active_record/associations.rb:177 +class ActiveRecord::ThroughCantAssociateThroughHasOneOrManyReflection < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/associations.rb:178 + def initialize(owner = T.unsafe(nil), reflection = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/active_record/associations.rb:224 +class ActiveRecord::ThroughNestedAssociationsAreReadonly < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/associations.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 +# +# pkg:gem/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 + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:105 + def _create_record; end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:117 + def _update_record; end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:153 + def all_timestamp_attributes_in_model; end + + # Clear attributes and changed_attributes + # + # pkg:gem/activerecord#lib/active_record/timestamp.rb:168 + def clear_timestamp_attributes; end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:123 + def create_or_update(touch: T.unsafe(nil), **); end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:157 + def current_time_from_proper_timezone; end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:100 + def init_internals; end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:50 + def initialize_dup(other); end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:161 + def max_updated_column_timestamp; end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:128 + def record_update_timestamps; end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:141 + def should_record_timestamps?; end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:145 + def timestamp_attributes_for_create_in_model; end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:149 + 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 + +# pkg:gem/activerecord#lib/active_record/timestamp.rb:55 +module ActiveRecord::Timestamp::ClassMethods + # pkg:gem/activerecord#lib/active_record/timestamp.rb:72 + def all_timestamp_attributes_in_model; end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:77 + def current_time_from_proper_timezone; end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:62 + def timestamp_attributes_for_create_in_model; end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:67 + def timestamp_attributes_for_update_in_model; end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:56 + def touch_attributes_with_time(*names, time: T.unsafe(nil)); end + + protected + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:82 + def reload_schema_from_cache(recursive = T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:90 + def timestamp_attributes_for_create; end + + # pkg:gem/activerecord#lib/active_record/timestamp.rb:94 + def timestamp_attributes_for_update; end +end + +# pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/token_for.rb:109 + 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 + +# pkg:gem/activerecord#lib/active_record/token_for.rb:38 +module ActiveRecord::TokenFor::ClassMethods + # Finds a record using a given +token+ for a predefined +purpose+. Returns + # +nil+ if the token is invalid or the record was not found. + # + # pkg:gem/activerecord#lib/active_record/token_for.rb:90 + 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. + # + # pkg:gem/activerecord#lib/active_record/token_for.rb:99 + 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 + # + # pkg:gem/activerecord#lib/active_record/token_for.rb:84 + def generates_token_for(purpose, expires_in: T.unsafe(nil), &block); end +end + +# pkg:gem/activerecord#lib/active_record/token_for.rb:14 +class ActiveRecord::TokenFor::TokenDefinition < ::Struct + # pkg:gem/activerecord#lib/active_record/token_for.rb:14 + def block; end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:14 + def block=(_); end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:14 + def defining_class; end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:14 + def defining_class=(_); end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:14 + def expires_in; end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:14 + def expires_in=(_); end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:15 + def full_purpose; end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:27 + def generate_token(model); end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:19 + def message_verifier; end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:23 + def payload_for(model); end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:14 + def purpose; end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:14 + def purpose=(_); end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:31 + def resolve_token(token); end + + class << self + # pkg:gem/activerecord#lib/active_record/token_for.rb:14 + def [](*_arg0); end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:14 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:14 + def keyword_init?; end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:14 + def members; end + + # pkg:gem/activerecord#lib/active_record/token_for.rb:14 + def new(*_arg0); end + end +end + +# = Active Record Touch Later +# +# pkg:gem/activerecord#lib/active_record/touch_later.rb:5 +module ActiveRecord::TouchLater + # pkg:gem/activerecord#lib/active_record/touch_later.rb:6 + def before_committed!; end + + # pkg:gem/activerecord#lib/active_record/touch_later.rb:38 + def touch(*names, time: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/touch_later.rb:11 + def touch_later(*names); end + + private + + # pkg:gem/activerecord#lib/active_record/touch_later.rb:66 + def has_defer_touch_attrs?; end + + # pkg:gem/activerecord#lib/active_record/touch_later.rb:49 + def init_internals; end + + # pkg:gem/activerecord#lib/active_record/touch_later.rb:54 + def surreptitiously_touch(attr_names); end + + # pkg:gem/activerecord#lib/active_record/touch_later.rb:61 + def touch_deferred_attributes; end +end + +# 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. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:481 +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 +# +# pkg:gem/activerecord#lib/active_record/errors.rb:504 +class ActiveRecord::TransactionRollbackError < ::ActiveRecord::StatementInvalid; end + +# See ActiveRecord::Transactions::ClassMethods for documentation. +# +# pkg:gem/activerecord#lib/active_record/transactions.rb:5 +module ActiveRecord::Transactions + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveRecord::Transactions::ClassMethods + + # pkg:gem/activerecord#lib/active_record/transactions.rb:16 + def _new_record_before_last_commit; end + + # pkg:gem/activerecord#lib/active_record/transactions.rb:16 + def _new_record_before_last_commit=(_arg0); end + + # pkg:gem/activerecord#lib/active_record/transactions.rb:320 + 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. + # + # pkg:gem/activerecord#lib/active_record/transactions.rb:328 + def committed!(should_run_callbacks: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/transactions.rb:304 + 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. + # + # pkg:gem/activerecord#lib/active_record/transactions.rb:340 + def rolledback!(force_restore_state: T.unsafe(nil), should_run_callbacks: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/transactions.rb:308 + def save(**); end + + # pkg:gem/activerecord#lib/active_record/transactions.rb:312 + def save!(**); end + + # pkg:gem/activerecord#lib/active_record/transactions.rb:316 + def touch(*, **); end + + # See ActiveRecord::Transactions::ClassMethods for detailed documentation. + # + # pkg:gem/activerecord#lib/active_record/transactions.rb:300 + def transaction(**options, &block); end + + # pkg:gem/activerecord#lib/active_record/transactions.rb:371 + 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. + # + # pkg:gem/activerecord#lib/active_record/transactions.rb:356 + def with_transaction_returning_status; end + + private + + # pkg:gem/activerecord#lib/active_record/transactions.rb:377 + def _committed_already_called; end + + # pkg:gem/activerecord#lib/active_record/transactions.rb:377 + def _trigger_destroy_callback; end + + # pkg:gem/activerecord#lib/active_record/transactions.rb:377 + def _trigger_update_callback; end + + # Add the record to the current transaction so that the #after_rollback and #after_commit + # callbacks can be called. + # + # pkg:gem/activerecord#lib/active_record/transactions.rb:459 + def add_to_transaction(ensure_finalize = T.unsafe(nil)); end + + # Clear the new record state and id of a record. + # + # pkg:gem/activerecord#lib/active_record/transactions.rb:407 + def clear_transaction_record_state; end + + # pkg:gem/activerecord#lib/active_record/transactions.rb:463 + def has_transactional_callbacks?; end + + # pkg:gem/activerecord#lib/active_record/transactions.rb:379 + def init_internals; end + + # Save the new record state and id of a record so it can be restored later if a transaction fails. + # + # pkg:gem/activerecord#lib/active_record/transactions.rb:387 + 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. + # + # pkg:gem/activerecord#lib/active_record/transactions.rb:414 + 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. + # + # pkg:gem/activerecord#lib/active_record/transactions.rb:444 + def transaction_include_any_action?(actions); end +end + +# pkg:gem/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. +# +# === 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.connection.transaction do # BEGIN +# Model.connection.transaction(requires_new: true) do # CREATE SAVEPOINT active_record_1 +# Model.connection.create_table(...) # active_record_1 now automatically released +# end # RELEASE SAVEPOINT active_record_1 +# # ^^^^ BOOM! database error! +# end +# +# Note that "TRUNCATE" is also a MySQL DDL statement! +# +# pkg:gem/activerecord#lib/active_record/transactions.rb:209 +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] + # + # pkg:gem/activerecord#lib/active_record/transactions.rb:232 + def after_commit(*args, &block); end + + # Shortcut for after_commit :hook, on: :create. + # + # pkg:gem/activerecord#lib/active_record/transactions.rb:244 + def after_create_commit(*args, &block); end + + # Shortcut for after_commit :hook, on: :destroy. + # + # pkg:gem/activerecord#lib/active_record/transactions.rb:256 + 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. + # + # pkg:gem/activerecord#lib/active_record/transactions.rb:264 + def after_rollback(*args, &block); end + + # Shortcut for after_commit :hook, on: [ :create, :update ]. + # + # pkg:gem/activerecord#lib/active_record/transactions.rb:238 + def after_save_commit(*args, &block); end + + # Shortcut for after_commit :hook, on: :update. + # + # pkg:gem/activerecord#lib/active_record/transactions.rb:250 + def after_update_commit(*args, &block); end + + # pkg:gem/activerecord#lib/active_record/transactions.rb:215 + def before_commit(*args, &block); end + + # See the ConnectionAdapters::DatabaseStatements#transaction API docs. + # + # pkg:gem/activerecord#lib/active_record/transactions.rb:211 + def transaction(**options, &block); end + + private + + # pkg:gem/activerecord#lib/active_record/transactions.rb:292 + def assert_valid_transaction_action(actions); end + + # pkg:gem/activerecord#lib/active_record/transactions.rb:270 + def prepend_option; end + + # pkg:gem/activerecord#lib/active_record/transactions.rb:278 + def set_options_for_callbacks!(args, enforced_options = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/active_record/translation.rb:4 +module ActiveRecord::Translation + include ::ActiveModel::Naming + include ::ActiveModel::Translation + + # Set the i18n scope to override ActiveModel. + # + # pkg:gem/activerecord#lib/active_record/translation.rb:20 + def i18n_scope; end + + # Set the lookup ancestors for ActiveModel. + # + # pkg:gem/activerecord#lib/active_record/translation.rb:8 + def lookup_ancestors; end +end + +# :stopdoc: +# +# pkg:gem/activerecord#lib/active_record/type/internal/timezone.rb:4 +module ActiveRecord::Type + class << self + # pkg:gem/activerecord#lib/active_record/type.rb:49 + def adapter_name_from(model); end + + # pkg:gem/activerecord#lib/active_record/type.rb:27 + def add_modifier(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/type.rb:45 + def default_value; end + + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/type.rb:37 + def register(type_name, klass = T.unsafe(nil), **options, &block); end + + # pkg:gem/activerecord#lib/active_record/type.rb:26 + def registry; end + + # pkg:gem/activerecord#lib/active_record/type.rb:26 + def registry=(_arg0); end + + private + + # pkg:gem/activerecord#lib/active_record/type.rb:54 + def current_adapter_name; end + end +end + +# pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:6 +class ActiveRecord::Type::AdapterSpecificRegistry + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:7 + def initialize; end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:15 + def add_modifier(options, klass, **args); end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:27 + def lookup(symbol, *args, **kwargs); end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:19 + def register(type_name, klass = T.unsafe(nil), **options, &block); end + + private + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:40 + def find_registration(symbol, *args, **kwargs); end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:11 + def initialize_copy(other); end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:38 + def registrations; end +end + +# pkg:gem/activerecord#lib/active_record/type.rb:59 +ActiveRecord::Type::BigInteger = ActiveModel::Type::BigInteger + +# pkg:gem/activerecord#lib/active_record/type.rb:60 +ActiveRecord::Type::Binary = ActiveModel::Type::Binary + +# pkg:gem/activerecord#lib/active_record/type.rb:61 +ActiveRecord::Type::Boolean = ActiveModel::Type::Boolean + +# pkg:gem/activerecord#lib/active_record/type/date.rb:5 +class ActiveRecord::Type::Date < ::ActiveModel::Type::Date + include ::ActiveRecord::Type::Internal::Timezone +end + +# pkg:gem/activerecord#lib/active_record/type/date_time.rb:5 +class ActiveRecord::Type::DateTime < ::ActiveModel::Type::DateTime + include ::ActiveRecord::Type::Internal::Timezone +end + +# pkg:gem/activerecord#lib/active_record/type.rb:62 +ActiveRecord::Type::Decimal = ActiveModel::Type::Decimal + +# pkg:gem/activerecord#lib/active_record/type/decimal_without_scale.rb:5 +class ActiveRecord::Type::DecimalWithoutScale < ::ActiveModel::Type::BigInteger + # pkg:gem/activerecord#lib/active_record/type/decimal_without_scale.rb:6 + def type; end + + # pkg:gem/activerecord#lib/active_record/type/decimal_without_scale.rb:10 + def type_cast_for_schema(value); end +end + +# pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:110 +class ActiveRecord::Type::DecorationRegistration < ::ActiveRecord::Type::Registration + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:111 + def initialize(options, klass, adapter: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:117 + def call(registry, *args, **kwargs); end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:122 + def matches?(*args, **kwargs); end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:126 + def priority; end + + private + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:131 + def klass; end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:133 + def matches_options?(**kwargs); end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:131 + def options; end +end + +# pkg:gem/activerecord#lib/active_record/type.rb:63 +ActiveRecord::Type::Float = ActiveModel::Type::Float + +# pkg:gem/activerecord#lib/active_record/type/hash_lookup_type_map.rb:5 +class ActiveRecord::Type::HashLookupTypeMap + # pkg:gem/activerecord#lib/active_record/type/hash_lookup_type_map.rb:6 + def initialize(parent = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/type/hash_lookup_type_map.rb:39 + def alias_type(type, alias_type); end + + # pkg:gem/activerecord#lib/active_record/type/hash_lookup_type_map.rb:34 + def clear; end + + # pkg:gem/activerecord#lib/active_record/type/hash_lookup_type_map.rb:17 + def fetch(lookup_key, *args, &block); end + + # pkg:gem/activerecord#lib/active_record/type/hash_lookup_type_map.rb:43 + def key?(key); end + + # pkg:gem/activerecord#lib/active_record/type/hash_lookup_type_map.rb:47 + def keys; end + + # pkg:gem/activerecord#lib/active_record/type/hash_lookup_type_map.rb:13 + def lookup(lookup_key, *args); end + + # pkg:gem/activerecord#lib/active_record/type/hash_lookup_type_map.rb:23 + def register_type(key, value = T.unsafe(nil), &block); end + + private + + # pkg:gem/activerecord#lib/active_record/type/hash_lookup_type_map.rb:52 + def perform_fetch(type, *args, &block); end +end + +# pkg:gem/activerecord#lib/active_record/type.rb:65 +ActiveRecord::Type::ImmutableString = ActiveModel::Type::ImmutableString + +# pkg:gem/activerecord#lib/active_record/type.rb:64 +ActiveRecord::Type::Integer = ActiveModel::Type::Integer + +# pkg:gem/activerecord#lib/active_record/type/internal/timezone.rb:5 +module ActiveRecord::Type::Internal; end + +# pkg:gem/activerecord#lib/active_record/type/internal/timezone.rb:6 +module ActiveRecord::Type::Internal::Timezone + # pkg:gem/activerecord#lib/active_record/type/internal/timezone.rb:7 + def initialize(timezone: T.unsafe(nil), **kwargs); end + + # pkg:gem/activerecord#lib/active_record/type/internal/timezone.rb:16 + def default_timezone; end + + # pkg:gem/activerecord#lib/active_record/type/internal/timezone.rb:12 + def is_utc?; end +end + +# pkg:gem/activerecord#lib/active_record/type/json.rb:5 +class ActiveRecord::Type::Json < ::ActiveModel::Type::Value + include ::ActiveModel::Type::Helpers::Mutable + + # pkg:gem/activerecord#lib/active_record/type/json.rb:25 + def accessor; end + + # pkg:gem/activerecord#lib/active_record/type/json.rb:21 + def changed_in_place?(raw_old_value, new_value); end + + # pkg:gem/activerecord#lib/active_record/type/json.rb:12 + def deserialize(value); end + + # pkg:gem/activerecord#lib/active_record/type/json.rb:17 + def serialize(value); end + + # pkg:gem/activerecord#lib/active_record/type/json.rb:8 + def type; end +end + +# pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:47 +class ActiveRecord::Type::Registration + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:48 + def initialize(name, block, adapter: T.unsafe(nil), override: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:63 + def <=>(other); end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:55 + def call(_registry, *args, adapter: T.unsafe(nil), **kwargs); end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:59 + def matches?(type_name, *args, **kwargs); end + + protected + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:73 + def adapter; end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:73 + def block; end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:73 + def name; end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:73 + def override; end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:75 + def priority; end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:86 + def priority_except_adapter; end + + private + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:95 + def conflicts_with?(other); end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:104 + def has_adapter_conflict?(other); end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:91 + def matches_adapter?(adapter: T.unsafe(nil), **); end + + # pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:100 + def same_priority_except_adapter?(other); end +end + +# pkg:gem/activerecord#lib/active_record/type/serialized.rb:5 +class ActiveRecord::Type::Serialized + include ::ActiveModel::Type::Helpers::Mutable + + # pkg:gem/activerecord#lib/active_record/type/serialized.rb:12 + def initialize(subtype, coder); end + + # pkg:gem/activerecord#lib/active_record/type/serialized.rb:44 + def accessor; end + + # pkg:gem/activerecord#lib/active_record/type/serialized.rb:48 + def assert_valid_value(value); end + + # pkg:gem/activerecord#lib/active_record/type/serialized.rb:37 + def changed_in_place?(raw_old_value, value); end + + # pkg:gem/activerecord#lib/active_record/type/serialized.rb:10 + def coder; end + + # pkg:gem/activerecord#lib/active_record/type/serialized.rb:18 + def deserialize(value); end + + # pkg:gem/activerecord#lib/active_record/type/serialized.rb:54 + def force_equality?(value); end + + # pkg:gem/activerecord#lib/active_record/type/serialized.rb:33 + def inspect; end + + # pkg:gem/activerecord#lib/active_record/type/serialized.rb:26 + def serialize(value); end + + # pkg:gem/activerecord#lib/active_record/type/serialized.rb:58 + def serialized?; end + + # pkg:gem/activerecord#lib/active_record/type/serialized.rb:10 + def subtype; end + + private + + # pkg:gem/activerecord#lib/active_record/type/serialized.rb:63 + def default_value?(value); end + + # pkg:gem/activerecord#lib/active_record/type/serialized.rb:67 + def encoded(value); end +end + +# pkg:gem/activerecord#lib/active_record/type.rb:66 +ActiveRecord::Type::String = ActiveModel::Type::String + +# pkg:gem/activerecord#lib/active_record/type/text.rb:5 +class ActiveRecord::Type::Text < ::ActiveModel::Type::String + # pkg:gem/activerecord#lib/active_record/type/text.rb:6 + def type; end +end + +# pkg:gem/activerecord#lib/active_record/type/time.rb:5 +class ActiveRecord::Type::Time < ::ActiveModel::Type::Time + include ::ActiveRecord::Type::Internal::Timezone + + # pkg:gem/activerecord#lib/active_record/type/time.rb:11 + def serialize(value); end + + # pkg:gem/activerecord#lib/active_record/type/time.rb:20 + def serialize_cast_value(value); end + + private + + # pkg:gem/activerecord#lib/active_record/type/time.rb:25 + def cast_value(value); end +end + +# pkg:gem/activerecord#lib/active_record/type/time.rb:8 +class ActiveRecord::Type::Time::Value; end + +# pkg:gem/activerecord#lib/active_record/type/type_map.rb:7 +class ActiveRecord::Type::TypeMap + # pkg:gem/activerecord#lib/active_record/type/type_map.rb:8 + def initialize(parent = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/type/type_map.rb:35 + def alias_type(key, target_key); end + + # pkg:gem/activerecord#lib/active_record/type/type_map.rb:18 + def fetch(lookup_key, &block); end + + # pkg:gem/activerecord#lib/active_record/type/type_map.rb:14 + def lookup(lookup_key); end + + # pkg:gem/activerecord#lib/active_record/type/type_map.rb:24 + def register_type(key, value = T.unsafe(nil), &block); end + + protected + + # pkg:gem/activerecord#lib/active_record/type/type_map.rb:43 + def perform_fetch(lookup_key, &block); end +end + +# pkg:gem/activerecord#lib/active_record/type/unsigned_integer.rb:5 +class ActiveRecord::Type::UnsignedInteger < ::ActiveModel::Type::Integer + private + + # pkg:gem/activerecord#lib/active_record/type/unsigned_integer.rb:7 + def max_value; end + + # pkg:gem/activerecord#lib/active_record/type/unsigned_integer.rb:11 + def min_value; end +end + +# pkg:gem/activerecord#lib/active_record/type.rb:67 +ActiveRecord::Type::Value = ActiveModel::Type::Value + +# pkg:gem/activerecord#lib/active_record/type_caster/map.rb:4 +module ActiveRecord::TypeCaster; end + +# pkg:gem/activerecord#lib/active_record/type_caster/connection.rb:5 +class ActiveRecord::TypeCaster::Connection + # pkg:gem/activerecord#lib/active_record/type_caster/connection.rb:6 + def initialize(klass, table_name); end + + # pkg:gem/activerecord#lib/active_record/type_caster/connection.rb:11 + def type_cast_for_database(attr_name, value); end + + # pkg:gem/activerecord#lib/active_record/type_caster/connection.rb:16 + def type_for_attribute(attr_name); end + + private + + # pkg:gem/activerecord#lib/active_record/type_caster/connection.rb:27 + def connection(*, **, &); end + + # pkg:gem/activerecord#lib/active_record/type_caster/connection.rb:30 + def table_name; end +end + +# pkg:gem/activerecord#lib/active_record/type_caster/map.rb:5 +class ActiveRecord::TypeCaster::Map + # pkg:gem/activerecord#lib/active_record/type_caster/map.rb:6 + def initialize(klass); end + + # pkg:gem/activerecord#lib/active_record/type_caster/map.rb:10 + def type_cast_for_database(attr_name, value); end + + # pkg:gem/activerecord#lib/active_record/type_caster/map.rb:15 + def type_for_attribute(name); end + + private + + # pkg:gem/activerecord#lib/active_record/type_caster/map.rb:20 + def klass; end +end + +# pkg:gem/activerecord#lib/active_record/type/adapter_specific_registry.rb:141 +class ActiveRecord::TypeConflictError < ::StandardError; end + +# Raised when unknown attributes are supplied via mass assignment. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:417 +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. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:578 +class ActiveRecord::UnknownAttributeReference < ::ActiveRecord::ActiveRecordError; end + +# pkg:gem/activerecord#lib/active_record/migration.rb:114 +class ActiveRecord::UnknownMigrationVersionError < ::ActiveRecord::MigrationError + # pkg:gem/activerecord#lib/active_record/migration.rb:115 + def initialize(version = T.unsafe(nil)); end +end + +# Raised when a primary key is needed, but not specified in the schema or model. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:445 +class ActiveRecord::UnknownPrimaryKey < ::ActiveRecord::ActiveRecordError + # pkg:gem/activerecord#lib/active_record/errors.rb:448 + def initialize(model = T.unsafe(nil), description = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/errors.rb:446 + def model; end +end + +# pkg:gem/activerecord#lib/active_record/gem_version.rb:9 +module ActiveRecord::VERSION; end + +# pkg:gem/activerecord#lib/active_record/gem_version.rb:10 +ActiveRecord::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activerecord#lib/active_record/gem_version.rb:11 +ActiveRecord::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activerecord#lib/active_record/gem_version.rb:13 +ActiveRecord::VERSION::PRE = T.let(T.unsafe(nil), String) + +# pkg:gem/activerecord#lib/active_record/gem_version.rb:15 +ActiveRecord::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/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?]. +# +# pkg:gem/activerecord#lib/active_record/validations.rb:40 +module ActiveRecord::Validations + extend ::ActiveSupport::Concern + include GeneratedInstanceMethods + include ::ActiveSupport::Callbacks + include ::ActiveModel::Validations::HelperMethods + include ::ActiveModel::Validations + + 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 ::ActiveRecord::Validations::ClassMethods + + # 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. + # + # pkg:gem/activerecord#lib/active_record/validations.rb:48 + 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. + # + # pkg:gem/activerecord#lib/active_record/validations.rb:54 + 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. + # + # pkg:gem/activerecord#lib/active_record/validations.rb:70 + def valid?(context = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/validations.rb:76 + def validate(context = T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/active_record/validations.rb:79 + def default_validation_context; end + + # pkg:gem/activerecord#lib/active_record/validations.rb:87 + def perform_validations(options = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/active_record/validations.rb:83 + def raise_validation_error; end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def __callbacks?; end + def _validators; end + def _validators=(value); end + def _validators?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def __callbacks?; end + def _validators; end + def _validators?; end + end +end + +# pkg:gem/activerecord#lib/active_record/validations/absence.rb:5 +class ActiveRecord::Validations::AbsenceValidator < ::ActiveModel::Validations::AbsenceValidator + # pkg:gem/activerecord#lib/active_record/validations/absence.rb:6 + def validate_each(record, attribute, association_or_value); end +end + +# pkg:gem/activerecord#lib/active_record/validations/associated.rb:5 +class ActiveRecord::Validations::AssociatedValidator < ::ActiveModel::EachValidator + # pkg:gem/activerecord#lib/active_record/validations/associated.rb:6 + def validate_each(record, attribute, value); end + + private + + # pkg:gem/activerecord#lib/active_record/validations/associated.rb:13 + def valid_object?(record); end +end + +# pkg:gem/activerecord#lib/active_record/validations/associated.rb:18 +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. + # + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/validations/associated.rb:54 + 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. + # + # pkg:gem/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. + # + # pkg:gem/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]. + # + # pkg:gem/activerecord#lib/active_record/validations/presence.rb:40 + def validates_presence_of(*attr_names); end + + # pkg:gem/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. + # + # pkg:gem/activerecord#lib/active_record/validations/uniqueness.rb:286 + def validates_uniqueness_of(*attr_names); end +end + +# pkg:gem/activerecord#lib/active_record/validations/length.rb:5 +class ActiveRecord::Validations::LengthValidator < ::ActiveModel::Validations::LengthValidator + # pkg:gem/activerecord#lib/active_record/validations/length.rb:6 + def validate_each(record, attribute, association_or_value); end +end + +# pkg:gem/activerecord#lib/active_record/validations/numericality.rb:5 +class ActiveRecord::Validations::NumericalityValidator < ::ActiveModel::Validations::NumericalityValidator + # pkg:gem/activerecord#lib/active_record/validations/numericality.rb:6 + def validate_each(record, attribute, value, precision: T.unsafe(nil), scale: T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/active_record/validations/numericality.rb:13 + def column_precision_for(record, attribute); end + + # pkg:gem/activerecord#lib/active_record/validations/numericality.rb:17 + def column_scale_for(record, attribute); end +end + +# pkg:gem/activerecord#lib/active_record/validations/presence.rb:5 +class ActiveRecord::Validations::PresenceValidator < ::ActiveModel::Validations::PresenceValidator + # pkg:gem/activerecord#lib/active_record/validations/presence.rb:6 + def validate_each(record, attribute, association_or_value); end +end + +# pkg:gem/activerecord#lib/active_record/validations/uniqueness.rb:5 +class ActiveRecord::Validations::UniquenessValidator < ::ActiveModel::EachValidator + # pkg:gem/activerecord#lib/active_record/validations/uniqueness.rb:6 + def initialize(options); end + + # pkg:gem/activerecord#lib/active_record/validations/uniqueness.rb:19 + def validate_each(record, attribute, value); end + + private + + # pkg:gem/activerecord#lib/active_record/validations/uniqueness.rb:111 + def build_relation(klass, attribute, value); end + + # pkg:gem/activerecord#lib/active_record/validations/uniqueness.rb:82 + 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. Since classes don't know + # their subclasses, we have to build the hierarchy between self and + # the record's class. + # + # pkg:gem/activerecord#lib/active_record/validations/uniqueness.rb:59 + def find_finder_class_for(record); end + + # pkg:gem/activerecord#lib/active_record/validations/uniqueness.rb:142 + def map_enum_attribute(klass, attribute, value); end + + # pkg:gem/activerecord#lib/active_record/validations/uniqueness.rb:97 + def resolve_attributes(record, attributes); end + + # pkg:gem/activerecord#lib/active_record/validations/uniqueness.rb:129 + def scope_relation(record, relation); end + + # pkg:gem/activerecord#lib/active_record/validations/uniqueness.rb:69 + 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. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:276 +class ActiveRecord::ValueTooLong < ::ActiveRecord::StatementInvalid; end + +# Defunct wrapper class kept for compatibility. +# StatementInvalid wraps the original exception now. +# +# pkg:gem/activerecord#lib/active_record/errors.rb:204 +class ActiveRecord::WrappedDatabaseException < ::ActiveRecord::StatementInvalid; end + +# pkg:gem/activerecord#lib/arel/errors.rb:3 +module Arel + class << self + # pkg:gem/activerecord#lib/arel.rb:60 + def arel_node?(value); end + + # pkg:gem/activerecord#lib/arel.rb:64 + 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. + # + # pkg:gem/activerecord#lib/arel.rb:48 + def sql(sql_string, *positional_binds, **named_binds); end + + # pkg:gem/activerecord#lib/arel.rb:56 + def star; end + end +end + +# pkg:gem/activerecord#lib/arel/alias_predication.rb:4 +module Arel::AliasPredication + # pkg:gem/activerecord#lib/arel/alias_predication.rb:5 + def as(other); end +end + +# pkg:gem/activerecord#lib/arel/errors.rb:4 +class Arel::ArelError < ::StandardError; end + +# pkg:gem/activerecord#lib/arel/attributes/attribute.rb:32 +Arel::Attribute = Arel::Attributes::Attribute + +# pkg:gem/activerecord#lib/arel/attributes/attribute.rb:4 +module Arel::Attributes; end + +# pkg:gem/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 + + # pkg:gem/activerecord#lib/arel/attributes/attribute.rb:26 + def able_to_type_cast?; end + + # Create a node for lowering this attribute + # + # pkg:gem/activerecord#lib/arel/attributes/attribute.rb:18 + def lower; end + + # pkg:gem/activerecord#lib/arel/attributes/attribute.rb:22 + def type_cast_for_database(value); end + + # pkg:gem/activerecord#lib/arel/attributes/attribute.rb:12 + def type_caster; end +end + +# pkg:gem/activerecord#lib/arel/errors.rb:10 +class Arel::BindError < ::Arel::ArelError + # pkg:gem/activerecord#lib/arel/errors.rb:11 + def initialize(message, sql = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/arel/collectors/plain_string.rb:4 +module Arel::Collectors; end + +# pkg:gem/activerecord#lib/arel/collectors/bind.rb:5 +class Arel::Collectors::Bind + # pkg:gem/activerecord#lib/arel/collectors/bind.rb:6 + def initialize; end + + # pkg:gem/activerecord#lib/arel/collectors/bind.rb:10 + def <<(str); end + + # pkg:gem/activerecord#lib/arel/collectors/bind.rb:14 + def add_bind(bind); end + + # pkg:gem/activerecord#lib/arel/collectors/bind.rb:19 + def add_binds(binds, proc_for_binds = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/collectors/bind.rb:24 + def value; end +end + +# pkg:gem/activerecord#lib/arel/collectors/composite.rb:5 +class Arel::Collectors::Composite + # pkg:gem/activerecord#lib/arel/collectors/composite.rb:8 + def initialize(left, right); end + + # pkg:gem/activerecord#lib/arel/collectors/composite.rb:13 + def <<(str); end + + # pkg:gem/activerecord#lib/arel/collectors/composite.rb:19 + def add_bind(bind, &block); end + + # pkg:gem/activerecord#lib/arel/collectors/composite.rb:25 + def add_binds(binds, proc_for_binds = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/arel/collectors/composite.rb:6 + def preparable; end + + # pkg:gem/activerecord#lib/arel/collectors/composite.rb:6 + def preparable=(_arg0); end + + # pkg:gem/activerecord#lib/arel/collectors/composite.rb:31 + def value; end + + private + + # pkg:gem/activerecord#lib/arel/collectors/composite.rb:36 + def left; end + + # pkg:gem/activerecord#lib/arel/collectors/composite.rb:36 + def right; end +end + +# pkg:gem/activerecord#lib/arel/collectors/plain_string.rb:5 +class Arel::Collectors::PlainString + # pkg:gem/activerecord#lib/arel/collectors/plain_string.rb:6 + def initialize; end + + # pkg:gem/activerecord#lib/arel/collectors/plain_string.rb:14 + def <<(str); end + + # pkg:gem/activerecord#lib/arel/collectors/plain_string.rb:10 + def value; end +end + +# pkg:gem/activerecord#lib/arel/collectors/sql_string.rb:7 +class Arel::Collectors::SQLString < ::Arel::Collectors::PlainString + # pkg:gem/activerecord#lib/arel/collectors/sql_string.rb:10 + def initialize(*); end + + # pkg:gem/activerecord#lib/arel/collectors/sql_string.rb:15 + def add_bind(bind); end + + # pkg:gem/activerecord#lib/arel/collectors/sql_string.rb:21 + def add_binds(binds, proc_for_binds = T.unsafe(nil), &block); end + + # pkg:gem/activerecord#lib/arel/collectors/sql_string.rb:8 + def preparable; end + + # pkg:gem/activerecord#lib/arel/collectors/sql_string.rb:8 + def preparable=(_arg0); end +end + +# pkg:gem/activerecord#lib/arel/collectors/substitute_binds.rb:5 +class Arel::Collectors::SubstituteBinds + # pkg:gem/activerecord#lib/arel/collectors/substitute_binds.rb:8 + def initialize(quoter, delegate_collector); end + + # pkg:gem/activerecord#lib/arel/collectors/substitute_binds.rb:13 + def <<(str); end + + # pkg:gem/activerecord#lib/arel/collectors/substitute_binds.rb:18 + def add_bind(bind); end + + # pkg:gem/activerecord#lib/arel/collectors/substitute_binds.rb:23 + def add_binds(binds, proc_for_binds = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/collectors/substitute_binds.rb:6 + def preparable; end + + # pkg:gem/activerecord#lib/arel/collectors/substitute_binds.rb:6 + def preparable=(_arg0); end + + # pkg:gem/activerecord#lib/arel/collectors/substitute_binds.rb:27 + def value; end + + private + + # pkg:gem/activerecord#lib/arel/collectors/substitute_binds.rb:32 + def delegate; end + + # pkg:gem/activerecord#lib/arel/collectors/substitute_binds.rb:32 + def quoter; end +end + +# FIXME hopefully we can remove this +# +# pkg:gem/activerecord#lib/arel/crud.rb:6 +module Arel::Crud + # pkg:gem/activerecord#lib/arel/crud.rb:36 + def compile_delete(key = T.unsafe(nil), having_clause = T.unsafe(nil), group_values_columns = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/crud.rb:7 + def compile_insert(values); end + + # pkg:gem/activerecord#lib/arel/crud.rb:17 + def compile_update(values, key = T.unsafe(nil), having_clause = T.unsafe(nil), group_values_columns = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/crud.rb:13 + def create_insert; end +end + +# pkg:gem/activerecord#lib/arel/delete_manager.rb:4 +class Arel::DeleteManager < ::Arel::TreeManager + include ::Arel::TreeManager::StatementMethods + + # pkg:gem/activerecord#lib/arel/delete_manager.rb:7 + def initialize(table = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/delete_manager.rb:11 + def from(relation); end + + # pkg:gem/activerecord#lib/arel/delete_manager.rb:16 + def group(columns); end + + # pkg:gem/activerecord#lib/arel/delete_manager.rb:27 + def having(expr); end +end + +# pkg:gem/activerecord#lib/arel/errors.rb:7 +class Arel::EmptyJoinError < ::Arel::ArelError; end + +# pkg:gem/activerecord#lib/arel/expressions.rb:4 +module Arel::Expressions + # pkg:gem/activerecord#lib/arel/expressions.rb:21 + def average; end + + # pkg:gem/activerecord#lib/arel/expressions.rb:5 + def count(distinct = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/expressions.rb:25 + def extract(field); end + + # pkg:gem/activerecord#lib/arel/expressions.rb:13 + def maximum; end + + # pkg:gem/activerecord#lib/arel/expressions.rb:17 + def minimum; end + + # pkg:gem/activerecord#lib/arel/expressions.rb:9 + def sum; end +end + +# Methods for creating various nodes +# +# pkg:gem/activerecord#lib/arel/factory_methods.rb:6 +module Arel::FactoryMethods + # pkg:gem/activerecord#lib/arel/factory_methods.rb:49 + def cast(name, type); end + + # pkg:gem/activerecord#lib/arel/factory_methods.rb:45 + def coalesce(*exprs); end + + # pkg:gem/activerecord#lib/arel/factory_methods.rb:27 + def create_and(clauses); end + + # pkg:gem/activerecord#lib/arel/factory_methods.rb:11 + def create_false; end + + # pkg:gem/activerecord#lib/arel/factory_methods.rb:19 + def create_join(to, constraint = T.unsafe(nil), klass = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/factory_methods.rb:31 + def create_on(expr); end + + # pkg:gem/activerecord#lib/arel/factory_methods.rb:23 + def create_string_join(to); end + + # pkg:gem/activerecord#lib/arel/factory_methods.rb:15 + def create_table_alias(relation, name); end + + # pkg:gem/activerecord#lib/arel/factory_methods.rb:7 + def create_true; end + + # pkg:gem/activerecord#lib/arel/factory_methods.rb:35 + def grouping(expr); end + + # Create a LOWER() function + # + # pkg:gem/activerecord#lib/arel/factory_methods.rb:41 + def lower(column); end +end + +# pkg:gem/activerecord#lib/arel/filter_predications.rb:4 +module Arel::FilterPredications + # pkg:gem/activerecord#lib/arel/filter_predications.rb:5 + def filter(expr); end +end + +# pkg:gem/activerecord#lib/arel/insert_manager.rb:4 +class Arel::InsertManager < ::Arel::TreeManager + # pkg:gem/activerecord#lib/arel/insert_manager.rb:5 + def initialize(table = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/insert_manager.rb:14 + def columns; end + + # pkg:gem/activerecord#lib/arel/insert_manager.rb:40 + def create_values(values); end + + # pkg:gem/activerecord#lib/arel/insert_manager.rb:44 + def create_values_list(rows); end + + # pkg:gem/activerecord#lib/arel/insert_manager.rb:21 + def insert(fields); end + + # pkg:gem/activerecord#lib/arel/insert_manager.rb:9 + def into(table); end + + # pkg:gem/activerecord#lib/arel/insert_manager.rb:17 + def select(select); end + + # pkg:gem/activerecord#lib/arel/insert_manager.rb:15 + def values=(val); end +end + +# pkg:gem/activerecord#lib/arel/math.rb:4 +module Arel::Math + # pkg:gem/activerecord#lib/arel/math.rb:21 + def &(other); end + + # pkg:gem/activerecord#lib/arel/math.rb:5 + def *(other); end + + # pkg:gem/activerecord#lib/arel/math.rb:9 + def +(other); end + + # pkg:gem/activerecord#lib/arel/math.rb:13 + def -(other); end + + # pkg:gem/activerecord#lib/arel/math.rb:17 + def /(other); end + + # pkg:gem/activerecord#lib/arel/math.rb:33 + def <<(other); end + + # pkg:gem/activerecord#lib/arel/math.rb:37 + def >>(other); end + + # pkg:gem/activerecord#lib/arel/math.rb:29 + def ^(other); end + + # pkg:gem/activerecord#lib/arel/math.rb:25 + def |(other); end + + # pkg:gem/activerecord#lib/arel/math.rb:41 + def ~; end +end + +# pkg:gem/activerecord#lib/arel/nodes/node.rb:4 +module Arel::Nodes + class << self + # pkg:gem/activerecord#lib/arel/nodes/casted.rb:48 + def build_quoted(other, attribute = T.unsafe(nil)); end + end +end + +# pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:32 +class Arel::Nodes::Addition < ::Arel::Nodes::InfixOperation + # pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:33 + def initialize(left, right); end +end + +# pkg:gem/activerecord#lib/arel/nodes/and.rb:5 +class Arel::Nodes::And < ::Arel::Nodes::NodeExpression + # pkg:gem/activerecord#lib/arel/nodes/and.rb:8 + def initialize(children); end + + # pkg:gem/activerecord#lib/arel/nodes/and.rb:33 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/and.rb:6 + def children; end + + # pkg:gem/activerecord#lib/arel/nodes/and.rb:29 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/and.rb:21 + def fetch_attribute(&block); end + + # pkg:gem/activerecord#lib/arel/nodes/and.rb:25 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/and.rb:13 + def left; end + + # pkg:gem/activerecord#lib/arel/nodes/and.rb:17 + def right; end +end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:42 +class Arel::Nodes::As < ::Arel::Nodes::Binary + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:43 + def to_cte; end +end + +# pkg:gem/activerecord#lib/arel/nodes/ascending.rb:5 +class Arel::Nodes::Ascending < ::Arel::Nodes::Ordering + # pkg:gem/activerecord#lib/arel/nodes/ascending.rb:14 + def ascending?; end + + # pkg:gem/activerecord#lib/arel/nodes/ascending.rb:18 + def descending?; end + + # pkg:gem/activerecord#lib/arel/nodes/ascending.rb:10 + def direction; end + + # pkg:gem/activerecord#lib/arel/nodes/ascending.rb:6 + def reverse; end +end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:128 +class Arel::Nodes::Assignment < ::Arel::Nodes::Binary; end + +# pkg:gem/activerecord#lib/arel/nodes/function.rb:42 +class Arel::Nodes::Avg < ::Arel::Nodes::Function; end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:48 +class Arel::Nodes::Between < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute +end + +# pkg:gem/activerecord#lib/arel/nodes/unary.rb:41 +class Arel::Nodes::Bin < ::Arel::Nodes::Unary; end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:5 +class Arel::Nodes::Binary < ::Arel::Nodes::NodeExpression + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:8 + def initialize(left, right); end + + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:29 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:24 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:20 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:6 + def left; end + + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:6 + def left=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:6 + def right; end + + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:6 + def right=(_arg0); end + + private + + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:14 + def initialize_copy(other); end +end + +# pkg:gem/activerecord#lib/arel/nodes/bind_param.rb:5 +class Arel::Nodes::BindParam < ::Arel::Nodes::Node + # pkg:gem/activerecord#lib/arel/nodes/bind_param.rb:8 + def initialize(value); end + + # pkg:gem/activerecord#lib/arel/nodes/bind_param.rb:21 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/bind_param.rb:17 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/bind_param.rb:13 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/bind_param.rb:35 + def infinite?; end + + # pkg:gem/activerecord#lib/arel/nodes/bind_param.rb:23 + def nil?; end + + # pkg:gem/activerecord#lib/arel/nodes/bind_param.rb:39 + def unboundable?; end + + # pkg:gem/activerecord#lib/arel/nodes/bind_param.rb:6 + def value; end + + # pkg:gem/activerecord#lib/arel/nodes/bind_param.rb:27 + def value_before_type_cast; end +end + +# pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:62 +class Arel::Nodes::BitwiseAnd < ::Arel::Nodes::InfixOperation + # pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:63 + def initialize(left, right); end +end + +# pkg:gem/activerecord#lib/arel/nodes/unary_operation.rb:14 +class Arel::Nodes::BitwiseNot < ::Arel::Nodes::UnaryOperation + # pkg:gem/activerecord#lib/arel/nodes/unary_operation.rb:15 + def initialize(operand); end +end + +# pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:68 +class Arel::Nodes::BitwiseOr < ::Arel::Nodes::InfixOperation + # pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:69 + def initialize(left, right); end +end + +# pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:80 +class Arel::Nodes::BitwiseShiftLeft < ::Arel::Nodes::InfixOperation + # pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:81 + def initialize(left, right); end +end + +# pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:86 +class Arel::Nodes::BitwiseShiftRight < ::Arel::Nodes::InfixOperation + # pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:87 + def initialize(left, right); end +end + +# pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:74 +class Arel::Nodes::BitwiseXor < ::Arel::Nodes::InfixOperation + # pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:75 + def initialize(left, right); end +end + +# pkg:gem/activerecord#lib/arel/nodes/bound_sql_literal.rb:5 +class Arel::Nodes::BoundSqlLiteral < ::Arel::Nodes::NodeExpression + # pkg:gem/activerecord#lib/arel/nodes/bound_sql_literal.rb:8 + def initialize(sql_with_placeholders, positional_binds, named_binds); end + + # pkg:gem/activerecord#lib/arel/nodes/bound_sql_literal.rb:50 + def +(other); end + + # pkg:gem/activerecord#lib/arel/nodes/bound_sql_literal.rb:48 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/bound_sql_literal.rb:42 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/bound_sql_literal.rb:38 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/bound_sql_literal.rb:56 + def inspect; end + + # pkg:gem/activerecord#lib/arel/nodes/bound_sql_literal.rb:6 + def named_binds; end + + # pkg:gem/activerecord#lib/arel/nodes/bound_sql_literal.rb:6 + def positional_binds; end + + # pkg:gem/activerecord#lib/arel/nodes/bound_sql_literal.rb:6 + def sql_with_placeholders; end +end + +# pkg:gem/activerecord#lib/arel/nodes/case.rb:5 +class Arel::Nodes::Case < ::Arel::Nodes::NodeExpression + # pkg:gem/activerecord#lib/arel/nodes/case.rb:8 + def initialize(expression = T.unsafe(nil), default = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/nodes/case.rb:46 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/case.rb:6 + def case; end + + # pkg:gem/activerecord#lib/arel/nodes/case.rb:6 + def case=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/case.rb:6 + def conditions; end + + # pkg:gem/activerecord#lib/arel/nodes/case.rb:6 + def conditions=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/case.rb:6 + def default; end + + # pkg:gem/activerecord#lib/arel/nodes/case.rb:6 + def default=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/case.rb:24 + def else(expression); end + + # pkg:gem/activerecord#lib/arel/nodes/case.rb:40 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/case.rb:36 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/case.rb:19 + def then(expression); end + + # pkg:gem/activerecord#lib/arel/nodes/case.rb:14 + def when(condition, expression = T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/arel/nodes/case.rb:29 + def initialize_copy(other); end +end + +# pkg:gem/activerecord#lib/arel/nodes/casted.rb:5 +class Arel::Nodes::Casted < ::Arel::Nodes::NodeExpression + # pkg:gem/activerecord#lib/arel/nodes/casted.rb:9 + def initialize(value, attribute); end + + # pkg:gem/activerecord#lib/arel/nodes/casted.rb:34 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/casted.rb:6 + def attribute; end + + # pkg:gem/activerecord#lib/arel/nodes/casted.rb:29 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/casted.rb:25 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/casted.rb:15 + def nil?; end + + # pkg:gem/activerecord#lib/arel/nodes/casted.rb:6 + def value; end + + # pkg:gem/activerecord#lib/arel/nodes/casted.rb:7 + def value_before_type_cast; end + + # pkg:gem/activerecord#lib/arel/nodes/casted.rb:17 + def value_for_database; end +end + +# pkg:gem/activerecord#lib/arel/nodes/comment.rb:5 +class Arel::Nodes::Comment < ::Arel::Nodes::Node + # pkg:gem/activerecord#lib/arel/nodes/comment.rb:8 + def initialize(values); end + + # pkg:gem/activerecord#lib/arel/nodes/comment.rb:26 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/comment.rb:22 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/comment.rb:18 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/comment.rb:6 + def values; end + + private + + # pkg:gem/activerecord#lib/arel/nodes/comment.rb:13 + def initialize_copy(other); end +end + +# pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:44 +class Arel::Nodes::Concat < ::Arel::Nodes::InfixOperation + # pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:45 + def initialize(left, right); end +end + +# pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:50 +class Arel::Nodes::Contains < ::Arel::Nodes::InfixOperation + # pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:51 + def initialize(left, right); end +end + +# pkg:gem/activerecord#lib/arel/nodes/count.rb:5 +class Arel::Nodes::Count < ::Arel::Nodes::Function + # pkg:gem/activerecord#lib/arel/nodes/count.rb:6 + def initialize(expr, distinct = T.unsafe(nil), aliaz = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/arel/nodes/cte.rb:5 +class Arel::Nodes::Cte < ::Arel::Nodes::Binary + # pkg:gem/activerecord#lib/arel/nodes/cte.rb:10 + def initialize(name, relation, materialized: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/nodes/cte.rb:25 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/cte.rb:19 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/cte.rb:15 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/cte.rb:8 + def materialized; end + + # pkg:gem/activerecord#lib/arel/nodes/cte.rb:6 + def name; end + + # pkg:gem/activerecord#lib/arel/nodes/cte.rb:7 + def relation; end + + # pkg:gem/activerecord#lib/arel/nodes/cte.rb:27 + def to_cte; end + + # pkg:gem/activerecord#lib/arel/nodes/cte.rb:31 + def to_table; end +end + +# pkg:gem/activerecord#lib/arel/nodes/unary.rb:41 +class Arel::Nodes::Cube < ::Arel::Nodes::Unary; end + +# pkg:gem/activerecord#lib/arel/nodes/window.rb:103 +class Arel::Nodes::CurrentRow < ::Arel::Nodes::Node + # pkg:gem/activerecord#lib/arel/nodes/window.rb:111 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:108 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:104 + def hash; end +end + +# pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:5 +class Arel::Nodes::DeleteStatement < ::Arel::Nodes::Node + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:8 + def initialize(relation = T.unsafe(nil), wheres = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:41 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:30 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:6 + def groups; end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:6 + def groups=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:26 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:6 + def havings; end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:6 + def havings=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:6 + def key; end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:6 + def key=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:6 + def limit; end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:6 + def limit=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:6 + def offset; end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:6 + def offset=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:6 + def orders; end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:6 + def orders=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:6 + def relation; end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:6 + def relation=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:6 + def wheres; end + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:6 + def wheres=(_arg0); end + + private + + # pkg:gem/activerecord#lib/arel/nodes/delete_statement.rb:20 + def initialize_copy(other); end +end + +# pkg:gem/activerecord#lib/arel/nodes/descending.rb:5 +class Arel::Nodes::Descending < ::Arel::Nodes::Ordering + # pkg:gem/activerecord#lib/arel/nodes/descending.rb:14 + def ascending?; end + + # pkg:gem/activerecord#lib/arel/nodes/descending.rb:18 + def descending?; end + + # pkg:gem/activerecord#lib/arel/nodes/descending.rb:10 + def direction; end + + # pkg:gem/activerecord#lib/arel/nodes/descending.rb:6 + def reverse; end +end + +# pkg:gem/activerecord#lib/arel/nodes/terminal.rb:5 +class Arel::Nodes::Distinct < ::Arel::Nodes::NodeExpression + # pkg:gem/activerecord#lib/arel/nodes/terminal.rb:13 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/terminal.rb:10 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/terminal.rb:6 + def hash; end +end + +# pkg:gem/activerecord#lib/arel/nodes/unary.rb:41 +class Arel::Nodes::DistinctOn < ::Arel::Nodes::Unary; end + +# pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:26 +class Arel::Nodes::Division < ::Arel::Nodes::InfixOperation + # pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:27 + def initialize(left, right); end +end + +# pkg:gem/activerecord#lib/arel/nodes/matches.rb:16 +class Arel::Nodes::DoesNotMatch < ::Arel::Nodes::Matches; end + +# pkg:gem/activerecord#lib/arel/nodes/case.rb:52 +class Arel::Nodes::Else < ::Arel::Nodes::Unary; end + +# pkg:gem/activerecord#lib/arel/nodes/equality.rb:5 +class Arel::Nodes::Equality < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # pkg:gem/activerecord#lib/arel/nodes/equality.rb:8 + def equality?; end + + # pkg:gem/activerecord#lib/arel/nodes/equality.rb:10 + def invert; end +end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:128 +class Arel::Nodes::Except < ::Arel::Nodes::Binary; end + +# pkg:gem/activerecord#lib/arel/nodes/function.rb:42 +class Arel::Nodes::Exists < ::Arel::Nodes::Function; end + +# pkg:gem/activerecord#lib/arel/nodes/extract.rb:5 +class Arel::Nodes::Extract < ::Arel::Nodes::Unary + # pkg:gem/activerecord#lib/arel/nodes/extract.rb:8 + def initialize(expr, field); end + + # pkg:gem/activerecord#lib/arel/nodes/extract.rb:21 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/extract.rb:17 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/extract.rb:6 + def field; end + + # pkg:gem/activerecord#lib/arel/nodes/extract.rb:6 + def field=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/extract.rb:13 + def hash; end +end + +# pkg:gem/activerecord#lib/arel/nodes/false.rb:5 +class Arel::Nodes::False < ::Arel::Nodes::NodeExpression + # pkg:gem/activerecord#lib/arel/nodes/false.rb:13 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/false.rb:10 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/false.rb:6 + def hash; end +end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:32 +module Arel::Nodes::FetchAttribute + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:33 + def fetch_attribute; end +end + +# pkg:gem/activerecord#lib/arel/nodes/filter.rb:5 +class Arel::Nodes::Filter < ::Arel::Nodes::Binary + include ::Arel::WindowPredications +end + +# pkg:gem/activerecord#lib/arel/nodes/window.rb:120 +class Arel::Nodes::Following < ::Arel::Nodes::Unary + # pkg:gem/activerecord#lib/arel/nodes/window.rb:121 + def initialize(expr = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/arel/nodes/fragments.rb:5 +class Arel::Nodes::Fragments < ::Arel::Nodes::Node + # pkg:gem/activerecord#lib/arel/nodes/fragments.rb:8 + def initialize(values = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/nodes/fragments.rb:22 + def +(other); end + + # pkg:gem/activerecord#lib/arel/nodes/fragments.rb:32 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/fragments.rb:28 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/fragments.rb:18 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/fragments.rb:6 + def values; end + + private + + # pkg:gem/activerecord#lib/arel/nodes/fragments.rb:13 + def initialize_copy(other); end +end + +# pkg:gem/activerecord#lib/arel/nodes/full_outer_join.rb:5 +class Arel::Nodes::FullOuterJoin < ::Arel::Nodes::Join; end + +# pkg:gem/activerecord#lib/arel/nodes/function.rb:5 +class Arel::Nodes::Function < ::Arel::Nodes::NodeExpression + include ::Arel::WindowPredications + include ::Arel::FilterPredications + + # pkg:gem/activerecord#lib/arel/nodes/function.rb:10 + def initialize(expr, aliaz = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/nodes/function.rb:32 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/function.rb:8 + def alias; end + + # pkg:gem/activerecord#lib/arel/nodes/function.rb:8 + def alias=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/function.rb:17 + def as(aliaz); end + + # pkg:gem/activerecord#lib/arel/nodes/function.rb:8 + def distinct; end + + # pkg:gem/activerecord#lib/arel/nodes/function.rb:8 + def distinct=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/function.rb:26 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/function.rb:8 + def expressions; end + + # pkg:gem/activerecord#lib/arel/nodes/function.rb:8 + def expressions=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/function.rb:22 + def hash; end +end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:50 +class Arel::Nodes::GreaterThan < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:53 + def invert; end +end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:58 +class Arel::Nodes::GreaterThanOrEqual < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:61 + def invert; end +end + +# pkg:gem/activerecord#lib/arel/nodes/unary.rb:41 +class Arel::Nodes::Group < ::Arel::Nodes::Unary; end + +# pkg:gem/activerecord#lib/arel/nodes/grouping.rb:5 +class Arel::Nodes::Grouping < ::Arel::Nodes::Unary + # pkg:gem/activerecord#lib/arel/nodes/grouping.rb:6 + def fetch_attribute(&block); end +end + +# pkg:gem/activerecord#lib/arel/nodes/unary.rb:41 +class Arel::Nodes::GroupingElement < ::Arel::Nodes::Unary; end + +# pkg:gem/activerecord#lib/arel/nodes/unary.rb:41 +class Arel::Nodes::GroupingSet < ::Arel::Nodes::Unary; end + +# pkg:gem/activerecord#lib/arel/nodes/homogeneous_in.rb:5 +class Arel::Nodes::HomogeneousIn < ::Arel::Nodes::Node + # pkg:gem/activerecord#lib/arel/nodes/homogeneous_in.rb:8 + def initialize(values, attribute, type); end + + # pkg:gem/activerecord#lib/arel/nodes/homogeneous_in.rb:21 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/homogeneous_in.rb:6 + def attribute; end + + # pkg:gem/activerecord#lib/arel/nodes/homogeneous_in.rb:39 + def casted_values; end + + # pkg:gem/activerecord#lib/arel/nodes/homogeneous_in.rb:18 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/homogeneous_in.rb:23 + def equality?; end + + # pkg:gem/activerecord#lib/arel/nodes/homogeneous_in.rb:54 + def fetch_attribute(&block); end + + # pkg:gem/activerecord#lib/arel/nodes/homogeneous_in.rb:14 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/homogeneous_in.rb:27 + def invert; end + + # pkg:gem/activerecord#lib/arel/nodes/homogeneous_in.rb:31 + def left; end + + # pkg:gem/activerecord#lib/arel/nodes/homogeneous_in.rb:50 + def proc_for_binds; end + + # pkg:gem/activerecord#lib/arel/nodes/homogeneous_in.rb:35 + def right; end + + # pkg:gem/activerecord#lib/arel/nodes/homogeneous_in.rb:6 + def type; end + + # pkg:gem/activerecord#lib/arel/nodes/homogeneous_in.rb:6 + def values; end + + protected + + # pkg:gem/activerecord#lib/arel/nodes/homogeneous_in.rb:63 + def ivars; end +end + +# pkg:gem/activerecord#lib/arel/nodes/in.rb:5 +class Arel::Nodes::In < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # pkg:gem/activerecord#lib/arel/nodes/in.rb:8 + def equality?; end + + # pkg:gem/activerecord#lib/arel/nodes/in.rb:10 + def invert; end +end + +# pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:5 +class Arel::Nodes::InfixOperation < ::Arel::Nodes::Binary + # pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:14 + def initialize(operator, left, right); end + + # pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:12 + def operator; end +end + +# pkg:gem/activerecord#lib/arel/nodes/inner_join.rb:5 +class Arel::Nodes::InnerJoin < ::Arel::Nodes::Join; end + +# pkg:gem/activerecord#lib/arel/nodes/insert_statement.rb:5 +class Arel::Nodes::InsertStatement < ::Arel::Nodes::Node + # pkg:gem/activerecord#lib/arel/nodes/insert_statement.rb:8 + def initialize(relation = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/nodes/insert_statement.rb:34 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/insert_statement.rb:6 + def columns; end + + # pkg:gem/activerecord#lib/arel/nodes/insert_statement.rb:6 + def columns=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/insert_statement.rb:27 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/insert_statement.rb:23 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/insert_statement.rb:6 + def relation; end + + # pkg:gem/activerecord#lib/arel/nodes/insert_statement.rb:6 + def relation=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/insert_statement.rb:6 + def select; end + + # pkg:gem/activerecord#lib/arel/nodes/insert_statement.rb:6 + def select=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/insert_statement.rb:6 + def values; end + + # pkg:gem/activerecord#lib/arel/nodes/insert_statement.rb:6 + def values=(_arg0); end + + private + + # pkg:gem/activerecord#lib/arel/nodes/insert_statement.rb:16 + def initialize_copy(other); end +end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:128 +class Arel::Nodes::Intersect < ::Arel::Nodes::Binary; end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:82 +class Arel::Nodes::IsDistinctFrom < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:85 + def invert; end +end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:90 +class Arel::Nodes::IsNotDistinctFrom < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:93 + def invert; end +end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:128 +class Arel::Nodes::Join < ::Arel::Nodes::Binary; end + +# Class that represents a join source +# +# https://www.sqlite.org/syntaxdiagrams.html#join-source +# +# pkg:gem/activerecord#lib/arel/nodes/join_source.rb:10 +class Arel::Nodes::JoinSource < ::Arel::Nodes::Binary + # pkg:gem/activerecord#lib/arel/nodes/join_source.rb:11 + def initialize(single_source, joinop = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/nodes/join_source.rb:15 + def empty?; end +end + +# pkg:gem/activerecord#lib/arel/nodes/unary.rb:41 +class Arel::Nodes::Lateral < ::Arel::Nodes::Unary; end + +# pkg:gem/activerecord#lib/arel/nodes/leading_join.rb:5 +class Arel::Nodes::LeadingJoin < ::Arel::Nodes::InnerJoin; end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:66 +class Arel::Nodes::LessThan < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:69 + def invert; end +end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:74 +class Arel::Nodes::LessThanOrEqual < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:77 + def invert; end +end + +# pkg:gem/activerecord#lib/arel/nodes/unary.rb:41 +class Arel::Nodes::Limit < ::Arel::Nodes::Unary; end + +# pkg:gem/activerecord#lib/arel/nodes/unary.rb:41 +class Arel::Nodes::Lock < ::Arel::Nodes::Unary; end + +# pkg:gem/activerecord#lib/arel/nodes/matches.rb:5 +class Arel::Nodes::Matches < ::Arel::Nodes::Binary + # pkg:gem/activerecord#lib/arel/nodes/matches.rb:9 + def initialize(left, right, escape = T.unsafe(nil), case_sensitive = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/nodes/matches.rb:7 + def case_sensitive; end + + # pkg:gem/activerecord#lib/arel/nodes/matches.rb:7 + def case_sensitive=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/matches.rb:6 + def escape; end +end + +# pkg:gem/activerecord#lib/arel/nodes/function.rb:42 +class Arel::Nodes::Max < ::Arel::Nodes::Function; end + +# pkg:gem/activerecord#lib/arel/nodes/function.rb:42 +class Arel::Nodes::Min < ::Arel::Nodes::Function; end + +# pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:20 +class Arel::Nodes::Multiplication < ::Arel::Nodes::InfixOperation + # pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:21 + def initialize(left, right); end +end + +# pkg:gem/activerecord#lib/arel/nodes/named_function.rb:5 +class Arel::Nodes::NamedFunction < ::Arel::Nodes::Function + # pkg:gem/activerecord#lib/arel/nodes/named_function.rb:8 + def initialize(name, expr, aliaz = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/nodes/named_function.rb:20 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/named_function.rb:17 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/named_function.rb:13 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/named_function.rb:6 + def name; end + + # pkg:gem/activerecord#lib/arel/nodes/named_function.rb:6 + def name=(_arg0); end +end + +# pkg:gem/activerecord#lib/arel/nodes/window.rb:68 +class Arel::Nodes::NamedWindow < ::Arel::Nodes::Window + # pkg:gem/activerecord#lib/arel/nodes/window.rb:71 + def initialize(name); end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:88 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:85 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:81 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:69 + def name; end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:69 + def name=(_arg0); end + + private + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:76 + def initialize_copy(other); 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 a 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' +# +# pkg:gem/activerecord#lib/arel/nodes/node.rb:116 +class Arel::Nodes::Node + include ::Arel::FactoryMethods + + # Factory method to create an Nodes::And node. + # + # pkg:gem/activerecord#lib/arel/nodes/node.rb:135 + def and(right); end + + # pkg:gem/activerecord#lib/arel/nodes/node.rb:157 + def equality?; end + + # pkg:gem/activerecord#lib/arel/nodes/node.rb:154 + def fetch_attribute; end + + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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`? :'( + # + # pkg:gem/activerecord#lib/arel/nodes/node.rb:148 + def to_sql(engine = T.unsafe(nil)); end +end + +# pkg:gem/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 + +# pkg:gem/activerecord#lib/arel/nodes/unary.rb:41 +class Arel::Nodes::Not < ::Arel::Nodes::Unary; end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:98 +class Arel::Nodes::NotEqual < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:101 + def invert; end +end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:106 +class Arel::Nodes::NotIn < ::Arel::Nodes::Binary + include ::Arel::Nodes::FetchAttribute + + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:109 + def invert; end +end + +# pkg:gem/activerecord#lib/arel/nodes/regexp.rb:14 +class Arel::Nodes::NotRegexp < ::Arel::Nodes::Regexp; end + +# pkg:gem/activerecord#lib/arel/nodes/ordering.rb:15 +class Arel::Nodes::NullsFirst < ::Arel::Nodes::Ordering + # pkg:gem/activerecord#lib/arel/nodes/ordering.rb:16 + def reverse; end +end + +# pkg:gem/activerecord#lib/arel/nodes/ordering.rb:21 +class Arel::Nodes::NullsLast < ::Arel::Nodes::Ordering + # pkg:gem/activerecord#lib/arel/nodes/ordering.rb:22 + def reverse; end +end + +# pkg:gem/activerecord#lib/arel/nodes/unary.rb:41 +class Arel::Nodes::Offset < ::Arel::Nodes::Unary; end + +# pkg:gem/activerecord#lib/arel/nodes/unary.rb:41 +class Arel::Nodes::On < ::Arel::Nodes::Unary; end + +# pkg:gem/activerecord#lib/arel/nodes/unary.rb:41 +class Arel::Nodes::OptimizerHints < ::Arel::Nodes::Unary; end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:114 +class Arel::Nodes::Or < ::Arel::Nodes::Binary + # pkg:gem/activerecord#lib/arel/nodes/binary.rb:115 + def fetch_attribute(&block); end +end + +# pkg:gem/activerecord#lib/arel/nodes/ordering.rb:5 +class Arel::Nodes::Ordering < ::Arel::Nodes::Unary + # pkg:gem/activerecord#lib/arel/nodes/ordering.rb:6 + def nulls_first; end + + # pkg:gem/activerecord#lib/arel/nodes/ordering.rb:10 + def nulls_last; end +end + +# pkg:gem/activerecord#lib/arel/nodes/outer_join.rb:5 +class Arel::Nodes::OuterJoin < ::Arel::Nodes::Join; end + +# pkg:gem/activerecord#lib/arel/nodes/over.rb:5 +class Arel::Nodes::Over < ::Arel::Nodes::Binary + # pkg:gem/activerecord#lib/arel/nodes/over.rb:8 + def initialize(left, right = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/nodes/over.rb:12 + def operator; end +end + +# pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:56 +class Arel::Nodes::Overlaps < ::Arel::Nodes::InfixOperation + # pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:57 + def initialize(left, right); end +end + +# pkg:gem/activerecord#lib/arel/nodes/window.rb:114 +class Arel::Nodes::Preceding < ::Arel::Nodes::Unary + # pkg:gem/activerecord#lib/arel/nodes/window.rb:115 + def initialize(expr = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/arel/nodes/casted.rb:37 +class Arel::Nodes::Quoted < ::Arel::Nodes::Unary + # pkg:gem/activerecord#lib/arel/nodes/casted.rb:43 + def infinite?; end + + # pkg:gem/activerecord#lib/arel/nodes/casted.rb:41 + def nil?; end + + # pkg:gem/activerecord#lib/arel/nodes/casted.rb:39 + def value_before_type_cast; end + + # pkg:gem/activerecord#lib/arel/nodes/casted.rb:38 + def value_for_database; end +end + +# pkg:gem/activerecord#lib/arel/nodes/window.rb:97 +class Arel::Nodes::Range < ::Arel::Nodes::Unary + # pkg:gem/activerecord#lib/arel/nodes/window.rb:98 + def initialize(expr = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/arel/nodes/regexp.rb:5 +class Arel::Nodes::Regexp < ::Arel::Nodes::Binary + # pkg:gem/activerecord#lib/arel/nodes/regexp.rb:8 + def initialize(left, right, case_sensitive = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/nodes/regexp.rb:6 + def case_sensitive; end + + # pkg:gem/activerecord#lib/arel/nodes/regexp.rb:6 + def case_sensitive=(_arg0); end +end + +# pkg:gem/activerecord#lib/arel/nodes/right_outer_join.rb:5 +class Arel::Nodes::RightOuterJoin < ::Arel::Nodes::Join; end + +# pkg:gem/activerecord#lib/arel/nodes/unary.rb:41 +class Arel::Nodes::RollUp < ::Arel::Nodes::Unary; end + +# pkg:gem/activerecord#lib/arel/nodes/window.rb:91 +class Arel::Nodes::Rows < ::Arel::Nodes::Unary + # pkg:gem/activerecord#lib/arel/nodes/window.rb:92 + def initialize(expr = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/arel/nodes/select_core.rb:5 +class Arel::Nodes::SelectCore < ::Arel::Nodes::Node + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:9 + def initialize(relation = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:64 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:6 + def comment; end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:6 + def comment=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:52 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:24 + def from; end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:28 + def from=(value); end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:33 + def froms; end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:32 + def froms=(value); end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:6 + def groups; end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:6 + def groups=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:45 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:7 + def havings; end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:7 + def havings=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:7 + def optimizer_hints; end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:7 + def optimizer_hints=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:6 + def projections; end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:6 + def projections=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:7 + def set_quantifier; end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:7 + def set_quantifier=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:7 + def source; end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:7 + def source=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:6 + def wheres; end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:6 + def wheres=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:6 + def windows; end + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:6 + def windows=(_arg0); end + + private + + # pkg:gem/activerecord#lib/arel/nodes/select_core.rb:35 + def initialize_copy(other); end +end + +# pkg:gem/activerecord#lib/arel/nodes/select_statement.rb:5 +class Arel::Nodes::SelectStatement < ::Arel::Nodes::NodeExpression + # pkg:gem/activerecord#lib/arel/nodes/select_statement.rb:9 + def initialize(relation = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/nodes/select_statement.rb:38 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/select_statement.rb:6 + def cores; end + + # pkg:gem/activerecord#lib/arel/nodes/select_statement.rb:29 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/select_statement.rb:25 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/select_statement.rb:7 + def limit; end + + # pkg:gem/activerecord#lib/arel/nodes/select_statement.rb:7 + def limit=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/select_statement.rb:7 + def lock; end + + # pkg:gem/activerecord#lib/arel/nodes/select_statement.rb:7 + def lock=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/select_statement.rb:7 + def offset; end + + # pkg:gem/activerecord#lib/arel/nodes/select_statement.rb:7 + def offset=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/select_statement.rb:7 + def orders; end + + # pkg:gem/activerecord#lib/arel/nodes/select_statement.rb:7 + def orders=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/select_statement.rb:7 + def with; end + + # pkg:gem/activerecord#lib/arel/nodes/select_statement.rb:7 + def with=(_arg0); end + + private + + # pkg:gem/activerecord#lib/arel/nodes/select_statement.rb:19 + def initialize_copy(other); end +end + +# pkg:gem/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 + + # pkg:gem/activerecord#lib/arel/nodes/sql_literal.rb:18 + def +(other); end + + # pkg:gem/activerecord#lib/arel/nodes/sql_literal.rb:11 + def encode_with(coder); end + + # pkg:gem/activerecord#lib/arel/nodes/sql_literal.rb:15 + def fetch_attribute; end +end + +# pkg:gem/activerecord#lib/arel/nodes/string_join.rb:5 +class Arel::Nodes::StringJoin < ::Arel::Nodes::Join + # pkg:gem/activerecord#lib/arel/nodes/string_join.rb:6 + def initialize(left, right = T.unsafe(nil)); end +end + +# pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:38 +class Arel::Nodes::Subtraction < ::Arel::Nodes::InfixOperation + # pkg:gem/activerecord#lib/arel/nodes/infix_operation.rb:39 + def initialize(left, right); end +end + +# pkg:gem/activerecord#lib/arel/nodes/function.rb:42 +class Arel::Nodes::Sum < ::Arel::Nodes::Function; end + +# pkg:gem/activerecord#lib/arel/nodes/table_alias.rb:5 +class Arel::Nodes::TableAlias < ::Arel::Nodes::Binary + # pkg:gem/activerecord#lib/arel/nodes/table_alias.rb:10 + def [](name); end + + # pkg:gem/activerecord#lib/arel/nodes/table_alias.rb:26 + def able_to_type_cast?; end + + # pkg:gem/activerecord#lib/arel/nodes/table_alias.rb:6 + def name; end + + # pkg:gem/activerecord#lib/arel/nodes/table_alias.rb:7 + def relation; end + + # pkg:gem/activerecord#lib/arel/nodes/table_alias.rb:8 + def table_alias; end + + # pkg:gem/activerecord#lib/arel/nodes/table_alias.rb:14 + def table_name; end + + # pkg:gem/activerecord#lib/arel/nodes/table_alias.rb:30 + def to_cte; end + + # pkg:gem/activerecord#lib/arel/nodes/table_alias.rb:18 + def type_cast_for_database(attr_name, value); end + + # pkg:gem/activerecord#lib/arel/nodes/table_alias.rb:22 + def type_for_attribute(name); end +end + +# pkg:gem/activerecord#lib/arel/nodes/true.rb:5 +class Arel::Nodes::True < ::Arel::Nodes::NodeExpression + # pkg:gem/activerecord#lib/arel/nodes/true.rb:13 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/true.rb:10 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/true.rb:6 + def hash; end +end + +# pkg:gem/activerecord#lib/arel/nodes/unary.rb:5 +class Arel::Nodes::Unary < ::Arel::Nodes::NodeExpression + # pkg:gem/activerecord#lib/arel/nodes/unary.rb:9 + def initialize(expr); end + + # pkg:gem/activerecord#lib/arel/nodes/unary.rb:22 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/unary.rb:18 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/unary.rb:6 + def expr; end + + # pkg:gem/activerecord#lib/arel/nodes/unary.rb:6 + def expr=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/unary.rb:14 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/unary.rb:7 + def value; end +end + +# pkg:gem/activerecord#lib/arel/nodes/unary_operation.rb:5 +class Arel::Nodes::UnaryOperation < ::Arel::Nodes::Unary + # pkg:gem/activerecord#lib/arel/nodes/unary_operation.rb:8 + def initialize(operator, operand); end + + # pkg:gem/activerecord#lib/arel/nodes/unary_operation.rb:6 + def operator; end +end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:128 +class Arel::Nodes::Union < ::Arel::Nodes::Binary; end + +# pkg:gem/activerecord#lib/arel/nodes/binary.rb:128 +class Arel::Nodes::UnionAll < ::Arel::Nodes::Binary; end + +# pkg:gem/activerecord#lib/arel/nodes/unqualified_column.rb:5 +class Arel::Nodes::UnqualifiedColumn < ::Arel::Nodes::Unary + # pkg:gem/activerecord#lib/arel/nodes/unqualified_column.rb:6 + def attribute; end + + # pkg:gem/activerecord#lib/arel/nodes/unqualified_column.rb:7 + def attribute=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/unqualified_column.rb:13 + def column; end + + # pkg:gem/activerecord#lib/arel/nodes/unqualified_column.rb:17 + def name; end + + # pkg:gem/activerecord#lib/arel/nodes/unqualified_column.rb:9 + def relation; end +end + +# pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:5 +class Arel::Nodes::UpdateStatement < ::Arel::Nodes::Node + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:8 + def initialize(relation = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:43 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:31 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:6 + def groups; end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:6 + def groups=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:27 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:6 + def havings; end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:6 + def havings=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:6 + def key; end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:6 + def key=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:6 + def limit; end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:6 + def limit=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:6 + def offset; end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:6 + def offset=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:6 + def orders; end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:6 + def orders=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:6 + def relation; end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:6 + def relation=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:6 + def values; end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:6 + def values=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:6 + def wheres; end + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:6 + def wheres=(_arg0); end + + private + + # pkg:gem/activerecord#lib/arel/nodes/update_statement.rb:21 + def initialize_copy(other); end +end + +# pkg:gem/activerecord#lib/arel/nodes/values_list.rb:5 +class Arel::Nodes::ValuesList < ::Arel::Nodes::Unary + # pkg:gem/activerecord#lib/arel/nodes/values_list.rb:6 + def rows; end +end + +# pkg:gem/activerecord#lib/arel/nodes/case.rb:49 +class Arel::Nodes::When < ::Arel::Nodes::Binary; end + +# pkg:gem/activerecord#lib/arel/nodes/window.rb:5 +class Arel::Nodes::Window < ::Arel::Nodes::Node + # pkg:gem/activerecord#lib/arel/nodes/window.rb:8 + def initialize; end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:65 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:59 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:30 + def frame(expr); end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:6 + def framing; end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:6 + def framing=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:55 + def hash; end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:14 + def order(*expr); end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:6 + def orders; end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:6 + def orders=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:22 + def partition(*expr); end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:6 + def partitions; end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:6 + def partitions=(_arg0); end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:42 + def range(expr = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:34 + def rows(expr = T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/arel/nodes/window.rb:50 + def initialize_copy(other); end +end + +# pkg:gem/activerecord#lib/arel/nodes/with.rb:5 +class Arel::Nodes::With < ::Arel::Nodes::Unary + # pkg:gem/activerecord#lib/arel/nodes/with.rb:6 + def children; end +end + +# pkg:gem/activerecord#lib/arel/nodes/with.rb:9 +class Arel::Nodes::WithRecursive < ::Arel::Nodes::With; end + +# pkg:gem/activerecord#lib/arel/order_predications.rb:4 +module Arel::OrderPredications + # pkg:gem/activerecord#lib/arel/order_predications.rb:5 + def asc; end + + # pkg:gem/activerecord#lib/arel/order_predications.rb:9 + def desc; end +end + +# pkg:gem/activerecord#lib/arel/predications.rb:4 +module Arel::Predications + # pkg:gem/activerecord#lib/arel/predications.rb:37 + def between(other); end + + # pkg:gem/activerecord#lib/arel/predications.rb:215 + def concat(other); end + + # pkg:gem/activerecord#lib/arel/predications.rb:219 + def contains(other); end + + # pkg:gem/activerecord#lib/arel/predications.rb:147 + def does_not_match(other, escape = T.unsafe(nil), case_sensitive = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/predications.rb:159 + def does_not_match_all(others, escape = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/predications.rb:155 + def does_not_match_any(others, escape = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/predications.rb:151 + def does_not_match_regexp(other, case_sensitive = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/predications.rb:17 + def eq(other); end + + # pkg:gem/activerecord#lib/arel/predications.rb:33 + def eq_all(others); end + + # pkg:gem/activerecord#lib/arel/predications.rb:29 + def eq_any(others); end + + # pkg:gem/activerecord#lib/arel/predications.rb:175 + def gt(right); end + + # pkg:gem/activerecord#lib/arel/predications.rb:183 + def gt_all(others); end + + # pkg:gem/activerecord#lib/arel/predications.rb:179 + def gt_any(others); end + + # pkg:gem/activerecord#lib/arel/predications.rb:163 + def gteq(right); end + + # pkg:gem/activerecord#lib/arel/predications.rb:171 + def gteq_all(others); end + + # pkg:gem/activerecord#lib/arel/predications.rb:167 + def gteq_any(others); end + + # pkg:gem/activerecord#lib/arel/predications.rb:65 + def in(other); end + + # pkg:gem/activerecord#lib/arel/predications.rb:80 + def in_all(others); end + + # pkg:gem/activerecord#lib/arel/predications.rb:76 + def in_any(others); end + + # pkg:gem/activerecord#lib/arel/predications.rb:25 + def is_distinct_from(other); end + + # pkg:gem/activerecord#lib/arel/predications.rb:21 + def is_not_distinct_from(other); end + + # pkg:gem/activerecord#lib/arel/predications.rb:187 + def lt(right); end + + # pkg:gem/activerecord#lib/arel/predications.rb:195 + def lt_all(others); end + + # pkg:gem/activerecord#lib/arel/predications.rb:191 + def lt_any(others); end + + # pkg:gem/activerecord#lib/arel/predications.rb:199 + def lteq(right); end + + # pkg:gem/activerecord#lib/arel/predications.rb:207 + def lteq_all(others); end + + # pkg:gem/activerecord#lib/arel/predications.rb:203 + def lteq_any(others); end + + # pkg:gem/activerecord#lib/arel/predications.rb:131 + def matches(other, escape = T.unsafe(nil), case_sensitive = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/predications.rb:143 + def matches_all(others, escape = T.unsafe(nil), case_sensitive = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/predications.rb:139 + def matches_any(others, escape = T.unsafe(nil), case_sensitive = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/predications.rb:135 + def matches_regexp(other, case_sensitive = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/predications.rb:84 + def not_between(other); end + + # pkg:gem/activerecord#lib/arel/predications.rb:5 + def not_eq(other); end + + # pkg:gem/activerecord#lib/arel/predications.rb:13 + def not_eq_all(others); end + + # pkg:gem/activerecord#lib/arel/predications.rb:9 + def not_eq_any(others); end + + # pkg:gem/activerecord#lib/arel/predications.rb:112 + def not_in(other); end + + # pkg:gem/activerecord#lib/arel/predications.rb:127 + def not_in_all(others); end + + # pkg:gem/activerecord#lib/arel/predications.rb:123 + def not_in_any(others); end + + # pkg:gem/activerecord#lib/arel/predications.rb:223 + def overlaps(other); end + + # pkg:gem/activerecord#lib/arel/predications.rb:227 + def quoted_array(others); end + + # pkg:gem/activerecord#lib/arel/predications.rb:211 + def when(right); end + + private + + # pkg:gem/activerecord#lib/arel/predications.rb:239 + def grouping_all(method_id, others, *extras); end + + # pkg:gem/activerecord#lib/arel/predications.rb:232 + def grouping_any(method_id, others, *extras); end + + # pkg:gem/activerecord#lib/arel/predications.rb:248 + def infinity?(value); end + + # pkg:gem/activerecord#lib/arel/predications.rb:256 + def open_ended?(value); end + + # pkg:gem/activerecord#lib/arel/predications.rb:244 + def quoted_node(other); end + + # pkg:gem/activerecord#lib/arel/predications.rb:252 + def unboundable?(value); end +end + +# pkg:gem/activerecord#lib/arel/select_manager.rb:4 +class Arel::SelectManager < ::Arel::TreeManager + include ::Arel::Crud + + # pkg:gem/activerecord#lib/arel/select_manager.rb:9 + def initialize(table = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:48 + def as(other); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:252 + def comment(*values); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:24 + def constraints; end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:154 + def distinct(value = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:163 + def distinct_on(value); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:213 + def except(other); end + + # Produces an Arel::Nodes::Exists node + # + # pkg:gem/activerecord#lib/arel/select_manager.rb:44 + def exists; end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:85 + def from(table); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:98 + def froms; end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:74 + def group(*columns); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:119 + def having(expr); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:209 + def intersect(other); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:102 + def join(relation, klass = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:244 + def join_sources; end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:218 + def lateral(table_name = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:19 + def limit; end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:242 + def limit=(limit); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:52 + def lock(locking = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:65 + def locked; end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:216 + def minus(other); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:28 + def offset; end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:40 + def offset=(amount); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:69 + def on(*exprs); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:147 + def optimizer_hints(*hints); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:172 + def order(*expr); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:180 + def orders; end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:115 + def outer_join(relation); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:130 + def project(*projections); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:139 + def projections; end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:143 + def projections=(projections); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:32 + def skip(amount); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:248 + def source; end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:234 + def take(limit); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:22 + def taken; end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:198 + def union(operation, other = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:184 + def where(expr); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:192 + def where_sql(engine = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:124 + def window(name); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:223 + def with(*subqueries); end + + private + + # pkg:gem/activerecord#lib/arel/select_manager.rb:258 + def collapse(exprs); end + + # pkg:gem/activerecord#lib/arel/select_manager.rb:14 + def initialize_copy(other); end +end + +# pkg:gem/activerecord#lib/arel/select_manager.rb:7 +Arel::SelectManager::STRING_OR_SYMBOL_CLASS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activerecord#lib/arel/table.rb:4 +class Arel::Table + include ::Arel::FactoryMethods + include ::Arel::AliasPredication + + # pkg:gem/activerecord#lib/arel/table.rb:14 + def initialize(name, as: T.unsafe(nil), klass: T.unsafe(nil), type_caster: T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/table.rb:104 + def ==(other); end + + # pkg:gem/activerecord#lib/arel/table.rb:86 + def [](name, table = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/table.rb:114 + def able_to_type_cast?; end + + # pkg:gem/activerecord#lib/arel/table.rb:34 + def alias(name = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/table.rb:99 + def eql?(other); end + + # pkg:gem/activerecord#lib/arel/table.rb:38 + def from; end + + # pkg:gem/activerecord#lib/arel/table.rb:58 + def group(*columns); end + + # pkg:gem/activerecord#lib/arel/table.rb:92 + def hash; end + + # pkg:gem/activerecord#lib/arel/table.rb:82 + def having(expr); end + + # pkg:gem/activerecord#lib/arel/table.rb:42 + def join(relation, klass = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/table.rb:11 + def name; end + + # pkg:gem/activerecord#lib/arel/table.rb:11 + def name=(_arg0); end + + # pkg:gem/activerecord#lib/arel/table.rb:62 + def order(*expr); end + + # pkg:gem/activerecord#lib/arel/table.rb:54 + def outer_join(relation); end + + # pkg:gem/activerecord#lib/arel/table.rb:70 + def project(*things); end + + # pkg:gem/activerecord#lib/arel/table.rb:78 + def skip(amount); end + + # pkg:gem/activerecord#lib/arel/table.rb:12 + def table_alias; end + + # pkg:gem/activerecord#lib/arel/table.rb:74 + def take(amount); end + + # pkg:gem/activerecord#lib/arel/table.rb:106 + def type_cast_for_database(attr_name, value); end + + # pkg:gem/activerecord#lib/arel/table.rb:110 + def type_for_attribute(name); end + + # pkg:gem/activerecord#lib/arel/table.rb:66 + def where(condition); end + + private + + # pkg:gem/activerecord#lib/arel/table.rb:119 + def type_caster; end + + class << self + # pkg:gem/activerecord#lib/arel/table.rb:9 + def engine; end + + # pkg:gem/activerecord#lib/arel/table.rb:9 + def engine=(_arg0); end + end +end + +# pkg:gem/activerecord#lib/arel/tree_manager.rb:4 +class Arel::TreeManager + include ::Arel::FactoryMethods + + # pkg:gem/activerecord#lib/arel/tree_manager.rb:41 + def ast; end + + # pkg:gem/activerecord#lib/arel/tree_manager.rb:43 + def to_dot; end + + # pkg:gem/activerecord#lib/arel/tree_manager.rb:49 + def to_sql(engine = T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/arel/tree_manager.rb:55 + def initialize_copy(other); end +end + +# pkg:gem/activerecord#lib/arel/tree_manager.rb:7 +module Arel::TreeManager::StatementMethods + # pkg:gem/activerecord#lib/arel/tree_manager.rb:27 + def key; end + + # pkg:gem/activerecord#lib/arel/tree_manager.rb:23 + def key=(key); end + + # pkg:gem/activerecord#lib/arel/tree_manager.rb:13 + def offset(offset); end + + # pkg:gem/activerecord#lib/arel/tree_manager.rb:18 + def order(*expr); end + + # pkg:gem/activerecord#lib/arel/tree_manager.rb:8 + def take(limit); end + + # pkg:gem/activerecord#lib/arel/tree_manager.rb:35 + def where(expr); end + + # pkg:gem/activerecord#lib/arel/tree_manager.rb:31 + def wheres=(exprs); end +end + +# pkg:gem/activerecord#lib/arel/update_manager.rb:4 +class Arel::UpdateManager < ::Arel::TreeManager + include ::Arel::TreeManager::StatementMethods + + # pkg:gem/activerecord#lib/arel/update_manager.rb:7 + def initialize(table = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/update_manager.rb:32 + def group(columns); end + + # pkg:gem/activerecord#lib/arel/update_manager.rb:43 + def having(expr); end + + # pkg:gem/activerecord#lib/arel/update_manager.rb:18 + def set(values); end + + # UPDATE +table+ + # + # pkg:gem/activerecord#lib/arel/update_manager.rb:13 + def table(table); end +end + +# pkg:gem/activerecord#lib/arel.rb:29 +Arel::VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/activerecord#lib/arel/visitors/visitor.rb:4 +module Arel::Visitors; end + +# pkg:gem/activerecord#lib/arel/visitors/dot.rb:5 +class Arel::Visitors::Dot < ::Arel::Visitors::Visitor + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:19 + def initialize; end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:28 + def accept(object, collector); end + + private + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:260 + def edge(name); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:278 + def quote(string); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:282 + def to_dot; end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:246 + def visit(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:215 + def visit_ActiveModel_Attribute(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:183 + def visit_Arel_Attributes_Attribute(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:193 + def visit_Arel_Nodes_And(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:44 + def visit_Arel_Nodes_Binary(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:211 + def visit_Arel_Nodes_BindParam(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:236 + def visit_Arel_Nodes_Case(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:172 + def visit_Arel_Nodes_Casted(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:232 + def visit_Arel_Nodes_Comment(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:77 + def visit_Arel_Nodes_Count(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:106 + def visit_Arel_Nodes_CurrentRow(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:159 + def visit_Arel_Nodes_DeleteStatement(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:107 + def visit_Arel_Nodes_Distinct(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:109 + def visit_Arel_Nodes_Extract(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:34 + def visit_Arel_Nodes_Function(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:177 + def visit_Arel_Nodes_HomogeneousIn(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:54 + def visit_Arel_Nodes_InfixOperation(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:121 + def visit_Arel_Nodes_InsertStatement(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:114 + def visit_Arel_Nodes_NamedFunction(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:96 + def visit_Arel_Nodes_NamedWindow(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:66 + def visit_Arel_Nodes_NotRegexp(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:68 + def visit_Arel_Nodes_Ordering(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:65 + def visit_Arel_Nodes_Regexp(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:128 + def visit_Arel_Nodes_SelectCore(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:140 + def visit_Arel_Nodes_SelectStatement(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:209 + def visit_Arel_Nodes_SqlLiteral(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:86 + def visit_Arel_Nodes_StringJoin(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:72 + def visit_Arel_Nodes_TableAlias(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:40 + def visit_Arel_Nodes_Unary(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:49 + def visit_Arel_Nodes_UnaryOperation(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:149 + def visit_Arel_Nodes_UpdateStatement(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:82 + def visit_Arel_Nodes_ValuesList(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:90 + def visit_Arel_Nodes_Window(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:194 + def visit_Arel_Nodes_With(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:168 + def visit_Arel_Table(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:225 + def visit_Array(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:206 + def visit_BigDecimal(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:200 + def visit_Date(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:201 + def visit_DateTime(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:204 + def visit_FalseClass(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:207 + def visit_Float(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:219 + def visit_Hash(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:205 + def visit_Integer(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:202 + def visit_NilClass(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:230 + def visit_Set(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:196 + def visit_String(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:208 + def visit_Symbol(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:199 + def visit_Time(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:203 + def visit_TrueClass(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:188 + def visit__children(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:103 + def visit__no_edges(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:60 + def visit__regexp(o); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:242 + def visit_edge(o, method); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:268 + def with_node(node); end +end + +# pkg:gem/activerecord#lib/arel/visitors/dot.rb:16 +class Arel::Visitors::Dot::Edge < ::Struct; end + +# pkg:gem/activerecord#lib/arel/visitors/dot.rb:6 +class Arel::Visitors::Dot::Node + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:9 + def initialize(name, id, fields = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:7 + def fields; end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:7 + def fields=(_arg0); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:7 + def id; end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:7 + def id=(_arg0); end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:7 + def name; end + + # pkg:gem/activerecord#lib/arel/visitors/dot.rb:7 + def name=(_arg0); end +end + +# pkg:gem/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. + # + # pkg:gem/activerecord#lib/arel/visitors/mysql.rb:88 + def build_subselect(key, o); end + + # pkg:gem/activerecord#lib/arel/visitors/mysql.rb:84 + 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. + # + # pkg:gem/activerecord#lib/arel/visitors/mysql.rb:76 + def prepare_update_statement(o); end + + # pkg:gem/activerecord#lib/arel/visitors/mysql.rb:7 + def visit_Arel_Nodes_Bin(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/mysql.rb:34 + def visit_Arel_Nodes_Concat(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/mysql.rb:67 + def visit_Arel_Nodes_Cte(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/mysql.rb:49 + def visit_Arel_Nodes_IsDistinctFrom(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/mysql.rb:43 + def visit_Arel_Nodes_IsNotDistinctFrom(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/mysql.rb:58 + def visit_Arel_Nodes_NotRegexp(o, collector); end + + # no-op + # + # pkg:gem/activerecord#lib/arel/visitors/mysql.rb:63 + def visit_Arel_Nodes_NullsFirst(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/mysql.rb:54 + def visit_Arel_Nodes_Regexp(o, collector); end + + # pkg:gem/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 + # + # pkg:gem/activerecord#lib/arel/visitors/mysql.rb:22 + def visit_Arel_Nodes_SelectStatement(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/mysql.rb:13 + def visit_Arel_Nodes_UnqualifiedColumn(o, collector); end +end + +# pkg:gem/activerecord#lib/arel/visitors/postgresql.rb:5 +class Arel::Visitors::PostgreSQL < ::Arel::Visitors::ToSql + private + + # pkg:gem/activerecord#lib/arel/visitors/postgresql.rb:84 + def bind_block; end + + # Utilized by GroupingSet, Cube & RollUp visitors to + # handle grouping aggregation semantics + # + # pkg:gem/activerecord#lib/arel/visitors/postgresql.rb:99 + def grouping_array_or_grouping_element(o, collector); end + + # Used by Lateral visitor to enclose select queries in parentheses + # + # pkg:gem/activerecord#lib/arel/visitors/postgresql.rb:87 + def grouping_parentheses(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/postgresql.rb:49 + def visit_Arel_Nodes_Cube(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/postgresql.rb:39 + def visit_Arel_Nodes_DistinctOn(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/postgresql.rb:18 + def visit_Arel_Nodes_DoesNotMatch(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/postgresql.rb:44 + def visit_Arel_Nodes_GroupingElement(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/postgresql.rb:59 + def visit_Arel_Nodes_GroupingSet(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/postgresql.rb:75 + def visit_Arel_Nodes_IsDistinctFrom(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/postgresql.rb:69 + def visit_Arel_Nodes_IsNotDistinctFrom(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/postgresql.rb:64 + def visit_Arel_Nodes_Lateral(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/postgresql.rb:7 + def visit_Arel_Nodes_Matches(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/postgresql.rb:34 + def visit_Arel_Nodes_NotRegexp(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/postgresql.rb:29 + def visit_Arel_Nodes_Regexp(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/postgresql.rb:54 + def visit_Arel_Nodes_RollUp(o, collector); end +end + +# pkg:gem/activerecord#lib/arel/visitors/postgresql.rb:81 +Arel::Visitors::PostgreSQL::BIND_BLOCK = T.let(T.unsafe(nil), Proc) + +# pkg:gem/activerecord#lib/arel/visitors/sqlite.rb:5 +class Arel::Visitors::SQLite < ::Arel::Visitors::ToSql + private + + # pkg:gem/activerecord#lib/arel/visitors/sqlite.rb:21 + def visit_Arel_Nodes_False(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/sqlite.rb:31 + def visit_Arel_Nodes_IsDistinctFrom(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/sqlite.rb:25 + def visit_Arel_Nodes_IsNotDistinctFrom(o, collector); end + + # Locks are not supported in SQLite + # + # pkg:gem/activerecord#lib/arel/visitors/sqlite.rb:8 + def visit_Arel_Nodes_Lock(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/sqlite.rb:12 + def visit_Arel_Nodes_SelectStatement(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/sqlite.rb:17 + def visit_Arel_Nodes_True(o, collector); end +end + +# pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:11 +class Arel::Visitors::ToSql < ::Arel::Visitors::Visitor + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:12 + def initialize(connection); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:17 + def compile(node, collector = T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:982 + def aggregate(name, o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:759 + def bind_block; end + + # FIXME: we should probably have a 2-pass visitor for this + # + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:945 + def build_subselect(key, o); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:1009 + def collect_ctes(children, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:176 + def collect_nodes_for(nodes, collector, spacer, connector = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:890 + def collect_optimizer_hints(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:920 + def has_group_by_and_having?(o); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:912 + def has_join_sources?(o); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:916 + def has_limit_or_offset_or_orders?(o); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:959 + def infix_value(o, collector, value); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:965 + def infix_value_with_paren(o, collector, value, suppress_parens = T.unsafe(nil)); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:900 + def inject_join(list, collector, join_str); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:996 + def is_distinct_from(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:894 + def maybe_visit(thing, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:942 + 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. + # + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:927 + def prepare_update_statement(o); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:870 + def quote(value); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:880 + def quote_column_name(name); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:875 + def quote_table_name(name); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:885 + def sanitize_as_sql_comment(value); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:908 + def unboundable?(value); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:831 + def unsupported(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:761 + def visit_ActiveModel_Attribute(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:835 + def visit_ActiveSupport_Multibyte_Chars(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:836 + def visit_ActiveSupport_StringInquirer(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:751 + def visit_Arel_Attributes_Attribute(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:616 + def visit_Arel_Nodes_And(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:698 + def visit_Arel_Nodes_As(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:360 + def visit_Arel_Nodes_Ascending(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:635 + def visit_Arel_Nodes_Assignment(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:417 + def visit_Arel_Nodes_Avg(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:427 + def visit_Arel_Nodes_Between(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:183 + def visit_Arel_Nodes_Bin(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:765 + def visit_Arel_Nodes_BindParam(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:774 + def visit_Arel_Nodes_BoundSqlLiteral(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:704 + def visit_Arel_Nodes_Case(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:84 + def visit_Arel_Nodes_Casted(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:172 + def visit_Arel_Nodes_Comment(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:401 + def visit_Arel_Nodes_Count(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:737 + def visit_Arel_Nodes_Cte(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:293 + def visit_Arel_Nodes_CurrentRow(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:22 + def visit_Arel_Nodes_DeleteStatement(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:364 + def visit_Arel_Nodes_Descending(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:187 + def visit_Arel_Nodes_Distinct(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:191 + def visit_Arel_Nodes_DistinctOn(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:493 + def visit_Arel_Nodes_DoesNotMatch(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:728 + def visit_Arel_Nodes_Else(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:648 + def visit_Arel_Nodes_Equality(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:218 + def visit_Arel_Nodes_Except(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:73 + def visit_Arel_Nodes_Exists(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:396 + def visit_Arel_Nodes_Extract(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:93 + def visit_Arel_Nodes_False(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:248 + def visit_Arel_Nodes_Filter(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:283 + def visit_Arel_Nodes_Following(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:866 + def visit_Arel_Nodes_Fragments(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:528 + def visit_Arel_Nodes_FullOuterJoin(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:445 + def visit_Arel_Nodes_GreaterThan(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:433 + def visit_Arel_Nodes_GreaterThanOrEqual(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:379 + def visit_Arel_Nodes_Group(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:324 + def visit_Arel_Nodes_Grouping(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:333 + def visit_Arel_Nodes_HomogeneousIn(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:584 + def visit_Arel_Nodes_In(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:850 + def visit_Arel_Nodes_InfixOperation(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:549 + def visit_Arel_Nodes_InnerJoin(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:51 + def visit_Arel_Nodes_InsertStatement(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:213 + def visit_Arel_Nodes_Intersect(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:673 + def visit_Arel_Nodes_IsDistinctFrom(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:663 + def visit_Arel_Nodes_IsNotDistinctFrom(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:505 + def visit_Arel_Nodes_JoinSource(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:469 + def visit_Arel_Nodes_LessThan(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:457 + def visit_Arel_Nodes_LessThanOrEqual(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:315 + def visit_Arel_Nodes_Limit(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:320 + def visit_Arel_Nodes_Lock(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:481 + def visit_Arel_Nodes_Matches(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:409 + def visit_Arel_Nodes_Max(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:413 + def visit_Arel_Nodes_Min(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:383 + def visit_Arel_Nodes_NamedFunction(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:223 + def visit_Arel_Nodes_NamedWindow(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:565 + def visit_Arel_Nodes_Not(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:683 + def visit_Arel_Nodes_NotEqual(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:600 + def visit_Arel_Nodes_NotIn(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:520 + def visit_Arel_Nodes_NotRegexp(o, collector); end + + # NullsFirst is available on all but MySQL, where it is redefined. + # + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:369 + def visit_Arel_Nodes_NullsFirst(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:374 + def visit_Arel_Nodes_NullsLast(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:310 + def visit_Arel_Nodes_Offset(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:560 + def visit_Arel_Nodes_On(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:167 + def visit_Arel_Nodes_OptimizerHints(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:620 + def visit_Arel_Nodes_Or(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:535 + def visit_Arel_Nodes_OuterJoin(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:297 + def visit_Arel_Nodes_Over(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:273 + def visit_Arel_Nodes_Preceding(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:87 + def visit_Arel_Nodes_Quoted(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:264 + def visit_Arel_Nodes_Range(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:516 + def visit_Arel_Nodes_Regexp(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:542 + def visit_Arel_Nodes_RightOuterJoin(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:255 + def visit_Arel_Nodes_Rows(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:146 + 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 + # + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:140 + def visit_Arel_Nodes_SelectOptions(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:117 + def visit_Arel_Nodes_SelectStatement(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:769 + def visit_Arel_Nodes_SqlLiteral(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:524 + def visit_Arel_Nodes_StringJoin(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:405 + def visit_Arel_Nodes_Sum(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:421 + def visit_Arel_Nodes_TableAlias(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:89 + def visit_Arel_Nodes_True(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:856 + def visit_Arel_Nodes_UnaryOperation(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:205 + def visit_Arel_Nodes_Union(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:209 + def visit_Arel_Nodes_UnionAll(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:733 + def visit_Arel_Nodes_UnqualifiedColumn(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:39 + def visit_Arel_Nodes_UpdateStatement(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:97 + def visit_Arel_Nodes_ValuesList(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:721 + def visit_Arel_Nodes_When(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:229 + def visit_Arel_Nodes_Window(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:195 + def visit_Arel_Nodes_With(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:200 + def visit_Arel_Nodes_WithRecursive(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:355 + def visit_Arel_SelectManager(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:570 + def visit_Arel_Table(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:861 + def visit_Array(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:837 + def visit_BigDecimal(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:838 + def visit_Class(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:839 + def visit_Date(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:840 + def visit_DateTime(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:841 + def visit_FalseClass(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:842 + def visit_Float(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:843 + def visit_Hash(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:827 + def visit_Integer(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:844 + def visit_NilClass(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:864 + def visit_Set(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:845 + def visit_String(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:846 + def visit_Symbol(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:847 + def visit_Time(o, collector); end + + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:848 + def visit_TrueClass(o, collector); end +end + +# pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:756 +Arel::Visitors::ToSql::BIND_BLOCK = T.let(T.unsafe(nil), Proc) + +# pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:5 +class Arel::Visitors::UnsupportedVisitError < ::StandardError + # pkg:gem/activerecord#lib/arel/visitors/to_sql.rb:6 + def initialize(object); end +end + +# pkg:gem/activerecord#lib/arel/visitors/visitor.rb:5 +class Arel::Visitors::Visitor + # pkg:gem/activerecord#lib/arel/visitors/visitor.rb:6 + def initialize; end + + # pkg:gem/activerecord#lib/arel/visitors/visitor.rb:10 + def accept(object, collector = T.unsafe(nil)); end + + private + + # pkg:gem/activerecord#lib/arel/visitors/visitor.rb:15 + def dispatch; end + + # pkg:gem/activerecord#lib/arel/visitors/visitor.rb:23 + def get_dispatch_cache; end + + # pkg:gem/activerecord#lib/arel/visitors/visitor.rb:27 + def visit(object, collector = T.unsafe(nil)); end + + class << self + # pkg:gem/activerecord#lib/arel/visitors/visitor.rb:17 + def dispatch_cache; end + end +end + +# pkg:gem/activerecord#lib/arel/window_predications.rb:4 +module Arel::WindowPredications + # pkg:gem/activerecord#lib/arel/window_predications.rb:5 + def over(expr = T.unsafe(nil)); end +end diff --git a/sorbet/rbi/gems/activestorage@7.1.3.4.rbi b/sorbet/rbi/gems/activestorage@7.1.3.4.rbi new file mode 100644 index 000000000..cd858d6bc --- /dev/null +++ b/sorbet/rbi/gems/activestorage@7.1.3.4.rbi @@ -0,0 +1,2364 @@ +# 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::Access + include ::ActiveModel::ForbiddenAttributesProtection + include ::ActiveModel::AttributeAssignment + include ::ActiveModel::Serialization + extend ::ActiveRecord::Import::Connection + + class << self + # pkg:gem/activestorage#lib/active_storage/reflection.rb:53 + def attachment_reflections; end + + # pkg:gem/activestorage#lib/active_storage/reflection.rb:53 + def attachment_reflections=(value); end + + # pkg:gem/activestorage#lib/active_storage/reflection.rb:53 + def attachment_reflections?; end + end +end + +# :markup: markdown +# :include: activestorage/README.md +# +# pkg:gem/activestorage#lib/active_storage/gem_version.rb:3 +module ActiveStorage + extend ::ActiveSupport::Autoload + + # pkg:gem/activestorage#lib/active_storage.rb:55 + def analyzers; end + + # pkg:gem/activestorage#lib/active_storage.rb:55 + def analyzers=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:61 + def binary_content_type; end + + # pkg:gem/activestorage#lib/active_storage.rb:61 + def binary_content_type=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:63 + def content_types_allowed_inline; end + + # pkg:gem/activestorage#lib/active_storage.rb:63 + def content_types_allowed_inline=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:62 + def content_types_to_serve_as_binary; end + + # pkg:gem/activestorage#lib/active_storage.rb:62 + def content_types_to_serve_as_binary=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:360 + def draw_routes; end + + # pkg:gem/activestorage#lib/active_storage.rb:360 + def draw_routes=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:48 + def logger; end + + # pkg:gem/activestorage#lib/active_storage.rb:48 + def logger=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:57 + def paths; end + + # pkg:gem/activestorage#lib/active_storage.rb:57 + def paths=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:54 + def previewers; end + + # pkg:gem/activestorage#lib/active_storage.rb:54 + def previewers=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:52 + def queues; end + + # pkg:gem/activestorage#lib/active_storage.rb:52 + def queues=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:361 + def resolve_model_to_route; end + + # pkg:gem/activestorage#lib/active_storage.rb:361 + def resolve_model_to_route=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:359 + def routes_prefix; end + + # pkg:gem/activestorage#lib/active_storage.rb:359 + def routes_prefix=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:356 + def service_urls_expire_in; end + + # pkg:gem/activestorage#lib/active_storage.rb:356 + def service_urls_expire_in=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:65 + def supported_image_processing_methods; end + + # pkg:gem/activestorage#lib/active_storage.rb:65 + def supported_image_processing_methods=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:363 + def track_variants; end + + # pkg:gem/activestorage#lib/active_storage.rb:363 + def track_variants=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:354 + def unsupported_image_processing_arguments; end + + # pkg:gem/activestorage#lib/active_storage.rb:354 + def unsupported_image_processing_arguments=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:357 + def urls_expire_in; end + + # pkg:gem/activestorage#lib/active_storage.rb:357 + def urls_expire_in=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:59 + def variable_content_types; end + + # pkg:gem/activestorage#lib/active_storage.rb:59 + def variable_content_types=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:50 + def variant_processor; end + + # pkg:gem/activestorage#lib/active_storage.rb:50 + def variant_processor=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:49 + def verifier; end + + # pkg:gem/activestorage#lib/active_storage.rb:49 + def verifier=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:365 + def video_preview_arguments; end + + # pkg:gem/activestorage#lib/active_storage.rb:365 + def video_preview_arguments=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:60 + def web_image_content_types; end + + # pkg:gem/activestorage#lib/active_storage.rb:60 + def web_image_content_types=(val); end + + class << self + # pkg:gem/activestorage#lib/active_storage.rb:55 + def analyzers; end + + # pkg:gem/activestorage#lib/active_storage.rb:55 + def analyzers=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:61 + def binary_content_type; end + + # pkg:gem/activestorage#lib/active_storage.rb:61 + def binary_content_type=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:63 + def content_types_allowed_inline; end + + # pkg:gem/activestorage#lib/active_storage.rb:63 + def content_types_allowed_inline=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:62 + def content_types_to_serve_as_binary; end + + # pkg:gem/activestorage#lib/active_storage.rb:62 + def content_types_to_serve_as_binary=(val); end + + # pkg:gem/activestorage#lib/active_storage/deprecator.rb:4 + def deprecator; end + + # pkg:gem/activestorage#lib/active_storage.rb:360 + def draw_routes; end + + # pkg:gem/activestorage#lib/active_storage.rb:360 + def draw_routes=(val); end + + # Returns the currently loaded version of Active Storage as a +Gem::Version+. + # + # pkg:gem/activestorage#lib/active_storage/gem_version.rb:5 + def gem_version; end + + # pkg:gem/activestorage#lib/active_storage.rb:48 + def logger; end + + # pkg:gem/activestorage#lib/active_storage.rb:48 + def logger=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:57 + def paths; end + + # pkg:gem/activestorage#lib/active_storage.rb:57 + def paths=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:54 + def previewers; end + + # pkg:gem/activestorage#lib/active_storage.rb:54 + def previewers=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:52 + def queues; end + + # pkg:gem/activestorage#lib/active_storage.rb:52 + def queues=(val); end + + # pkg:gem/activestorage#lib/active_storage/engine.rb:26 + def railtie_helpers_paths; end + + # pkg:gem/activestorage#lib/active_storage/engine.rb:26 + def railtie_namespace; end + + # pkg:gem/activestorage#lib/active_storage/engine.rb:26 + def railtie_routes_url_helpers(include_path_helpers = T.unsafe(nil)); end + + # pkg:gem/activestorage#lib/active_storage.rb:367 + def replace_on_assign_to_many; end + + # pkg:gem/activestorage#lib/active_storage.rb:371 + def replace_on_assign_to_many=(value); end + + # pkg:gem/activestorage#lib/active_storage.rb:361 + def resolve_model_to_route; end + + # pkg:gem/activestorage#lib/active_storage.rb:361 + def resolve_model_to_route=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:359 + def routes_prefix; end + + # pkg:gem/activestorage#lib/active_storage.rb:359 + def routes_prefix=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:356 + def service_urls_expire_in; end + + # pkg:gem/activestorage#lib/active_storage.rb:356 + def service_urls_expire_in=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:375 + def silence_invalid_content_types_warning; end + + # pkg:gem/activestorage#lib/active_storage.rb:379 + def silence_invalid_content_types_warning=(value); end + + # pkg:gem/activestorage#lib/active_storage.rb:65 + def supported_image_processing_methods; end + + # pkg:gem/activestorage#lib/active_storage.rb:65 + def supported_image_processing_methods=(val); end + + # pkg:gem/activestorage#lib/active_storage/engine.rb:26 + def table_name_prefix; end + + # pkg:gem/activestorage#lib/active_storage.rb:363 + def track_variants; end + + # pkg:gem/activestorage#lib/active_storage.rb:363 + def track_variants=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:354 + def unsupported_image_processing_arguments; end + + # pkg:gem/activestorage#lib/active_storage.rb:354 + def unsupported_image_processing_arguments=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:357 + def urls_expire_in; end + + # pkg:gem/activestorage#lib/active_storage.rb:357 + def urls_expire_in=(val); end + + # pkg:gem/activestorage#lib/active_storage/engine.rb:26 + def use_relative_model_naming?; end + + # pkg:gem/activestorage#lib/active_storage.rb:59 + def variable_content_types; end + + # pkg:gem/activestorage#lib/active_storage.rb:59 + def variable_content_types=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:50 + def variant_processor; end + + # pkg:gem/activestorage#lib/active_storage.rb:50 + def variant_processor=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:49 + def verifier; end + + # pkg:gem/activestorage#lib/active_storage.rb:49 + def verifier=(val); end + + # Returns the currently loaded version of Active Storage as a +Gem::Version+. + # + # pkg:gem/activestorage#lib/active_storage/version.rb:7 + def version; end + + # pkg:gem/activestorage#lib/active_storage.rb:365 + def video_preview_arguments; end + + # pkg:gem/activestorage#lib/active_storage.rb:365 + def video_preview_arguments=(val); end + + # pkg:gem/activestorage#lib/active_storage.rb:60 + def web_image_content_types; end + + # pkg:gem/activestorage#lib/active_storage.rb:60 + def web_image_content_types=(val); end + end +end + +class ActiveStorage::AnalyzeJob < ::ActiveStorage::BaseJob + def perform(blob); end + + class << self + def queue_name; end + def rescue_handlers; 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. +# +# pkg:gem/activestorage#lib/active_storage/analyzer.rb:8 +class ActiveStorage::Analyzer + # pkg:gem/activestorage#lib/active_storage/analyzer.rb:23 + def initialize(blob); end + + # pkg:gem/activestorage#lib/active_storage/analyzer.rb:9 + def blob; end + + # Override this method in a concrete subclass. Have it return a Hash of metadata. + # + # pkg:gem/activestorage#lib/active_storage/analyzer.rb:28 + def metadata; end + + private + + # Downloads the blob to a tempfile on disk. Yields the tempfile. + # + # pkg:gem/activestorage#lib/active_storage/analyzer.rb:34 + def download_blob_to_tempfile(&block); end + + # pkg:gem/activestorage#lib/active_storage/analyzer.rb:46 + def instrument(analyzer, &block); end + + # pkg:gem/activestorage#lib/active_storage/analyzer.rb:38 + def logger; end + + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activestorage#lib/active_storage/analyzer.rb:19 + def analyze_later?; end + end +end + +# = Active Storage Audio \Analyzer +# +# Extracts duration (seconds), bit_rate (bits/s), sample_rate (hertz) and tags (internal metadata) from an audio blob. +# +# Example: +# +# ActiveStorage::Analyzer::AudioAnalyzer.new(blob).metadata +# # => { duration: 5.0, bit_rate: 320340, sample_rate: 44100, tags: { encoder: "Lavc57.64", ... } } +# +# This analyzer requires the {FFmpeg}[https://www.ffmpeg.org] system library, which is not provided by \Rails. +# +# pkg:gem/activestorage#lib/active_storage/analyzer/audio_analyzer.rb:14 +class ActiveStorage::Analyzer::AudioAnalyzer < ::ActiveStorage::Analyzer + # pkg:gem/activestorage#lib/active_storage/analyzer/audio_analyzer.rb:19 + def metadata; end + + private + + # pkg:gem/activestorage#lib/active_storage/analyzer/audio_analyzer.rb:44 + def audio_stream; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/audio_analyzer.rb:29 + def bit_rate; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/audio_analyzer.rb:24 + def duration; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/audio_analyzer.rb:73 + def ffprobe_path; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/audio_analyzer.rb:52 + def probe; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/audio_analyzer.rb:56 + def probe_from(file); end + + # pkg:gem/activestorage#lib/active_storage/analyzer/audio_analyzer.rb:34 + def sample_rate; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/audio_analyzer.rb:48 + def streams; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/audio_analyzer.rb:39 + def tags; end + + class << self + # pkg:gem/activestorage#lib/active_storage/analyzer/audio_analyzer.rb:15 + def accept?(blob); end + end +end + +# = Active Storage Image \Analyzer +# +# This is an abstract base class for image analyzers, which extract width and height from an image blob. +# +# If the image contains EXIF data indicating its angle is 90 or 270 degrees, its width and height are swapped for convenience. +# +# Example: +# +# ActiveStorage::Analyzer::ImageAnalyzer::ImageMagick.new(blob).metadata +# # => { width: 4104, height: 2736 } +# +# pkg:gem/activestorage#lib/active_storage/analyzer/image_analyzer.rb:14 +class ActiveStorage::Analyzer::ImageAnalyzer < ::ActiveStorage::Analyzer + # pkg:gem/activestorage#lib/active_storage/analyzer/image_analyzer.rb:19 + def metadata; end + + class << self + # pkg:gem/activestorage#lib/active_storage/analyzer/image_analyzer.rb:15 + def accept?(blob); end + end +end + +# This analyzer relies on the third-party {MiniMagick}[https://github.com/minimagick/minimagick] gem. MiniMagick requires +# the {ImageMagick}[http://www.imagemagick.org] system library. +# +# pkg:gem/activestorage#lib/active_storage/analyzer/image_analyzer/image_magick.rb:6 +class ActiveStorage::Analyzer::ImageAnalyzer::ImageMagick < ::ActiveStorage::Analyzer::ImageAnalyzer + private + + # pkg:gem/activestorage#lib/active_storage/analyzer/image_analyzer/image_magick.rb:12 + def read_image; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/image_analyzer/image_magick.rb:37 + def rotated_image?(image); end + + class << self + # pkg:gem/activestorage#lib/active_storage/analyzer/image_analyzer/image_magick.rb:7 + def accept?(blob); end + end +end + +# This analyzer relies on the third-party {ruby-vips}[https://github.com/libvips/ruby-vips] gem. Ruby-vips requires +# the {libvips}[https://libvips.github.io/libvips/] system library. +# +# pkg:gem/activestorage#lib/active_storage/analyzer/image_analyzer/vips.rb:6 +class ActiveStorage::Analyzer::ImageAnalyzer::Vips < ::ActiveStorage::Analyzer::ImageAnalyzer + private + + # pkg:gem/activestorage#lib/active_storage/analyzer/image_analyzer/vips.rb:12 + def read_image; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/image_analyzer/vips.rb:38 + def rotated_image?(image); end + + # pkg:gem/activestorage#lib/active_storage/analyzer/image_analyzer/vips.rb:44 + def valid_image?(image); end + + class << self + # pkg:gem/activestorage#lib/active_storage/analyzer/image_analyzer/vips.rb:7 + def accept?(blob); end + end +end + +# pkg:gem/activestorage#lib/active_storage/analyzer/image_analyzer/vips.rb:37 +ActiveStorage::Analyzer::ImageAnalyzer::Vips::ROTATIONS = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activestorage#lib/active_storage/analyzer/null_analyzer.rb:4 +class ActiveStorage::Analyzer::NullAnalyzer < ::ActiveStorage::Analyzer + # pkg:gem/activestorage#lib/active_storage/analyzer/null_analyzer.rb:13 + def metadata; end + + class << self + # pkg:gem/activestorage#lib/active_storage/analyzer/null_analyzer.rb:5 + def accept?(blob); end + + # pkg:gem/activestorage#lib/active_storage/analyzer/null_analyzer.rb:9 + def analyze_later?; end + end +end + +# = Active Storage Video \Analyzer +# +# Extracts the following from a video blob: +# +# * Width (pixels) +# * Height (pixels) +# * Duration (seconds) +# * Angle (degrees) +# * Display aspect ratio +# * Audio (true if file has an audio channel, false if not) +# * Video (true if file has an video channel, false if not) +# +# Example: +# +# ActiveStorage::Analyzer::VideoAnalyzer.new(blob).metadata +# # => { width: 640.0, height: 480.0, duration: 5.0, angle: 0, display_aspect_ratio: [4, 3], audio: true, video: true } +# +# When a video's angle is 90, -90, 270 or -270 degrees, its width and height are automatically swapped for convenience. +# +# This analyzer requires the {FFmpeg}[https://www.ffmpeg.org] system library, which is not provided by \Rails. +# +# pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:24 +class ActiveStorage::Analyzer::VideoAnalyzer < ::ActiveStorage::Analyzer + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:29 + def metadata; end + + private + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:55 + def angle; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:78 + def audio?; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:116 + def audio_stream; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:86 + def computed_height; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:124 + def container; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:63 + def display_aspect_ratio; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:100 + def display_height_scale; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:50 + def duration; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:96 + def encoded_height; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:92 + def encoded_width; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:149 + def ffprobe_path; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:42 + def height; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:128 + def probe; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:132 + def probe_from(file); end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:74 + def rotated?; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:108 + def side_data; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:120 + def streams; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:104 + def tags; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:82 + def video?; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:112 + def video_stream; end + + # pkg:gem/activestorage#lib/active_storage/analyzer/video_analyzer.rb:34 + def width; end + + class << self + # pkg:gem/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. +# +# pkg:gem/activestorage#lib/active_storage/attached.rb:10 +class ActiveStorage::Attached + # pkg:gem/activestorage#lib/active_storage/attached.rb:13 + def initialize(name, record); end + + # pkg:gem/activestorage#lib/active_storage/attached.rb:11 + def name; end + + # pkg:gem/activestorage#lib/active_storage/attached.rb:11 + def record; end + + private + + # pkg:gem/activestorage#lib/active_storage/attached.rb:18 + def change; end +end + +# pkg:gem/activestorage#lib/active_storage/attached/changes.rb:4 +module ActiveStorage::Attached::Changes + extend ::ActiveSupport::Autoload +end + +# pkg:gem/activestorage#lib/active_storage/attached/changes/create_many.rb:4 +class ActiveStorage::Attached::Changes::CreateMany + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_many.rb:7 + def initialize(name, record, attachables, pending_uploads: T.unsafe(nil)); end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_many.rb:5 + def attachables; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_many.rb:14 + def attachments; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_many.rb:18 + def blobs; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_many.rb:5 + def name; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_many.rb:5 + def pending_uploads; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_many.rb:5 + def record; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_many.rb:26 + def save; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_many.rb:22 + def upload; end + + private + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_many.rb:44 + def assign_associated_attachments; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_many.rb:36 + def build_subchange_from(attachable); end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_many.rb:52 + def persisted_or_new_attachments; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_many.rb:48 + def reset_associated_blobs; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_many.rb:32 + def subchanges; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_many.rb:40 + def subchanges_without_blobs; end +end + +# pkg:gem/activestorage#lib/active_storage/attached/changes/create_one.rb:7 +class ActiveStorage::Attached::Changes::CreateOne + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_one.rb:10 + def initialize(name, record, attachable); end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_one.rb:8 + def attachable; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_one.rb:15 + def attachment; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_one.rb:19 + def blob; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_one.rb:8 + def name; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_one.rb:8 + def record; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_one.rb:48 + def save; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_one.rb:23 + def upload; end + + private + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_one.rb:120 + def attachment_service_name; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_one.rb:64 + def build_attachment; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_one.rb:58 + def find_attachment; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_one.rb:54 + def find_or_build_attachment; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_one.rb:68 + def find_or_build_blob; end +end + +# pkg:gem/activestorage#lib/active_storage/attached/changes/create_one_of_many.rb:4 +class ActiveStorage::Attached::Changes::CreateOneOfMany < ::ActiveStorage::Attached::Changes::CreateOne + private + + # pkg:gem/activestorage#lib/active_storage/attached/changes/create_one_of_many.rb:6 + def find_attachment; end +end + +# pkg:gem/activestorage#lib/active_storage/attached/changes/delete_many.rb:4 +class ActiveStorage::Attached::Changes::DeleteMany + # pkg:gem/activestorage#lib/active_storage/attached/changes/delete_many.rb:7 + def initialize(name, record); end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/delete_many.rb:11 + def attachables; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/delete_many.rb:15 + def attachments; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/delete_many.rb:19 + def blobs; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/delete_many.rb:5 + def name; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/delete_many.rb:5 + def record; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/delete_many.rb:23 + def save; end +end + +# pkg:gem/activestorage#lib/active_storage/attached/changes/delete_one.rb:4 +class ActiveStorage::Attached::Changes::DeleteOne + # pkg:gem/activestorage#lib/active_storage/attached/changes/delete_one.rb:7 + def initialize(name, record); end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/delete_one.rb:11 + def attachment; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/delete_one.rb:5 + def name; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/delete_one.rb:5 + def record; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/delete_one.rb:15 + def save; end +end + +# pkg:gem/activestorage#lib/active_storage/attached/changes/detach_many.rb:4 +class ActiveStorage::Attached::Changes::DetachMany + # pkg:gem/activestorage#lib/active_storage/attached/changes/detach_many.rb:7 + def initialize(name, record, attachments); end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/detach_many.rb:5 + def attachments; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/detach_many.rb:11 + def detach; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/detach_many.rb:5 + def name; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/detach_many.rb:5 + def record; end +end + +# pkg:gem/activestorage#lib/active_storage/attached/changes/detach_one.rb:4 +class ActiveStorage::Attached::Changes::DetachOne + # pkg:gem/activestorage#lib/active_storage/attached/changes/detach_one.rb:7 + def initialize(name, record, attachment); end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/detach_one.rb:5 + def attachment; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/detach_one.rb:11 + def detach; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/detach_one.rb:5 + def name; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/detach_one.rb:5 + def record; end + + private + + # pkg:gem/activestorage#lib/active_storage/attached/changes/detach_one.rb:19 + def reset; end +end + +# pkg:gem/activestorage#lib/active_storage/attached/changes/purge_many.rb:4 +class ActiveStorage::Attached::Changes::PurgeMany + # pkg:gem/activestorage#lib/active_storage/attached/changes/purge_many.rb:7 + def initialize(name, record, attachments); end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/purge_many.rb:5 + def attachments; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/purge_many.rb:5 + def name; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/purge_many.rb:11 + def purge; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/purge_many.rb:16 + def purge_later; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/purge_many.rb:5 + def record; end + + private + + # pkg:gem/activestorage#lib/active_storage/attached/changes/purge_many.rb:22 + def reset; end +end + +# pkg:gem/activestorage#lib/active_storage/attached/changes/purge_one.rb:4 +class ActiveStorage::Attached::Changes::PurgeOne + # pkg:gem/activestorage#lib/active_storage/attached/changes/purge_one.rb:7 + def initialize(name, record, attachment); end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/purge_one.rb:5 + def attachment; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/purge_one.rb:5 + def name; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/purge_one.rb:11 + def purge; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/purge_one.rb:16 + def purge_later; end + + # pkg:gem/activestorage#lib/active_storage/attached/changes/purge_one.rb:5 + def record; end + + private + + # pkg:gem/activestorage#lib/active_storage/attached/changes/purge_one.rb:22 + def reset; end +end + +# = Active Storage \Attached \Many +# +# Decorated proxy object representing of multiple attachments to a model. +# +# pkg:gem/activestorage#lib/active_storage/attached/many.rb:7 +class ActiveStorage::Attached::Many < ::ActiveStorage::Attached + # Attaches one or more +attachables+ to the record. + # + # If the record is persisted and unchanged, the attachments are saved to + # the database immediately. Otherwise, they'll be saved to the DB when the + # record is next saved. + # + # document.images.attach(params[:images]) # Array of ActionDispatch::Http::UploadedFile objects + # document.images.attach(params[:signed_blob_id]) # Signed reference to blob from direct upload + # document.images.attach(io: File.open("/path/to/racecar.jpg"), filename: "racecar.jpg", content_type: "image/jpeg") + # document.images.attach([ first_blob, second_blob ]) + # + # pkg:gem/activestorage#lib/active_storage/attached/many.rb:51 + def attach(*attachables); end + + # Returns true if any attachments have been made. + # + # class Gallery < ApplicationRecord + # has_many_attached :photos + # end + # + # Gallery.new.photos.attached? # => false + # + # pkg:gem/activestorage#lib/active_storage/attached/many.rb:66 + def attached?; end + + # Returns all the associated attachment records. + # + # All methods called on this proxy object that aren't listed here will automatically be delegated to +attachments+. + # + # pkg:gem/activestorage#lib/active_storage/attached/many.rb:32 + def attachments; end + + # Returns all attached blobs. + # + # pkg:gem/activestorage#lib/active_storage/attached/many.rb:37 + def blobs; end + + # pkg:gem/activestorage#lib/active_storage/attached/many.rb:25 + def detach(*, **, &); end + + # pkg:gem/activestorage#lib/active_storage/attached/many.rb:27 + def method_missing(method, *args, **, &block); end + + # pkg:gem/activestorage#lib/active_storage/attached/many.rb:13 + def purge(*, **, &); end + + # pkg:gem/activestorage#lib/active_storage/attached/many.rb:19 + def purge_later(*, **, &); end + + private + + # pkg:gem/activestorage#lib/active_storage/attached/many.rb:75 + def detach_many; end + + # pkg:gem/activestorage#lib/active_storage/attached/many.rb:71 + def purge_many; end + + # pkg:gem/activestorage#lib/active_storage/attached/many.rb:27 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end +end + +# = Active Storage \Attached \Model +# +# Provides the class-level DSL for declaring an Active Record model's attachments. +# +# pkg:gem/activestorage#lib/active_storage/attached/model.rb:9 +module ActiveStorage::Attached::Model + extend ::ActiveSupport::Concern + + mixes_in_class_methods ::ActiveStorage::Attached::Model::ClassMethods + + # pkg:gem/activestorage#lib/active_storage/attached/model.rb:251 + def attachment_changes; end + + # pkg:gem/activestorage#lib/active_storage/attached/model.rb:255 + def changed_for_autosave?; end + + # pkg:gem/activestorage#lib/active_storage/attached/model.rb:265 + def reload(*); end + + private + + # pkg:gem/activestorage#lib/active_storage/attached/model.rb:259 + def initialize_dup(*); end +end + +# pkg:gem/activestorage#lib/active_storage/attached/model.rb:54 +module ActiveStorage::Attached::Model::ClassMethods + # pkg:gem/activestorage#lib/active_storage/attached/model.rb:182 + def has_many_attached(name, dependent: T.unsafe(nil), service: T.unsafe(nil), strict_loading: T.unsafe(nil)); end + + # pkg:gem/activestorage#lib/active_storage/attached/model.rb:94 + def has_one_attached(name, dependent: T.unsafe(nil), service: T.unsafe(nil), strict_loading: T.unsafe(nil)); end + + private + + # pkg:gem/activestorage#lib/active_storage/attached/model.rb:244 + def validate_global_service_configuration; end + + # pkg:gem/activestorage#lib/active_storage/attached/model.rb:234 + def validate_service_configuration(association_name, service); end +end + +# = Active Storage \Attached \One +# +# Representation of a single attachment to a model. +# +# pkg:gem/activestorage#lib/active_storage/attached/one.rb:7 +class ActiveStorage::Attached::One < ::ActiveStorage::Attached + # Attaches an +attachable+ to the record. + # + # If the record is persisted and unchanged, the attachment is saved to + # the database immediately. Otherwise, it'll be saved to the DB when the + # record is next saved. + # + # person.avatar.attach(params[:avatar]) # ActionDispatch::Http::UploadedFile object + # person.avatar.attach(params[:signed_blob_id]) # Signed reference to blob from direct upload + # person.avatar.attach(io: File.open("/path/to/face.jpg"), filename: "face.jpg", content_type: "image/jpeg") + # person.avatar.attach(avatar_blob) # ActiveStorage::Blob object + # + # pkg:gem/activestorage#lib/active_storage/attached/one.rb:58 + def attach(attachable); end + + # Returns +true+ if an attachment has been made. + # + # class User < ApplicationRecord + # has_one_attached :avatar + # end + # + # User.new.avatar.attached? # => false + # + # pkg:gem/activestorage#lib/active_storage/attached/one.rb:73 + def attached?; end + + # Returns the associated attachment record. + # + # You don't have to call this method to access the attachment's methods as + # they are all available at the model level. + # + # pkg:gem/activestorage#lib/active_storage/attached/one.rb:33 + def attachment; end + + # Returns +true+ if an attachment is not attached. + # + # class User < ApplicationRecord + # has_one_attached :avatar + # end + # + # User.new.avatar.blank? # => true + # + # pkg:gem/activestorage#lib/active_storage/attached/one.rb:44 + def blank?; end + + # pkg:gem/activestorage#lib/active_storage/attached/one.rb:25 + def detach(*, **, &); end + + # pkg:gem/activestorage#lib/active_storage/attached/one.rb:27 + def method_missing(method, *args, **, &block); end + + # pkg:gem/activestorage#lib/active_storage/attached/one.rb:13 + def purge(*, **, &); end + + # pkg:gem/activestorage#lib/active_storage/attached/one.rb:19 + def purge_later(*, **, &); end + + private + + # pkg:gem/activestorage#lib/active_storage/attached/one.rb:82 + def detach_one; end + + # pkg:gem/activestorage#lib/active_storage/attached/one.rb:78 + def purge_one; end + + # pkg:gem/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 autosave_associated_records_for_blob(*args); end + def autosave_associated_records_for_record(*args); end + def method_missing(method, *args, **, &block); end + def preview(transformations); end + def purge; end + def purge_later; end + def representation(transformations); end + def signed_id(*, **, &); 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 +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); end + + class << self + def __callbacks; end + def etag_with_template_digest; end + def middleware_stack; 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 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_attachment_records; end + def update_service_metadata; end + def web_image?; end + + class << self + # pkg:gem/activestorage#lib/active_storage/reflection.rb:53 + def attachment_reflections; end + + 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:, 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 + 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 preprocessed(transformations); end + def preview(transformations); 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); end + + class << self + def __callbacks; end + def middleware_stack; end + end +end + +class ActiveStorage::Blobs::RedirectController < ::ActiveStorage::BaseController + include ::ActiveStorage::SetBlob + + def show; end + + private + + def _layout(lookup_context, formats); end + + class << self + def __callbacks; end + def middleware_stack; end + end +end + +class ActiveStorage::Current < ::ActiveSupport::CurrentAttributes + class << self + def url_options; end + def url_options=(value); end + end +end + +class ActiveStorage::DirectUploadsController < ::ActiveStorage::BaseController + def create; end + + private + + def _layout(lookup_context, formats); end + def blob_args; end + def direct_upload_json(blob); end + + class << self + def middleware_stack; 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); end + def acceptable_content?(token); end + def decode_verified_key; end + def decode_verified_token; end + def named_disk_service(name); end + + class << self + def __callbacks; end + def middleware_stack; end + end +end + +# pkg:gem/activestorage#lib/active_storage/downloader.rb:4 +class ActiveStorage::Downloader + # pkg:gem/activestorage#lib/active_storage/downloader.rb:7 + def initialize(service); end + + # pkg:gem/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 + + # pkg:gem/activestorage#lib/active_storage/downloader.rb:5 + def service; end + + private + + # pkg:gem/activestorage#lib/active_storage/downloader.rb:30 + def download(key, file); end + + # pkg:gem/activestorage#lib/active_storage/downloader.rb:20 + def open_tempfile(name, tmpdir = T.unsafe(nil)); end + + # pkg:gem/activestorage#lib/active_storage/downloader.rb:37 + def verify_integrity_of(file, checksum:); end +end + +# pkg:gem/activestorage#lib/active_storage/engine.rb:25 +class ActiveStorage::Engine < ::Rails::Engine; end + +# Generic base class for all Active Storage exceptions. +# +# pkg:gem/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. +# +# pkg:gem/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(*); end + def base; end + def extension; end + def extension_with_delimiter; end + def extension_without_delimiter; end + def sanitized; end + def to_json; end + def to_s; 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. +# +# pkg:gem/activestorage#lib/active_storage/fixture_set.rb:44 +class ActiveStorage::FixtureSet + include ::ActiveSupport::Testing::FileFixtures + include ::ActiveRecord::SecureToken + extend ::ActiveRecord::SecureToken::ClassMethods + + # pkg:gem/activestorage#lib/active_storage/fixture_set.rb:45 + def file_fixture_path; end + + # pkg:gem/activestorage#lib/active_storage/fixture_set.rb:45 + def file_fixture_path?; end + + # pkg:gem/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" + # ) %> + # + # pkg:gem/activestorage#lib/active_storage/fixture_set.rb:66 + def blob(filename:, **attributes); end + + # pkg:gem/activestorage#lib/active_storage/fixture_set.rb:45 + def file_fixture_path; end + + # pkg:gem/activestorage#lib/active_storage/fixture_set.rb:45 + def file_fixture_path=(value); end + + # pkg:gem/activestorage#lib/active_storage/fixture_set.rb:45 + def file_fixture_path?; 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. +# +# pkg:gem/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. +# +# pkg:gem/activestorage#lib/active_storage/errors.rb:9 +class ActiveStorage::InvariableError < ::ActiveStorage::Error; end + +# pkg:gem/activestorage#lib/active_storage/log_subscriber.rb:6 +class ActiveStorage::LogSubscriber < ::ActiveSupport::LogSubscriber + # pkg:gem/activestorage#lib/active_storage/log_subscriber.rb:53 + def logger; end + + # pkg:gem/activestorage#lib/active_storage/log_subscriber.rb:21 + def preview(event); end + + # pkg:gem/activestorage#lib/active_storage/log_subscriber.rb:26 + def service_delete(event); end + + # pkg:gem/activestorage#lib/active_storage/log_subscriber.rb:31 + def service_delete_prefixed(event); end + + # pkg:gem/activestorage#lib/active_storage/log_subscriber.rb:14 + def service_download(event); end + + # pkg:gem/activestorage#lib/active_storage/log_subscriber.rb:36 + def service_exist(event); end + + # pkg:gem/activestorage#lib/active_storage/log_subscriber.rb:46 + def service_mirror(event); end + + # pkg:gem/activestorage#lib/active_storage/log_subscriber.rb:14 + def service_streaming_download(event); end + + # pkg:gem/activestorage#lib/active_storage/log_subscriber.rb:7 + def service_upload(event); end + + # pkg:gem/activestorage#lib/active_storage/log_subscriber.rb:41 + def service_url(event); end + + private + + # pkg:gem/activestorage#lib/active_storage/log_subscriber.rb:62 + def debug(event, colored_message); end + + # pkg:gem/activestorage#lib/active_storage/log_subscriber.rb:58 + def info(event, colored_message); end + + # pkg:gem/activestorage#lib/active_storage/log_subscriber.rb:70 + def key_in(event); end + + # pkg:gem/activestorage#lib/active_storage/log_subscriber.rb:66 + def log_prefix_for_service(event); end + + class << self + # pkg:gem/activestorage#lib/active_storage/log_subscriber.rb:12 + def log_levels; end + end +end + +class ActiveStorage::MirrorJob < ::ActiveStorage::BaseJob + def perform(key, checksum:); end + + class << self + def queue_name; end + def rescue_handlers; 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(*, **, &); end + def download(&block); end + def filename(*, **, &); end + def image; end + def key; end + def processed; end + def url(**options); end + def variation; end + + private + + def previewer; end + def previewer_class; end + def process; end + def processed?; end + def variant; end +end + +class ActiveStorage::Preview::UnprocessedError < ::StandardError; end + +# Raised when a Previewer is unable to generate a preview image. +# +# pkg:gem/activestorage#lib/active_storage/errors.rb:28 +class ActiveStorage::PreviewError < ::ActiveStorage::Error; 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. +# +# pkg:gem/activestorage#lib/active_storage/previewer.rb:9 +class ActiveStorage::Previewer + # pkg:gem/activestorage#lib/active_storage/previewer.rb:18 + def initialize(blob); end + + # pkg:gem/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. + # + # pkg:gem/activestorage#lib/active_storage/previewer.rb:25 + def preview(**options); end + + private + + # pkg:gem/activestorage#lib/active_storage/previewer.rb:78 + def capture(*argv, to:); end + + # Downloads the blob to a tempfile on disk. Yields the tempfile. + # + # pkg:gem/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. + # + # pkg:gem/activestorage#lib/active_storage/previewer.rb:49 + def draw(*argv); end + + # pkg:gem/activestorage#lib/active_storage/previewer.rb:69 + def instrument(operation, payload = T.unsafe(nil), &block); end + + # pkg:gem/activestorage#lib/active_storage/previewer.rb:93 + def logger; end + + # pkg:gem/activestorage#lib/active_storage/previewer.rb:59 + def open_tempfile; end + + # pkg:gem/activestorage#lib/active_storage/previewer.rb:73 + def service_name; end + + # pkg:gem/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. + # + # pkg:gem/activestorage#lib/active_storage/previewer.rb:14 + def accept?(blob); end + end +end + +# pkg:gem/activestorage#lib/active_storage/previewer/mupdf_previewer.rb:4 +class ActiveStorage::Previewer::MuPDFPreviewer < ::ActiveStorage::Previewer + # pkg:gem/activestorage#lib/active_storage/previewer/mupdf_previewer.rb:23 + def preview(**options); end + + private + + # pkg:gem/activestorage#lib/active_storage/previewer/mupdf_previewer.rb:32 + def draw_first_page_from(file, &block); end + + class << self + # pkg:gem/activestorage#lib/active_storage/previewer/mupdf_previewer.rb:6 + def accept?(blob); end + + # pkg:gem/activestorage#lib/active_storage/previewer/mupdf_previewer.rb:14 + def mutool_exists?; end + + # pkg:gem/activestorage#lib/active_storage/previewer/mupdf_previewer.rb:10 + def mutool_path; end + end +end + +# pkg:gem/activestorage#lib/active_storage/previewer/poppler_pdf_previewer.rb:4 +class ActiveStorage::Previewer::PopplerPDFPreviewer < ::ActiveStorage::Previewer + # pkg:gem/activestorage#lib/active_storage/previewer/poppler_pdf_previewer.rb:21 + def preview(**options); end + + private + + # pkg:gem/activestorage#lib/active_storage/previewer/poppler_pdf_previewer.rb:30 + def draw_first_page_from(file, &block); end + + class << self + # pkg:gem/activestorage#lib/active_storage/previewer/poppler_pdf_previewer.rb:6 + def accept?(blob); end + + # pkg:gem/activestorage#lib/active_storage/previewer/poppler_pdf_previewer.rb:14 + def pdftoppm_exists?; end + + # pkg:gem/activestorage#lib/active_storage/previewer/poppler_pdf_previewer.rb:10 + def pdftoppm_path; end + end +end + +# pkg:gem/activestorage#lib/active_storage/previewer/video_previewer.rb:6 +class ActiveStorage::Previewer::VideoPreviewer < ::ActiveStorage::Previewer + # pkg:gem/activestorage#lib/active_storage/previewer/video_previewer.rb:23 + def preview(**options); end + + private + + # pkg:gem/activestorage#lib/active_storage/previewer/video_previewer.rb:32 + def draw_relevant_frame_from(file, &block); end + + class << self + # pkg:gem/activestorage#lib/active_storage/previewer/video_previewer.rb:8 + def accept?(blob); end + + # pkg:gem/activestorage#lib/active_storage/previewer/video_previewer.rb:12 + def ffmpeg_exists?; end + + # pkg:gem/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 + def queue_name; end + def rescue_handlers; end + end +end + +class ActiveStorage::Record < ::ActiveRecord::Base + include ::ActiveStorage::Record::GeneratedAttributeMethods + include ::ActiveStorage::Record::GeneratedAssociationMethods +end + +module ActiveStorage::Record::GeneratedAssociationMethods; end +module ActiveStorage::Record::GeneratedAttributeMethods; end + +# pkg:gem/activestorage#lib/active_storage/reflection.rb:4 +module ActiveStorage::Reflection; end + +# pkg:gem/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 + +# pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/activestorage#lib/active_storage/reflection.rb:68 + def reflect_on_attachment(attachment); end +end + +# pkg:gem/activestorage#lib/active_storage/reflection.rb:5 +class ActiveStorage::Reflection::HasAttachedReflection < ::ActiveRecord::Reflection::MacroReflection + # pkg:gem/activestorage#lib/active_storage/reflection.rb:10 + def named_variants; end + + # pkg:gem/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. +# +# pkg:gem/activestorage#lib/active_storage/reflection.rb:25 +class ActiveStorage::Reflection::HasManyAttachedReflection < ::ActiveStorage::Reflection::HasAttachedReflection + # pkg:gem/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. +# +# pkg:gem/activestorage#lib/active_storage/reflection.rb:17 +class ActiveStorage::Reflection::HasOneAttachedReflection < ::ActiveStorage::Reflection::HasAttachedReflection + # pkg:gem/activestorage#lib/active_storage/reflection.rb:18 + def macro; end +end + +# pkg:gem/activestorage#lib/active_storage/reflection.rb:31 +module ActiveStorage::Reflection::ReflectionExtension + # pkg:gem/activestorage#lib/active_storage/reflection.rb:32 + def add_attachment_reflection(model, name, reflection); end + + private + + # pkg:gem/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); end + def blob_scope; end + def set_representation; end + + class << self + def __callbacks; end + def middleware_stack; 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); end + + class << self + def __callbacks; end + def middleware_stack; end + end +end + +class ActiveStorage::Representations::RedirectController < ::ActiveStorage::Representations::BaseController + def show; end + + private + + def _layout(lookup_context, formats); end + + class << self + def middleware_stack; 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. +# * +AzureStorage+, to manage attachments through Microsoft Azure Storage. +# * +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") } } +# ) +# +# pkg:gem/activestorage#lib/active_storage/service.rb:43 +class ActiveStorage::Service + extend ::ActiveSupport::Autoload + + # Concatenate multiple files into a single "composed" file. + # + # pkg:gem/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+. + # + # pkg:gem/activestorage#lib/active_storage/service.rb:101 + def delete(key); end + + # Delete files at keys starting with the +prefix+. + # + # pkg:gem/activestorage#lib/active_storage/service.rb:106 + def delete_prefixed(prefix); end + + # Return the content of the file at the +key+. + # + # pkg:gem/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+. + # + # pkg:gem/activestorage#lib/active_storage/service.rb:87 + def download_chunk(key, range); end + + # Return +true+ if a file exists at the +key+. + # + # pkg:gem/activestorage#lib/active_storage/service.rb:111 + def exist?(key); end + + # Returns a Hash of headers for +url_for_direct_upload+ requests. + # + # pkg:gem/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 + + # pkg:gem/activestorage#lib/active_storage/service.rb:46 + def name; end + + # pkg:gem/activestorage#lib/active_storage/service.rb:46 + def name=(_arg0); end + + # pkg:gem/activestorage#lib/active_storage/service.rb:91 + def open(*args, **options, &block); end + + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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+. + # + # pkg:gem/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. + # + # pkg:gem/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 + + # pkg:gem/activestorage#lib/active_storage/service.rb:175 + def content_disposition_with(filename:, type: T.unsafe(nil)); end + + # pkg:gem/activestorage#lib/active_storage/service.rb:160 + def custom_metadata_headers(metadata); end + + # pkg:gem/activestorage#lib/active_storage/service.rb:164 + def instrument(operation, payload = T.unsafe(nil), &block); end + + # pkg:gem/activestorage#lib/active_storage/service.rb:152 + def private_url(key, expires_in:, filename:, disposition:, content_type:, **); end + + # pkg:gem/activestorage#lib/active_storage/service.rb:156 + def public_url(key, **); end + + # pkg:gem/activestorage#lib/active_storage/service.rb:170 + 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. + # + # pkg:gem/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. + # + # pkg:gem/activestorage#lib/active_storage/service.rb:52 + def configure(service_name, configurations); end + end +end + +# pkg:gem/activestorage#lib/active_storage/service/configurator.rb:4 +class ActiveStorage::Service::Configurator + # pkg:gem/activestorage#lib/active_storage/service/configurator.rb:11 + def initialize(configurations); end + + # pkg:gem/activestorage#lib/active_storage/service/configurator.rb:15 + def build(service_name); end + + # pkg:gem/activestorage#lib/active_storage/service/configurator.rb:5 + def configurations; end + + private + + # pkg:gem/activestorage#lib/active_storage/service/configurator.rb:23 + def config_for(name); end + + # pkg:gem/activestorage#lib/active_storage/service/configurator.rb:29 + def resolve(class_name); end + + class << self + # pkg:gem/activestorage#lib/active_storage/service/configurator.rb:7 + def build(service_name, configurations); end + end +end + +# pkg:gem/activestorage#lib/active_storage/service/registry.rb:4 +class ActiveStorage::Service::Registry + # pkg:gem/activestorage#lib/active_storage/service/registry.rb:5 + def initialize(configurations); end + + # pkg:gem/activestorage#lib/active_storage/service/registry.rb:10 + def fetch(name); end + + private + + # pkg:gem/activestorage#lib/active_storage/service/registry.rb:26 + def configurations; end + + # pkg:gem/activestorage#lib/active_storage/service/registry.rb:28 + def configurator; end + + # pkg:gem/activestorage#lib/active_storage/service/registry.rb:26 + 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) + +class ActiveStorage::TransformJob < ::ActiveStorage::BaseJob + def perform(blob, transformations); end + + class << self + def queue_name; end + def rescue_handlers; end + end +end + +# pkg:gem/activestorage#lib/active_storage.rb:383 +module ActiveStorage::Transformers + extend ::ActiveSupport::Autoload +end + +# pkg:gem/activestorage#lib/active_storage/transformers/image_processing_transformer.rb:14 +class ActiveStorage::Transformers::ImageProcessingTransformer < ::ActiveStorage::Transformers::Transformer + private + + # pkg:gem/activestorage#lib/active_storage/transformers/image_processing_transformer.rb:32 + def operations; end + + # pkg:gem/activestorage#lib/active_storage/transformers/image_processing_transformer.rb:19 + def process(file, format:); end + + # pkg:gem/activestorage#lib/active_storage/transformers/image_processing_transformer.rb:28 + def processor; end + + # pkg:gem/activestorage#lib/active_storage/transformers/image_processing_transformer.rb:79 + def validate_arg_array(argument); end + + # pkg:gem/activestorage#lib/active_storage/transformers/image_processing_transformer.rb:93 + def validate_arg_hash(argument); end + + # pkg:gem/activestorage#lib/active_storage/transformers/image_processing_transformer.rb:71 + def validate_arg_string(argument); end + + # pkg:gem/activestorage#lib/active_storage/transformers/image_processing_transformer.rb:51 + def validate_transformation(name, argument); end +end + +# pkg:gem/activestorage#lib/active_storage/transformers/image_processing_transformer.rb:17 +class ActiveStorage::Transformers::ImageProcessingTransformer::UnsupportedImageProcessingArgument < ::StandardError; end + +# pkg:gem/activestorage#lib/active_storage/transformers/image_processing_transformer.rb:16 +class ActiveStorage::Transformers::ImageProcessingTransformer::UnsupportedImageProcessingMethod < ::StandardError; 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 +# +# pkg:gem/activestorage#lib/active_storage/transformers/transformer.rb:13 +class ActiveStorage::Transformers::Transformer + # pkg:gem/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. + # + # pkg:gem/activestorage#lib/active_storage/transformers/transformer.rb:23 + def transform(file, format:); end + + # pkg:gem/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. + # + # pkg:gem/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. +# +# pkg:gem/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. +# +# pkg:gem/activestorage#lib/active_storage/errors.rb:17 +class ActiveStorage::UnrepresentableError < ::ActiveStorage::Error; end + +# pkg:gem/activestorage#lib/active_storage/gem_version.rb:9 +module ActiveStorage::VERSION; end + +# pkg:gem/activestorage#lib/active_storage/gem_version.rb:10 +ActiveStorage::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activestorage#lib/active_storage/gem_version.rb:11 +ActiveStorage::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activestorage#lib/active_storage/gem_version.rb:13 +ActiveStorage::VERSION::PRE = T.let(T.unsafe(nil), String) + +# pkg:gem/activestorage#lib/active_storage/gem_version.rb:15 +ActiveStorage::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/activestorage#lib/active_storage/gem_version.rb:12 +ActiveStorage::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +class ActiveStorage::Variant + include ::ActiveStorage::Blob::Servable + + def initialize(blob, variation_or_variation_key); end + + def blob; end + def content_type(*, **, &); end + def destroy; end + def download(&block); end + def filename; end + def image; end + def key; end + def processed; end + def service(*, **, &); 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 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 + # pkg:gem/activestorage#lib/active_storage/reflection.rb:53 + def attachment_reflections; 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(*, **, &); end + def destroy; end + def download(*, **, &); end + def filename; end + def image; end + def key(*, **, &); end + def processed; end + def service(*, **, &); end + def url(*, **, &); 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@7.1.3.4.rbi b/sorbet/rbi/gems/activesupport@7.1.3.4.rbi new file mode 100644 index 000000000..29d6508a5 --- /dev/null +++ b/sorbet/rbi/gems/activesupport@7.1.3.4.rbi @@ -0,0 +1,19202 @@ +# 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: activesupport/README.rdoc +# -- +# The JSON gem adds a few modules to Ruby core classes containing :to_json definition, overwriting +# their default behavior. That said, we need to define the basic to_json method in all of them, +# otherwise they will always use to_json gem implementation, which is backwards incompatible in +# several cases (for instance, the JSON implementation for Hash does not work) with inheritance. +# +# On the other hand, we should avoid conflict with ::JSON.{generate,dump}(obj). Unfortunately, the +# JSON gem's encoder relies on its own to_json implementation to encode objects. Since it always +# passes a ::JSON::State object as the only argument to to_json, we can detect that and forward the +# calls to the original to_json method. +# +# It should be noted that when using ::JSON.{generate,dump} directly, ActiveSupport's encoder is +# bypassed completely. This means that as_json won't be invoked and the JSON gem will simply +# ignore any options it does not natively understand. This also means that ::JSON.{generate,dump} +# should give exactly the same results with or without Active Support. +# -- +# Defines the standard inflection rules. These are the starting point for +# new projects and are not considered complete. The current set of inflection +# rules is frozen. This means, we do not change them to become more complete. +# This is a safety measure to keep existing applications from breaking. +# ++ +# +# pkg:gem/activesupport#lib/active_support/deep_mergeable.rb:3 +module ActiveSupport + extend ::ActiveSupport::LazyLoadHooks + extend ::ActiveSupport::Autoload + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:9 + def parse_json_times; end + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:9 + def parse_json_times=(val); end + + # pkg:gem/activesupport#lib/active_support.rb:98 + def test_order; end + + # pkg:gem/activesupport#lib/active_support.rb:98 + def test_order=(val); end + + # pkg:gem/activesupport#lib/active_support.rb:99 + def test_parallelization_threshold; end + + # pkg:gem/activesupport#lib/active_support.rb:99 + def test_parallelization_threshold=(val); end + + class << self + # pkg:gem/activesupport#lib/active_support.rb:104 + def cache_format_version; end + + # pkg:gem/activesupport#lib/active_support.rb:108 + def cache_format_version=(value); end + + # pkg:gem/activesupport#lib/active_support/deprecator.rb:4 + def deprecator; end + + # pkg:gem/activesupport#lib/active_support.rb:92 + def eager_load!; end + + # pkg:gem/activesupport#lib/active_support.rb:102 + def error_reporter; end + + # pkg:gem/activesupport#lib/active_support.rb:102 + def error_reporter=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def escape_html_entities_in_json(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def escape_html_entities_in_json=(arg); end + + # Returns the currently loaded version of Active Support as a +Gem::Version+. + # + # pkg:gem/activesupport#lib/active_support/gem_version.rb:5 + def gem_version; end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def json_encoder(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def json_encoder=(arg); end + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:9 + def parse_json_times; end + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:9 + def parse_json_times=(val); end + + # pkg:gem/activesupport#lib/active_support.rb:98 + def test_order; end + + # pkg:gem/activesupport#lib/active_support.rb:98 + def test_order=(val); end + + # pkg:gem/activesupport#lib/active_support.rb:99 + def test_parallelization_threshold; end + + # pkg:gem/activesupport#lib/active_support.rb:99 + def test_parallelization_threshold=(val); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def time_precision(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def time_precision=(arg); end + + # pkg:gem/activesupport#lib/active_support.rb:112 + def to_time_preserves_timezone; end + + # pkg:gem/activesupport#lib/active_support.rb:116 + def to_time_preserves_timezone=(value); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def use_standard_json_time_format(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:8 + def use_standard_json_time_format=(arg); end + + # pkg:gem/activesupport#lib/active_support.rb:126 + def utc_to_local_returns_utc_offset_times; end + + # pkg:gem/activesupport#lib/active_support.rb:130 + def utc_to_local_returns_utc_offset_times=(value); end + + # Returns the currently loaded version of Active Support as a +Gem::Version+. + # + # pkg:gem/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. +# +# pkg:gem/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 + # pkg:gem/activesupport#lib/active_support/actionable_error.rb:20 + def actions(error); end + + # pkg:gem/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 + +# pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/actionable_error.rb:45 + def action(name, &block); end +end + +# pkg:gem/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 +# +# pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/array_inquirer.rb:27 + def any?(*candidates); end + + private + + # pkg:gem/activesupport#lib/active_support/array_inquirer.rb:42 + def method_missing(name, *args); end + + # pkg:gem/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! +# +# pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:29 +module ActiveSupport::Autoload + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:42 + def autoload(const_name, path = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:63 + def autoload_at(path); end + + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:56 + def autoload_under(path); end + + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:70 + def eager_autoload; end + + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:77 + def eager_load!; end + + class << self + # pkg:gem/activesupport#lib/active_support/dependencies/autoload.rb:30 + def extended(base); end + 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 +# bc.add_filter { |line| line.gsub(Rails.root.to_s, '') } # 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. +# +# pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:33 +class ActiveSupport::BacktraceCleaner + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:34 + 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" + # backtrace_cleaner.add_filter { |line| line.gsub(Rails.root.to_s, '') } + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:80 + 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) } + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:89 + def add_silencer(&block); end + + # Returns the backtrace after all filters and silencers have been run + # against it. Filters run first, then silencers. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:43 + def clean(backtrace, kind = T.unsafe(nil)); end + + # Returns the frame with all filters applied. + # returns +nil+ if the frame was silenced. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:59 + def clean_frame(frame, kind = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:55 + def filter(backtrace, 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. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:103 + 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. + # + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:96 + def remove_silencers!; end + + private + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:110 + def add_gem_filter; end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:119 + def add_gem_silencer; end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:123 + def add_stdlib_silencer; end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:127 + def filter_backtrace(backtrace); end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:143 + def noise(backtrace); end + + # pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:135 + def silence(backtrace); end +end + +# pkg:gem/activesupport#lib/active_support/backtrace_cleaner.rb:108 +ActiveSupport::BacktraceCleaner::FORMATTED_GEMS_PATTERN = T.let(T.unsafe(nil), Regexp) + +# = \Benchmarkable +# +# pkg:gem/activesupport#lib/active_support/benchmarkable.rb:8 +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 %> + # + # pkg:gem/activesupport#lib/active_support/benchmarkable.rb:38 + def benchmark(message = T.unsafe(nil), options = T.unsafe(nil), &block); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/big_decimal/conversions.rb:7 +module ActiveSupport::BigDecimalWithDefaultFormat + # pkg:gem/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] +# +# pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:74 +class ActiveSupport::BroadcastLogger + include ::ActiveSupport::LoggerSilence + include ::ActiveSupport::LoggerThreadSafeLevel + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:82 + def initialize(*loggers); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:112 + def <<(message); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:116 + def add(*args, &block); end + + # Add logger(s) to the broadcast. + # + # broadcast_logger = ActiveSupport::BroadcastLogger.new + # broadcast_logger.broadcast_to(Logger.new(STDOUT), Logger.new(STDERR)) + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:93 + def broadcast_to(*loggers); end + + # Returns all the logger that are part of this broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:78 + def broadcasts; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:162 + def close; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:121 + def debug(*args, &block); end + + # Sets the log level to Logger::DEBUG for the whole broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:173 + def debug!; end + + # +True+ if the log level allows entries with severity Logger::DEBUG to be written + # to at least one broadcast. +False+ otherwise. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:168 + def debug?; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:133 + def error(*args, &block); end + + # Sets the log level to Logger::ERROR for the whole broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:206 + def error!; end + + # +True+ if the log level allows entries with severity Logger::ERROR to be written + # to at least one broadcast. +False+ otherwise. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:201 + def error?; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:137 + def fatal(*args, &block); end + + # Sets the log level to Logger::FATAL for the whole broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:217 + def fatal!; end + + # +True+ if the log level allows entries with severity Logger::FATAL to be written + # to at least one broadcast. +False+ otherwise. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:212 + def fatal?; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:79 + def formatter; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:145 + def formatter=(formatter); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:125 + def info(*args, &block); end + + # Sets the log level to Logger::INFO for the whole broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:184 + def info!; end + + # +True+ if the log level allows entries with severity Logger::INFO to be written + # to at least one broadcast. +False+ otherwise. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:179 + def info?; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:108 + def level; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:151 + def level=(level); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:156 + def local_level=(level); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:119 + def log(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:80 + def progname; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:80 + def progname=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:154 + def sev_threshold=(level); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:75 + def silencer; end + + # pkg:gem/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) + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:104 + def stop_broadcasting_to(logger); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:141 + def unknown(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:129 + def warn(*args, &block); end + + # Sets the log level to Logger::WARN for the whole broadcast. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:195 + def warn!; end + + # +True+ if the log level allows entries with severity Logger::WARN to be written + # to at least one broadcast. +False+ otherwise. + # + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:190 + def warn?; end + + private + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:230 + def dispatch(&block); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:221 + def initialize_copy(other); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:234 + def method_missing(name, *args, **kwargs, &block); end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:246 + def respond_to_missing?(method, include_all); end + + class << self + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:75 + def silencer; end + + # pkg:gem/activesupport#lib/active_support/broadcast_logger.rb:75 + def silencer=(val); end + end +end + +# See ActiveSupport::Cache::Store for documentation. +# +# pkg:gem/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+. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:117 + def expand_cache_key(key, namespace = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:58 + def format_version; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:58 + 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 + # + # pkg:gem/activesupport#lib/active_support/cache.rb:85 + def lookup_store(store = T.unsafe(nil), *parameters); end + + private + + # pkg:gem/activesupport#lib/active_support/cache.rb:129 + 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. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:141 + def retrieve_store_class(store); end + end +end + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:7 +class ActiveSupport::Cache::Coder + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:8 + def initialize(serializer, compressor, legacy_serializer: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:14 + def dump(entry); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:20 + def dump_compressed(entry, threshold); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:48 + def load(dumped); end + + private + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:136 + def dump_version(version); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:144 + def load_version(dumped_version); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:121 + def signature?(dumped); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:129 + def try_compress(string, threshold); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:125 + def type_for_string(value); end +end + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:76 +ActiveSupport::Cache::Coder::COMPRESSED_FLAG = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:98 +class ActiveSupport::Cache::Coder::LazyEntry < ::ActiveSupport::Cache::Entry + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:99 + def initialize(serializer, compressor, payload, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:114 + def mismatched?(version); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:106 + def value; end +end + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:84 +ActiveSupport::Cache::Coder::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:68 +ActiveSupport::Cache::Coder::OBJECT_DUMP_TYPE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:80 +ActiveSupport::Cache::Coder::PACKED_EXPIRES_AT_TEMPLATE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:78 +ActiveSupport::Cache::Coder::PACKED_TEMPLATE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:79 +ActiveSupport::Cache::Coder::PACKED_TYPE_TEMPLATE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:82 +ActiveSupport::Cache::Coder::PACKED_VERSION_INDEX = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:81 +ActiveSupport::Cache::Coder::PACKED_VERSION_LENGTH_TEMPLATE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:66 +ActiveSupport::Cache::Coder::SIGNATURE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:96 +ActiveSupport::Cache::Coder::STRING_DESERIALIZERS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:70 +ActiveSupport::Cache::Coder::STRING_ENCODINGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/cache/coder.rb:86 +class ActiveSupport::Cache::Coder::StringDeserializer + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:87 + def initialize(encoding); end + + # pkg:gem/activesupport#lib/active_support/cache/coder.rb:91 + def load(payload); end +end + +# pkg:gem/activesupport#lib/active_support/cache.rb:45 +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. +# +# pkg:gem/activesupport#lib/active_support/cache.rb:49 +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. +# +# pkg:gem/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+. + # + # pkg:gem/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), **); end + + # Returns the size of the cached value. This could be less than + # value.bytesize if the data is compressed. + # + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:61 + def bytesize; end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:76 + def compressed(compress_threshold); end + + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:43 + def expired?; end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:47 + def expires_at; end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:51 + def expires_at=(value); end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:100 + def local?; end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:37 + def mismatched?(version); end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:116 + def pack; end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:33 + def value; end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:21 + def version; end + + private + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:127 + def marshal_load(payload); end + + # pkg:gem/activesupport#lib/active_support/cache/entry.rb:123 + def uncompress(value); end + + class << self + # pkg:gem/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. +# +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:12 +class ActiveSupport::Cache::FileStore < ::ActiveSupport::Cache::Store + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:20 + def initialize(cache_path, **options); end + + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:75 + def decrement(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:79 + 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 + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:60 + def increment(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:90 + def inspect; end + + private + + # Delete empty directories in the cache. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:184 + def delete_empty_directories(dir); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:120 + def delete_entry(key, **options); end + + # Make sure a file path's directories exist. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:193 + def ensure_cache_path(path); end + + # Translate a file path into a key. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:178 + def file_path_key(path); end + + # Lock a file for a block so only one process can modify it at a time. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:137 + 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+. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:211 + def modify_value(name, amount, options); end + + # Translate a key into a file path. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:151 + def normalize_key(key, options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:95 + def read_entry(key, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:102 + def read_serialized_entry(key, **); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:197 + def search_dir(dir, &callback); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:109 + def write_entry(key, entry, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:113 + def write_serialized_entry(key, payload, **options); end + + class << self + # Advertise cache versioning support. + # + # pkg:gem/activesupport#lib/active_support/cache/file_store.rb:26 + def supports_cache_versioning?; end + end +end + +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:15 +ActiveSupport::Cache::FileStore::DIR_FORMATTER = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:16 +ActiveSupport::Cache::FileStore::FILENAME_MAX_SIZE = T.let(T.unsafe(nil), Integer) + +# max filename size on file system is 255, minus room for timestamp, pid, and random characters appended by Tempfile (used by atomic write) +# +# pkg:gem/activesupport#lib/active_support/cache/file_store.rb:17 +ActiveSupport::Cache::FileStore::FILEPATH_MAX_SIZE = T.let(T.unsafe(nil), Integer) + +# max is 1024, plus some room +# +# pkg:gem/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. +# +# pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:28 +class ActiveSupport::Cache::MemoryStore < ::ActiveSupport::Cache::Store + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:164 + def decrement(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + + # Deletes cache entries if the cache key matches a given pattern. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:169 + 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 + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:149 + def increment(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:180 + def inspect; end + + # To ensure entries fit within the specified memory prune the cache by removing the least + # recently accessed entries. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:186 + def synchronize(&block); end + + private + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:193 + def cached_size(key, payload); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:226 + 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+. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:236 + def modify_value(name, amount, options); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:197 + def read_entry(key, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:209 + def write_entry(key, entry, **options); end + + class << self + # Advertise cache versioning support. + # + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:88 + def supports_cache_versioning?; end + end +end + +# pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:29 +module ActiveSupport::Cache::MemoryStore::DupCoder + extend ::ActiveSupport::Cache::MemoryStore::DupCoder + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:32 + def dump(entry); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:40 + def dump_compressed(entry, threshold); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:45 + def load(entry); end + + private + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:56 + def dump_value(value); end + + # pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:64 + def load_value(string); end +end + +# pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:54 +ActiveSupport::Cache::MemoryStore::DupCoder::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/memory_store.rb:191 +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. +# +# pkg:gem/activesupport#lib/active_support/cache/null_store.rb:14 +class ActiveSupport::Cache::NullStore < ::ActiveSupport::Cache::Store + include ::ActiveSupport::Cache::Strategy::LocalCache + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:25 + def cleanup(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:22 + def clear(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:31 + def decrement(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:34 + def delete_matched(matcher, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:28 + def increment(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:37 + def inspect; end + + private + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:57 + def delete_entry(key, **); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:42 + def read_entry(key, **s); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:46 + def read_serialized_entry(key, raw: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:49 + def write_entry(key, entry, **); end + + # pkg:gem/activesupport#lib/active_support/cache/null_store.rb:53 + def write_serialized_entry(key, payload, **); end + + class << self + # Advertise cache versioning support. + # + # pkg:gem/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. +# +# pkg:gem/activesupport#lib/active_support/cache.rb:41 +ActiveSupport::Cache::OPTION_ALIASES = T.let(T.unsafe(nil), Hash) + +# = Redis \Cache \Store +# +# Deployment note: Take care to use a dedicated Redis cache rather +# than pointing this at a persistent Redis server (for example, one used as +# an Active Job queue). Redis won't cope well with mixed usage patterns and it +# won't expire cache entries by default. +# +# Redis cache server setup guide: https://redis.io/topics/lru-cache +# +# * Supports vanilla Redis, hiredis, and +Redis::Distributed+. +# * Supports Memcached-like sharding across Redises with +Redis::Distributed+. +# * Fault tolerant. If the Redis server is unavailable, no exceptions are +# raised. Cache fetches are all misses and writes are dropped. +# * Local cache. Hot in-memory primary cache within block/middleware scope. +# * +read_multi+ and +write_multi+ support for Redis mget/mset. Use +# +Redis::Distributed+ 4.0.1+ for distributed mget support. +# * +delete_matched+ support for Redis KEYS globs. +# +# pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:37 +class ActiveSupport::Cache::RedisCacheStore < ::ActiveSupport::Cache::Store + include ::ActiveSupport::Cache::Strategy::LocalCache + + # Creates a new Redis cache store. + # + # There are four ways to provide the Redis client used by the cache: the + # +:redis+ param can be a Redis instance or a block that returns a Redis + # instance, or the +:url+ param can be a string or an array of strings + # which will be used to create a Redis instance or a +Redis::Distributed+ + # instance. + # + # Option Class Result + # :redis Proc -> options[:redis].call + # :redis Object -> options[:redis] + # :url String -> Redis.new(url: …) + # :url Array -> Redis::Distributed.new([{ url: … }, { url: … }, …]) + # + # No namespace is set by default. Provide one if the Redis cache + # server is shared with other apps: namespace: 'myapp-cache'. + # + # Compression is enabled by default with a 1kB threshold, so cached + # values larger than 1kB are automatically compressed. Disable by + # passing compress: false or change the threshold by passing + # compress_threshold: 4.kilobytes. + # + # No expiry is set on cache entries by default. Redis is expected to + # be configured with an eviction policy that automatically deletes + # least-recently or -frequently used keys when it reaches max memory. + # See https://redis.io/topics/lru-cache for cache server setup. + # + # Race condition TTL is not set by default. This can be used to avoid + # "thundering herd" cache writes when hot cache entries are expired. + # See ActiveSupport::Cache::Store#fetch for more. + # + # Setting skip_nil: true will not cache nil results: + # + # cache.fetch('foo') { nil } + # cache.fetch('bar', skip_nil: true) { nil } + # cache.exist?('foo') # => true + # cache.exist?('bar') # => false + # + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:149 + def initialize(error_handler: T.unsafe(nil), **redis_options); end + + # Cache Store API implementation. + # + # Removes expired entries. Handled natively by Redis least-recently-/ + # least-frequently-used expiry, so manual cleanup is not supported. + # + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:276 + def cleanup(options = T.unsafe(nil)); end + + # Clear the entire cache on all Redis servers. Safe to use on + # shared servers if the cache is namespaced. + # + # Failsafe: Raises errors. + # + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:284 + def clear(options = T.unsafe(nil)); end + + # Decrement a cached integer value using the Redis decrby atomic operator. + # 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 passing raw: true: + # + # cache.write("baz", 5, raw: true) + # cache.decrement("baz") # => 4 + # + # Decrementing a non-numeric value, or a value written without + # raw: true, will fail and return +nil+. + # + # Failsafe: Raises errors. + # + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:262 + def decrement(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + + # Cache Store API implementation. + # + # Supports Redis KEYS glob patterns: + # + # h?llo matches hello, hallo and hxllo + # h*llo matches hllo and heeeello + # h[ae]llo matches hello and hallo, but not hillo + # h[^e]llo matches hallo, hbllo, ... but not hello + # h[a-b]llo matches hallo and hbllo + # + # Use \ to escape special characters if you want to match them verbatim. + # + # See https://redis.io/commands/KEYS for more. + # + # Failsafe: Raises errors. + # + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:198 + def delete_matched(matcher, options = T.unsafe(nil)); end + + # Increment a cached integer value using the Redis incrby atomic operator. + # Returns the updated value. + # + # If the key is unset or has expired, it will be set to +amount+: + # + # cache.increment("foo") # => 1 + # cache.increment("bar", 100) # => 100 + # + # To set a specific value, call #write passing raw: true: + # + # cache.write("baz", 5, raw: true) + # cache.increment("baz") # => 6 + # + # Incrementing a non-numeric value, or a value written without + # raw: true, will fail and return +nil+. + # + # Failsafe: Raises errors. + # + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:236 + def increment(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:164 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:109 + def max_key_bytesize; end + + # Cache Store API implementation. + # + # Read multiple values at once. Returns a hash of requested keys -> + # fetched values. + # + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:172 + def read_multi(*names); end + + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:110 + def redis; end + + # Get info from redis servers. + # + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:295 + def stats; end + + private + + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:444 + def change_counter(key, amount, options); end + + # Delete an entry from the cache. + # + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:379 + def delete_entry(key, **); end + + # Deletes multiple entries in the cache. Returns the number of entries deleted. + # + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:386 + def delete_multi_entries(entries, **_options); end + + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:422 + def deserialize_entry(payload, raw: T.unsafe(nil), **); end + + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:478 + def failsafe(method, returning: T.unsafe(nil)); end + + # Truncate keys that exceed 1kB. + # + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:408 + def normalize_key(key, options); end + + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:300 + def pipeline_entries(entries, &block); end + + # Store provider interface: + # Read an entry from the cache. + # + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:314 + def read_entry(key, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:324 + def read_multi_entries(names, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:318 + def read_serialized_entry(key, raw: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:438 + def serialize_entries(entries, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:430 + def serialize_entry(entry, raw: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:471 + def supports_expire_nx?; end + + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:412 + def truncate_key(key); end + + # Write an entry to the cache. + # + # Requires Redis 2.6.12+ for extended SET options. + # + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:351 + def write_entry(key, entry, raw: T.unsafe(nil), **options); end + + # Nonstandard store provider API to write multiple values at once. + # + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:393 + def write_multi_entries(entries, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:355 + def write_serialized_entry(key, payload, **); end + + class << self + # Factory method to create a new Redis instance. + # + # Handles four options: :redis block, :redis instance, single :url + # string, and multiple :url strings. + # + # Option Class Result + # :redis Proc -> options[:redis].call + # :redis Object -> options[:redis] + # :url String -> Redis.new(url: …) + # :url Array -> Redis::Distributed.new([{ url: … }, { url: … }, …]) + # + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:81 + def build_redis(redis: T.unsafe(nil), url: T.unsafe(nil), **redis_options); end + + # Advertise cache versioning support. + # + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:63 + def supports_cache_versioning?; end + + private + + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:104 + def build_redis_client(**redis_options); end + + # pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:98 + def build_redis_distributed_client(urls:, **redis_options); end + end +end + +# pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:47 +ActiveSupport::Cache::RedisCacheStore::DEFAULT_ERROR_HANDLER = T.let(T.unsafe(nil), Proc) + +# pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:41 +ActiveSupport::Cache::RedisCacheStore::DEFAULT_REDIS_OPTIONS = T.let(T.unsafe(nil), Hash) + +# Keys are truncated with the Active Support digest if they exceed 1kB +# +# pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:39 +ActiveSupport::Cache::RedisCacheStore::MAX_KEY_BYTESIZE = T.let(T.unsafe(nil), Integer) + +# The maximum number of entries to receive per SCAN call. +# +# pkg:gem/activesupport#lib/active_support/cache/redis_cache_store.rb:59 +ActiveSupport::Cache::RedisCacheStore::SCAN_BATCH_SIZE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:8 +module ActiveSupport::Cache::SerializerWithFallback + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:17 + def load(dumped); end + + private + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:39 + def marshal_load(payload); end + + class << self + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:9 + def [](format); end + end +end + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:66 +module ActiveSupport::Cache::SerializerWithFallback::Marshal61WithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::Marshal61WithFallback + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:80 + def _load(payload); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:72 + def dump(entry); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:76 + def dump_compressed(entry, threshold); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:83 + def dumped?(dumped); end +end + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:70 +ActiveSupport::Cache::SerializerWithFallback::Marshal61WithFallback::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:88 +module ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:110 + def _load(marked); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:95 + def dump(entry); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:99 + def dump_compressed(entry, threshold); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:116 + def dumped?(dumped); end +end + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:93 +ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback::MARK_COMPRESSED = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:92 +ActiveSupport::Cache::SerializerWithFallback::Marshal70WithFallback::MARK_UNCOMPRESSED = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:121 +module ActiveSupport::Cache::SerializerWithFallback::Marshal71WithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::Marshal71WithFallback + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:131 + def _load(dumped); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:127 + def dump(value); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:135 + def dumped?(dumped); end +end + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:125 +ActiveSupport::Cache::SerializerWithFallback::Marshal71WithFallback::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:140 +module ActiveSupport::Cache::SerializerWithFallback::MessagePackWithFallback + include ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback + extend ::ActiveSupport::Cache::SerializerWithFallback::MessagePackWithFallback + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:148 + def _load(dumped); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:144 + def dump(value); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:152 + def dumped?(dumped); end + + private + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:157 + def available?; end +end + +# pkg:gem/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 + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:57 + def _load(entry); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:49 + def dump(entry); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:53 + def dump_compressed(entry, threshold); end + + # pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:61 + def dumped?(dumped); end +end + +# pkg:gem/activesupport#lib/active_support/cache/serializer_with_fallback.rb:166 +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") +# 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 +# +# pkg:gem/activesupport#lib/active_support/cache.rb:194 +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 mutally 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. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:319 + 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. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:747 + 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. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:757 + 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. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:738 + 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. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:676 + 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. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:720 + 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. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:688 + 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. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:702 + 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 minute. + # cache = ActiveSupport::Cache::MemoryStore.new(expires_in: 1.minute) + # + # cache.write('foo', 'original value') + # val_1 = nil + # val_2 = nil + # sleep 60 + # + # Thread.new do + # val_1 = cache.fetch('foo', race_condition_ttl: 10.seconds) do + # sleep 1 + # 'new value 1' + # end + # end + # + # Thread.new do + # val_2 = cache.fetch('foo', race_condition_ttl: 10.seconds) do + # 'new value 2' + # end + # end + # + # cache.fetch('foo') # => "original value" + # sleep 10 # First thread extended the life of cache by another 10 seconds + # cache.fetch('foo') # => "new value 1" + # val_1 # => "new value 1" + # val_2 # => "original value" + # + # ==== 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 + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/cache.rb:601 + 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. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:729 + def increment(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:195 + def logger; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:195 + def logger=(val); end + + # Silences the logger within a block. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:346 + def mute; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:711 + def new_entry(value, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:198 + def options; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:196 + def raise_on_invalid_cache_expiration_time; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:196 + 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. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:506 + def read(name, options = T.unsafe(nil)); 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. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:544 + def read_multi(*names); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:198 + def silence; end + + # Silences the logger. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:340 + def silence!; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:199 + 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. + # + # 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. + # + # Other options will be handled by the specific cache store implementation. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:663 + def write(name, value, options = T.unsafe(nil)); end + + # Cache Storage API to write multiple values at once. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:558 + def write_multi(hash, options = T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/cache.rb:1013 + def _instrument(operation, multi: T.unsafe(nil), options: T.unsafe(nil), **payload, &block); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:762 + def default_serializer; end + + # Deletes an entry from the cache implementation. Subclasses must + # implement this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:856 + def delete_entry(key, **options); end + + # Deletes multiples entries in the cache implementation. Subclasses MAY + # implement this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:862 + def delete_multi_entries(entries, **options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:821 + def deserialize_entry(payload, **); 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. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:976 + def expanded_key(key); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:997 + def expanded_version(key); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1050 + def get_entry_value(entry, name, options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1034 + def handle_expired_entry(entry, key, options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:896 + def handle_invalid_expires_in(message); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1005 + def instrument(operation, key, options = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1009 + 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. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:785 + def key_matcher(pattern, options); end + + # Merges the default options with ones specific to a method call. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:867 + 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' + # + # pkg:gem/activesupport#lib/active_support/cache.rb:954 + def namespace_key(key, options = T.unsafe(nil)); end + + # Expands and namespaces 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. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:938 + def normalize_key(key, options = T.unsafe(nil)); end + + # Normalize aliased options to their canonical form + # + # pkg:gem/activesupport#lib/active_support/cache.rb:907 + def normalize_options(options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:993 + def normalize_version(key, options = T.unsafe(nil)); end + + # Reads an entry from the cache implementation. Subclasses must implement + # this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:802 + def read_entry(key, **options); end + + # Reads multiple entries from the cache implementation. Subclasses MAY + # implement this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:829 + def read_multi_entries(names, **options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1055 + def save_block_result_to_cache(name, options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:812 + def serialize_entry(entry, **options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:918 + def validate_options(options); end + + # Writes an entry to the cache implementation. Subclasses must implement + # this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:808 + def write_entry(key, entry, **options); end + + # Writes multiple entries to the cache implementation. Subclasses MAY + # implement this method. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:848 + def write_multi_entries(hash, **options); end + + class << self + # pkg:gem/activesupport#lib/active_support/cache.rb:195 + def logger; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:195 + def logger=(val); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:196 + def raise_on_invalid_cache_expiration_time; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:196 + def raise_on_invalid_cache_expiration_time=(val); end + + private + + # pkg:gem/activesupport#lib/active_support/cache.rb:206 + def retrieve_pool_options(options); end + end +end + +# pkg:gem/activesupport#lib/active_support/cache.rb:51 +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. +# +# pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:13 +module ActiveSupport::Cache::Strategy::LocalCache + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:85 + def cleanup(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:79 + def clear(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:108 + def decrement(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:91 + def delete_matched(matcher, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:97 + def increment(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end + + # Middleware class can be inserted as a Rack handler to be local cache for the + # duration of request. + # + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:73 + def middleware; end + + # Use a local cache for the duration of block. + # + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:67 + def with_local_cache(&block); end + + private + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:185 + def bypass_local_cache(&block); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:162 + def delete_entry(key, **); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:181 + def local_cache; end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:177 + def local_cache_key; end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:134 + def read_multi_entries(names, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:120 + def read_serialized_entry(key, raw: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:189 + def use_temporary_local_cache(temporary_cache); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:167 + def write_cache_value(name, value, **options); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:153 + def write_serialized_entry(key, payload, **); end +end + +# Class for storing and registering the local caches. +# +# pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:17 +module ActiveSupport::Cache::Strategy::LocalCache::LocalCacheRegistry + extend ::ActiveSupport::Cache::Strategy::LocalCache::LocalCacheRegistry + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:20 + def cache_for(local_cache_key); end + + # pkg:gem/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. +# +# pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:35 +class ActiveSupport::Cache::Strategy::LocalCache::LocalStore + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:36 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:40 + def clear(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:57 + def delete_entry(key); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:61 + def fetch_entry(key); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:44 + def read_entry(key); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache.rb:48 + def read_multi_entries(keys); end + + # pkg:gem/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. +# +# pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:13 +class ActiveSupport::Cache::Strategy::LocalCache::Middleware + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:16 + def initialize(name, local_cache_key); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:27 + def call(env); end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:14 + def local_cache_key; end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:14 + def name; end + + # pkg:gem/activesupport#lib/active_support/cache/strategy/local_cache_middleware.rb:22 + def new(app); end +end + +# These options mean something to all cache implementations. Individual cache +# implementations may support additional options. +# +# pkg:gem/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+. +# +# pkg:gem/activesupport#lib/active_support/cache.rb:1071 +class ActiveSupport::Cache::WriteOptions + # pkg:gem/activesupport#lib/active_support/cache.rb:1072 + def initialize(options); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1096 + 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. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:1103 + def expires_at=(expires_at); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1084 + 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. + # + # pkg:gem/activesupport#lib/active_support/cache.rb:1091 + def expires_in=(expires_in); end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1076 + def version; end + + # pkg:gem/activesupport#lib/active_support/cache.rb:1080 + 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+. +# +# pkg:gem/activesupport#lib/active_support/key_generator.rb:55 +class ActiveSupport::CachingKeyGenerator + # pkg:gem/activesupport#lib/active_support/key_generator.rb:56 + def initialize(key_generator); end + + # Returns a derived key suitable for use. + # + # pkg:gem/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 +# +# pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:150 + def halted_callback_hook(filter, name); end + + module GeneratedClassMethods + def __callbacks; end + def __callbacks=(value); end + def __callbacks?; end + end + + module GeneratedInstanceMethods + def __callbacks; end + def __callbacks?; end + end +end + +# pkg:gem/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). +# +# pkg:gem/activesupport#lib/active_support/callbacks.rb:378 +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. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:536 + def build(filter, callback); end + end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:437 +class ActiveSupport::Callbacks::CallTemplate::InstanceExec0 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:438 + def initialize(block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:442 + def expand(target, value, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:452 + def inverted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:446 + def make_lambda; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:459 +class ActiveSupport::Callbacks::CallTemplate::InstanceExec1 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:460 + def initialize(block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:464 + def expand(target, value, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:474 + def inverted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:468 + def make_lambda; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:481 +class ActiveSupport::Callbacks::CallTemplate::InstanceExec2 + # pkg:gem/activesupport#lib/active_support/callbacks.rb:482 + def initialize(block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:486 + def expand(target, value, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:498 + def inverted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:491 + def make_lambda; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:379 +class ActiveSupport::Callbacks::CallTemplate::MethodCall + # pkg:gem/activesupport#lib/active_support/callbacks.rb:380 + 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. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:397 + def expand(target, value, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:407 + def inverted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:401 + def make_lambda; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:414 +class ActiveSupport::Callbacks::CallTemplate::ObjectCall + # pkg:gem/activesupport#lib/active_support/callbacks.rb:415 + def initialize(target, method); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:420 + def expand(target, value, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:430 + def inverted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:424 + def make_lambda; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:506 +class ActiveSupport::Callbacks::CallTemplate::ProcCall + # pkg:gem/activesupport#lib/active_support/callbacks.rb:507 + def initialize(target); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:511 + def expand(target, value, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:521 + def inverted_lambda; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:515 + def make_lambda; end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:283 +class ActiveSupport::Callbacks::Callback + # pkg:gem/activesupport#lib/active_support/callbacks.rb:298 + def initialize(name, filter, kind, options, chain_config); end + + # Wraps code with filter + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:333 + def apply(callback_sequence); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:296 + def chain_config; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:347 + def current_scopes; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:323 + def duplicates?(other); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:296 + def filter; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:295 + def kind; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:295 + def kind=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:319 + def matches?(_kind, _filter); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:307 + def merge_conditional_options(chain, if_option:, unless_option:); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:295 + def name; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:295 + def name=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:355 + def check_conditionals(conditionals); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:370 + def conditions_lambdas; end + + class << self + # pkg:gem/activesupport#lib/active_support/callbacks.rb:284 + def build(chain, filter, kind, options); end + end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:352 +ActiveSupport::Callbacks::Callback::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:606 +class ActiveSupport::Callbacks::CallbackChain + include ::Enumerable + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:611 + def initialize(name, config); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:671 + def append(*callbacks); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:639 + def clear; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:653 + def compile(type); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:609 + def config; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:633 + def delete(o); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:623 + def each(&block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:625 + def empty?; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:624 + def index(o); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:627 + def insert(index, o); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:609 + def name; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:675 + def prepend(*callbacks); end + + protected + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:680 + def chain; end + + private + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:683 + def append_one(callback); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:703 + def default_terminator; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:646 + def initialize_copy(other); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:690 + def prepend_one(callback); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:697 + def remove_duplicates(callback); 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 +# +# pkg:gem/activesupport#lib/active_support/callbacks.rb:559 +class ActiveSupport::Callbacks::CallbackSequence + # pkg:gem/activesupport#lib/active_support/callbacks.rb:560 + def initialize(nested = T.unsafe(nil), call_template = T.unsafe(nil), user_conditions = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:574 + def after(&after); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:579 + def around(call_template, user_conditions); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:569 + def before(&before); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:593 + def expand_call_template(arg, block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:589 + def final?; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:601 + def invoke_after(arg); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:597 + def invoke_before(arg); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:587 + def nested; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:583 + def skip?(arg); end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:715 +module ActiveSupport::Callbacks::ClassMethods + # This is used internally to append, prepend and skip callbacks to the + # CallbackChain. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:725 + 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. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:940 + def define_callbacks(*names); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:716 + def normalize_callback_params(filters, block); end + + # Remove all set callbacks for the given event. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:850 + 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. + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:776 + 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). + # + # pkg:gem/activesupport#lib/active_support/callbacks.rb:825 + def skip_callback(name, *filter_list, &block); end + + protected + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:971 + def get_callbacks(name); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:975 + def set_callbacks(name, callbacks); end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:153 +module ActiveSupport::Callbacks::Conditionals; end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:154 +class ActiveSupport::Callbacks::Conditionals::Value + # pkg:gem/activesupport#lib/active_support/callbacks.rb:155 + def initialize(&block); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:158 + def call(target, value); end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:162 +module ActiveSupport::Callbacks::Filters; end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:215 +class ActiveSupport::Callbacks::Filters::After + class << self + # pkg:gem/activesupport#lib/active_support/callbacks.rb:216 + def build(callback_sequence, user_callback, user_conditions, chain_config); end + + private + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:258 + def conditional(callback_sequence, user_callback, user_conditions); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:247 + def halting(callback_sequence, user_callback); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:232 + def halting_and_conditional(callback_sequence, user_callback, user_conditions); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:272 + def simple(callback_sequence, user_callback); end + end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:165 +class ActiveSupport::Callbacks::Filters::Before + class << self + # pkg:gem/activesupport#lib/active_support/callbacks.rb:166 + def build(callback_sequence, user_callback, user_conditions, chain_config, filter, name); end + + private + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:195 + def halting(callback_sequence, user_callback, halted_lambda, filter, name); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:176 + def halting_and_conditional(callback_sequence, user_callback, user_conditions, halted_lambda, filter, name); end + end +end + +# pkg:gem/activesupport#lib/active_support/callbacks.rb:163 +class ActiveSupport::Callbacks::Filters::Environment < ::Struct + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def halted; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def halted=(_); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def target; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def target=(_); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def value; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def value=(_); end + + class << self + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def members; end + + # pkg:gem/activesupport#lib/active_support/callbacks.rb:163 + def new(*_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/code_generator.rb:4 +class ActiveSupport::CodeGenerator + # pkg:gem/activesupport#lib/active_support/code_generator.rb:48 + def initialize(owner, path, line); end + + # pkg:gem/activesupport#lib/active_support/code_generator.rb:55 + def define_cached_method(name, namespace:, as: T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/code_generator.rb:59 + def execute; end + + class << self + # pkg:gem/activesupport#lib/active_support/code_generator.rb:36 + def batch(owner, path, line); end + end +end + +# pkg:gem/activesupport#lib/active_support/code_generator.rb:5 +class ActiveSupport::CodeGenerator::MethodSet + # pkg:gem/activesupport#lib/active_support/code_generator.rb:8 + def initialize(namespace); end + + # pkg:gem/activesupport#lib/active_support/code_generator.rb:25 + def apply(owner, path, line); end + + # pkg:gem/activesupport#lib/active_support/code_generator.rb:14 + def define_cached_method(name, as: T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/code_generator.rb:6 +ActiveSupport::CodeGenerator::MethodSet::METHOD_CACHES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. +# +# pkg:gem/activesupport#lib/active_support/concern.rb:112 +module ActiveSupport::Concern + # pkg:gem/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) + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/concern.rb:158 + def included(base = T.unsafe(nil), &block); end + + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/concern.rb:175 + def prepended(base = T.unsafe(nil), &block); end + + class << self + # pkg:gem/activesupport#lib/active_support/concern.rb:125 + def extended(base); end + end +end + +# pkg:gem/activesupport#lib/active_support/concern.rb:113 +class ActiveSupport::Concern::MultipleIncludedBlocks < ::StandardError + # pkg:gem/activesupport#lib/active_support/concern.rb:114 + def initialize; end +end + +# pkg:gem/activesupport#lib/active_support/concern.rb:119 +class ActiveSupport::Concern::MultiplePrependBlocks < ::StandardError + # pkg:gem/activesupport#lib/active_support/concern.rb:120 + def initialize; end +end + +# pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:7 +module ActiveSupport::Concurrency; end + +# A monitor that will permit dependency loading while blocked waiting for +# the lock. +# +# pkg:gem/activesupport#lib/active_support/concurrency/load_interlock_aware_monitor.rb:32 +class ActiveSupport::Concurrency::LoadInterlockAwareMonitor < ::Monitor + include ::ActiveSupport::Concurrency::LoadInterlockAwareMonitorMixin +end + +# pkg:gem/activesupport#lib/active_support/concurrency/load_interlock_aware_monitor.rb:7 +module ActiveSupport::Concurrency::LoadInterlockAwareMonitorMixin + # Enters an exclusive section, but allows dependency loading while blocked + # + # pkg:gem/activesupport#lib/active_support/concurrency/load_interlock_aware_monitor.rb:13 + def mon_enter; end + + # pkg:gem/activesupport#lib/active_support/concurrency/load_interlock_aware_monitor.rb:18 + def synchronize(&block); end +end + +# pkg:gem/activesupport#lib/active_support/concurrency/load_interlock_aware_monitor.rb:9 +ActiveSupport::Concurrency::LoadInterlockAwareMonitorMixin::EXCEPTION_IMMEDIATE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/concurrency/load_interlock_aware_monitor.rb:8 +ActiveSupport::Concurrency::LoadInterlockAwareMonitorMixin::EXCEPTION_NEVER = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/concurrency/null_lock.rb:5 +module ActiveSupport::Concurrency::NullLock + extend ::ActiveSupport::Concurrency::NullLock + + # pkg:gem/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 +# +# pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:11 +class ActiveSupport::Concurrency::ShareLock + include ::MonitorMixin + + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:50 + 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. + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:148 + 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. + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:18 + def raw_state; end + + # Execute the supplied block while holding the Share lock. + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:159 + 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. + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:76 + def start_exclusive(purpose: T.unsafe(nil), compatible: T.unsafe(nil), no_wait: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:114 + def start_sharing; end + + # Relinquish the exclusive lock. Must only be called by the thread + # that called start_exclusive (and currently holds the lock). + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:96 + def stop_exclusive(compatible: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:131 + def stop_sharing; end + + # Temporarily give up all held Share locks while executing the + # supplied block, allowing any +compatible+ exclusive lock request + # to proceed. + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:171 + def yield_shares(purpose: T.unsafe(nil), compatible: T.unsafe(nil), block_share: T.unsafe(nil)); end + + private + + # Must be called within synchronize + # + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:204 + def busy_for_exclusive?(purpose); end + + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:209 + def busy_for_sharing?(purpose); end + + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:214 + def eligible_waiters?(compatible); end + + # pkg:gem/activesupport#lib/active_support/concurrency/share_lock.rb:218 + def wait_for(method, &block); end +end + +# pkg:gem/activesupport#lib/active_support/concurrency/load_interlock_aware_monitor.rb:36 +class ActiveSupport::Concurrency::ThreadLoadInterlockAwareMonitor + include ::ActiveSupport::Concurrency::LoadInterlockAwareMonitorMixin + + # pkg:gem/activesupport#lib/active_support/concurrency/load_interlock_aware_monitor.rb:39 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/concurrency/load_interlock_aware_monitor.rb:54 + def mon_enter; end + + private + + # pkg:gem/activesupport#lib/active_support/concurrency/load_interlock_aware_monitor.rb:60 + def mon_exit; end + + # pkg:gem/activesupport#lib/active_support/concurrency/load_interlock_aware_monitor.rb:46 + def mon_try_enter; end +end + +# = Active Support \Configurable +# +# Configurable provides a config method to store and retrieve +# configuration options as an OrderedOptions. +# +# pkg:gem/activesupport#lib/active_support/configurable.rb:11 +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 + # + # pkg:gem/activesupport#lib/active_support/configurable.rb:155 + def config; end +end + +# pkg:gem/activesupport#lib/active_support/configurable.rb:29 +module ActiveSupport::Configurable::ClassMethods + # pkg:gem/activesupport#lib/active_support/configurable.rb:30 + def config; end + + # pkg:gem/activesupport#lib/active_support/configurable.rb:39 + 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] + # + # pkg:gem/activesupport#lib/active_support/configurable.rb:111 + def config_accessor(*names, instance_reader: T.unsafe(nil), instance_writer: T.unsafe(nil), instance_accessor: T.unsafe(nil), default: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/configurable.rb:132 + def inherited(subclass); end +end + +# pkg:gem/activesupport#lib/active_support/configurable.rb:14 +class ActiveSupport::Configurable::Configuration < ::ActiveSupport::InheritableOptions + # pkg:gem/activesupport#lib/active_support/configurable.rb:15 + def compile_methods!; end + + class << self + # Compiles reader methods so we don't have to go through method_missing. + # + # pkg:gem/activesupport#lib/active_support/configurable.rb:20 + 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. +# +# pkg:gem/activesupport#lib/active_support/configuration_file.rb:9 +class ActiveSupport::ConfigurationFile + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:12 + def initialize(content_path); end + + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:21 + def parse(context: T.unsafe(nil), **options); end + + private + + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:35 + def read(content_path); end + + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:46 + def render(context); end + + class << self + # pkg:gem/activesupport#lib/active_support/configuration_file.rb:17 + def parse(content_path, **options); end + end +end + +# pkg:gem/activesupport#lib/active_support/configuration_file.rb:10 +class ActiveSupport::ConfigurationFile::FormatError < ::StandardError; end + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:6 +module ActiveSupport::CoreExt; end + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:7 +module ActiveSupport::CoreExt::ERBUtil + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:28 + def h(s); end + + # HTML escapes strings but doesn't wrap them with an ActiveSupport::SafeBuffer. + # This method is not for public consumption! Seriously! + # 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? + # + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:10 + def html_escape(s); end + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:18 + def unwrapped_html_escape(s); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:31 +module ActiveSupport::CoreExt::ERBUtilPrivate + include ::ActiveSupport::CoreExt::ERBUtil + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:33 + def h(s); end + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:33 + def html_escape(s); end + + # pkg:gem/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. +# +# pkg:gem/activesupport#lib/active_support/current_attributes.rb:91 +class ActiveSupport::CurrentAttributes + include ::ActiveSupport::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:197 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:92 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:92 + def __callbacks?; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:93 + def _reset_callbacks; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:93 + def _run_reset_callbacks(&block); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:195 + def attributes; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:195 + def attributes=(_arg0); end + + # Reset all attributes. Should be called before and after actions, when used as a per-request singleton. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:220 + 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 + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:211 + def set(set_attributes); end + + private + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:227 + def assign_attributes(new_attributes); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:231 + def compute_attributes(keys); end + + class << self + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:92 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:92 + def __callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:92 + def __callbacks?; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:93 + def _reset_callbacks; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:93 + def _reset_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:154 + def after_reset(*methods, &block); end + + # Declares one or more attributes that will be given both class and instance accessor methods. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:104 + def attribute(*names); end + + # Calls this callback before #reset is called on the instance. Used for resetting external collaborators that depend on current values. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:146 + def before_reset(*methods, &block); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:162 + def clear_all; end + + # Returns singleton instance for this class in this thread. If none exists, one is created. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:99 + def instance; end + + # Reset all attributes. Should be called before and after actions, when used as a per-request singleton. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:156 + def reset(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:158 + def reset_all; end + + # Calls this callback after #reset is called on the instance. Used for resetting external collaborators, like Time.zone. + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:151 + def resets(*methods, &block); 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 + # + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:156 + def set(*, **, &); end + + private + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:172 + def current_instances; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:176 + def current_instances_key; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:168 + def generated_attribute_methods; end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:180 + def method_missing(name, *args, **, &block); end + + # pkg:gem/activesupport#lib/active_support/current_attributes.rb:190 + def respond_to_missing?(name, _); end + end +end + +# pkg:gem/activesupport#lib/active_support/current_attributes.rb:95 +ActiveSupport::CurrentAttributes::INVALID_ATTRIBUTE_NAMES = T.let(T.unsafe(nil), Array) + +# Provides +deep_merge+ and +deep_merge!+ methods. Expects the including class +# to provide a merge!(other, &block) method. +# +# pkg:gem/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 } } + # + # pkg:gem/activesupport#lib/active_support/deep_mergeable.rb:29 + def deep_merge(other, &block); end + + # Same as #deep_merge, but modifies +self+. + # + # pkg:gem/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+. + # + # pkg:gem/activesupport#lib/active_support/deep_mergeable.rb:49 + def deep_merge?(other); end +end + +# pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:6 +module ActiveSupport::Dependencies + class << self + # pkg:gem/activesupport#lib/active_support/dependencies.rb:62 + def _autoloaded_tracked_classes; end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:62 + def _autoloaded_tracked_classes=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:56 + def _eager_load_paths; end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:56 + def _eager_load_paths=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:49 + def autoload_once_paths; end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:49 + def autoload_once_paths=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:43 + def autoload_paths; end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:43 + def autoload_paths=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:69 + def autoloader; end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:69 + 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. + # + # pkg:gem/activesupport#lib/active_support/dependencies.rb:76 + def clear; end + + # Private method that helps configuring the autoloaders. + # + # pkg:gem/activesupport#lib/active_support/dependencies.rb:94 + def eager_load?(path); end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:10 + def interlock; end + + # pkg:gem/activesupport#lib/active_support/dependencies.rb:10 + 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. + # + # pkg:gem/activesupport#lib/active_support/dependencies.rb:24 + def load_interlock(&block); end + + # Execute the supplied block without interference from any + # concurrent loads. + # + # pkg:gem/activesupport#lib/active_support/dependencies.rb:17 + def run_interlock(&block); end + + # Private method used by require_dependency. + # + # pkg:gem/activesupport#lib/active_support/dependencies.rb:84 + 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. + # + # pkg:gem/activesupport#lib/active_support/dependencies.rb:31 + def unload_interlock(&block); end + end +end + +# pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:7 +class ActiveSupport::Dependencies::Interlock + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:8 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:32 + def done_running; end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:24 + def done_unloading; end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:12 + def loading(&block); end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:40 + def permit_concurrent_loads(&block); end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:44 + def raw_state(&block); end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:36 + def running(&block); end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:28 + def start_running; end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:20 + def start_unloading; end + + # pkg:gem/activesupport#lib/active_support/dependencies/interlock.rb:16 + def unloading(&block); end +end + +# pkg:gem/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+. + # + # pkg:gem/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 +# +# pkg:gem/activesupport#lib/active_support/deprecation.rb:35 +class ActiveSupport::Deprecation + include ::ActiveSupport::Deprecation::InstanceDelegator + include ::ActiveSupport::Deprecation::Behavior + include ::ActiveSupport::Deprecation::Reporting + include ::ActiveSupport::Deprecation::Disallowed + include ::ActiveSupport::Deprecation::MethodWrapper + extend ::ActiveSupport::Deprecation::InstanceDelegator::ClassMethods + extend ::ActiveSupport::Deprecation::InstanceDelegator::OverrideDelegators + + # 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') + # + # pkg:gem/activesupport#lib/active_support/deprecation.rb:68 + 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. + # + # pkg:gem/activesupport#lib/active_support/deprecation.rb:62 + def deprecation_horizon; end + + # The version number in which the deprecated behavior will be removed, by default. + # + # pkg:gem/activesupport#lib/active_support/deprecation.rb:62 + def deprecation_horizon=(_arg0); end + + class << self + # pkg:gem/activesupport#lib/active_support/deprecation.rb:57 + def allow(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:57 + def begin_silence(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:56 + def behavior(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:56 + def behavior=(arg); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:56 + def debug(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:56 + def debug=(arg); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:59 + def deprecate_methods(*, **, &); end + + # The version number in which the deprecated behavior will be removed, by default. + # + # pkg:gem/activesupport#lib/active_support/deprecation.rb:62 + def deprecation_horizon(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:62 + def deprecation_horizon=(arg); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:57 + def deprecation_warning(deprecated_method_name, message = T.unsafe(nil), caller_backtrace = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:56 + def disallowed_behavior(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:56 + def disallowed_behavior=(arg); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:58 + def disallowed_warnings(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:58 + def disallowed_warnings=(arg); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:57 + def end_silence(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:57 + def gem_name(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:57 + def gem_name=(arg); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:57 + def silence(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:57 + def silenced(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:57 + def silenced=(arg); end + + # pkg:gem/activesupport#lib/active_support/deprecation.rb:57 + def warn(message = T.unsafe(nil), callstack = T.unsafe(nil)); 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. +# +# pkg:gem/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+. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:111 + def behavior=(behavior); end + + # Whether to print a backtrace along with the warning. + # + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:71 + def debug; end + + # Whether to print a backtrace along with the warning. + # + # pkg:gem/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+. + # + # pkg:gem/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+. + # + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:119 + def disallowed_behavior=(behavior); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:124 + def arity_coerce(behavior); end + + # pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:143 + def arity_of_callable(callable); end +end + +# Default warning behaviors per Rails.env. +# +# pkg:gem/activesupport#lib/active_support/deprecation/behaviors.rb:13 +ActiveSupport::Deprecation::DEFAULT_BEHAVIORS = T.let(T.unsafe(nil), Hash) + +# DeprecatedConstantAccessor transforms a constant into a deprecated one by +# hooking +const_missing+. +# +# It takes the names of an old (deprecated) constant and of a new constant +# (both in string form) and a deprecator. +# +# The deprecated constant now returns the same object as the new one rather +# than a proxy object, so it can be used transparently in +rescue+ blocks +# etc. +# +# 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) +# include ActiveSupport::Deprecation::DeprecatedConstantAccessor +# deprecate_constant 'PLANETS', 'PLANETS_POST_2006', deprecator: 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"] +# +# pkg:gem/activesupport#lib/active_support/deprecation/constant_accessor.rb:27 +module ActiveSupport::Deprecation::DeprecatedConstantAccessor + class << self + # pkg:gem/activesupport#lib/active_support/deprecation/constant_accessor.rb:28 + 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"] +# +# pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:122 +class ActiveSupport::Deprecation::DeprecatedConstantProxy < ::Module + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:130 + def initialize(old_const, new_const, deprecator = T.unsafe(nil), message: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:161 + 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 + # + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:157 + def class; end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:171 + def extended(base); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:150 + def hash(*, **, &); end + + # Don't give a deprecation warning on inspect since test/unit and error + # logs rely on it for diagnostics. + # + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:144 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:150 + def instance_methods(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:150 + def name(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:166 + def prepend_features(base); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:150 + def respond_to?(*, **, &); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:181 + def const_missing(name); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:186 + def method_missing(called, *args, &block); end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:177 + def target; end + + class << self + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:123 + 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" +# +# pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:88 +class ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy < ::ActiveSupport::Deprecation::DeprecationProxy + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:89 + def initialize(instance, method, var = T.unsafe(nil), deprecator = T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:98 + def target; end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:102 + 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) +# # => "#" +# +# pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:38 +class ActiveSupport::Deprecation::DeprecatedObjectProxy < ::ActiveSupport::Deprecation::DeprecationProxy + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:39 + def initialize(object, message, deprecator = T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:47 + def target; end + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:51 + def warn(callstack, called, args); end +end + +# pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:17 + def inspect; end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:22 + def method_missing(called, *args, &block); end + + class << self + # pkg:gem/activesupport#lib/active_support/deprecation/proxy_wrappers.rb:6 + def new(*args, &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. +# +# pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:9 +class ActiveSupport::Deprecation::Deprecators + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:10 + def initialize; end + + # Returns a deprecator added to this collection via #[]=. + # + # pkg:gem/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 + # + # pkg:gem/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=. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:60 + def behavior=(behavior); end + + # Sets the debug flag for all deprecators in this collection. + # + # pkg:gem/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=. + # + # pkg:gem/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=. + # + # pkg:gem/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+. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:84 + def silence(&block); end + + # Sets the silenced flag for all deprecators in this collection. + # + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:47 + def silenced=(silenced); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:97 + def apply_options(deprecator); end + + # pkg:gem/activesupport#lib/active_support/deprecation/deprecators.rb:92 + def set_option(name, value); end +end + +# pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:5 +module ActiveSupport::Deprecation::Disallowed + # 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. + # Returns the configured criteria used to identify deprecation messages + # which should be treated as disallowed. + # + # pkg:gem/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. + # Returns the configured criteria used to identify deprecation messages + # which should be treated as disallowed. + # + # pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:17 + def disallowed_warnings=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:26 + def deprecation_disallowed?(message); end + + # pkg:gem/activesupport#lib/active_support/deprecation/disallowed.rb:39 + def explicitly_allowed?(message); end +end + +# pkg:gem/activesupport#lib/active_support/deprecation/instance_delegator.rb:5 +module ActiveSupport::Deprecation::InstanceDelegator + mixes_in_class_methods ::ActiveSupport::Deprecation::InstanceDelegator::ClassMethods + mixes_in_class_methods ::ActiveSupport::Deprecation::InstanceDelegator::OverrideDelegators + + class << self + # pkg:gem/activesupport#lib/active_support/deprecation/instance_delegator.rb:6 + def included(base); end + end +end + +# pkg:gem/activesupport#lib/active_support/deprecation/instance_delegator.rb:11 +module ActiveSupport::Deprecation::InstanceDelegator::ClassMethods + # pkg:gem/activesupport#lib/active_support/deprecation/instance_delegator.rb:47 + def _instance; end + + # pkg:gem/activesupport#lib/active_support/deprecation/instance_delegator.rb:15 + def include(included_module); end + + # pkg:gem/activesupport#lib/active_support/deprecation/instance_delegator.rb:42 + def instance; end + + # pkg:gem/activesupport#lib/active_support/deprecation/instance_delegator.rb:20 + def method_added(method_name); end +end + +# pkg:gem/activesupport#lib/active_support/deprecation/instance_delegator.rb:12 +ActiveSupport::Deprecation::InstanceDelegator::ClassMethods::MUTEX = T.let(T.unsafe(nil), Thread::Mutex) + +# pkg:gem/activesupport#lib/active_support/deprecation/instance_delegator.rb:52 +module ActiveSupport::Deprecation::InstanceDelegator::OverrideDelegators + # pkg:gem/activesupport#lib/active_support/deprecation/instance_delegator.rb:58 + def deprecation_warning(deprecated_method_name, message = T.unsafe(nil), caller_backtrace = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/deprecation/instance_delegator.rb:53 + def warn(message = T.unsafe(nil), callstack = T.unsafe(nil)); end +end + +# pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/deprecation/method_wrappers.rb:35 + def deprecate_methods(target_module, *method_names); end +end + +# pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:89 + def allow(allowed_warnings = T.unsafe(nil), if: T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:48 + def begin_silence; end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:99 + def deprecation_warning(deprecated_method_name, message = T.unsafe(nil), caller_backtrace = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:52 + def end_silence; end + + # Name of gem where method is deprecated + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:11 + def gem_name; end + + # Name of gem where method is deprecated + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:41 + def silence(&block); end + + # Whether to print a message (silent mode) + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:56 + def silenced; end + + # Whether to print a message (silent mode) + # + # pkg:gem/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)" + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:18 + def warn(message = T.unsafe(nil), callstack = T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:153 + def _extract_callstack(callstack); end + + # 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)" + # + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:115 + def deprecated_method_warning(method_name, message = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:129 + def deprecation_caller_message(callstack); end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:124 + def deprecation_message(callstack, message = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:140 + def extract_callstack(callstack); end + + # pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:169 + def ignored_callstack?(path); end +end + +# pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:167 +ActiveSupport::Deprecation::Reporting::LIB_DIR = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/deprecation/reporting.rb:166 +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. +# +# pkg:gem/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. +# +# pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:15 +module ActiveSupport::DescendantsTracker + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:109 + def descendants; end + + class << self + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:79 + def clear(classes); end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:104 + def descendants(klass); end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:70 + def disable_clear!; end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:90 + def reject!(classes); end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:100 + def subclasses(klass); end + end +end + +# pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:59 +module ActiveSupport::DescendantsTracker::ReloadedClassesFiltering + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:64 + def descendants; end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:60 + def subclasses; end +end + +# On MRI `ObjectSpace::WeakMap` keys are weak references. +# So we can simply use WeakMap as a `Set`. +# 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. +# +# pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:21 +class ActiveSupport::DescendantsTracker::WeakSet < ::ObjectSpace::WeakMap + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:24 + def <<(object); end + + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:22 + def to_a; end +end + +# pkg:gem/activesupport#lib/active_support/digest.rb:6 +class ActiveSupport::Digest + class << self + # pkg:gem/activesupport#lib/active_support/digest.rb:8 + def hash_digest_class; end + + # pkg:gem/activesupport#lib/active_support/digest.rb:12 + def hash_digest_class=(klass); end + + # pkg:gem/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) +# +# pkg:gem/activesupport#lib/active_support/duration.rb:14 +class ActiveSupport::Duration + # pkg:gem/activesupport#lib/active_support/duration.rb:224 + 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. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:307 + def %(other); end + + # Multiplies this Duration by a Numeric and returns a new Duration. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:282 + def *(other); end + + # Adds another Duration or a Numeric to this Duration. Numeric values + # are treated as seconds. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:263 + def +(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:321 + def +@; end + + # Subtracts another Duration or a Numeric from this Duration. Numeric + # values are treated as seconds. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:277 + def -(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:317 + def -@; end + + # Divides this Duration by a Numeric and returns a new Duration. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:293 + def /(other); end + + # Compares one Duration with another or a Numeric to this Duration. + # Numeric values are treated as seconds. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:253 + def <=>(other); end + + # Returns +true+ if +other+ is also a Duration instance with the + # same +value+, or if other == value. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:336 + def ==(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:476 + def _parts; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:435 + def after(time = T.unsafe(nil)); end + + # Calculates a new Time or Date that is as far in the past + # as this Duration represents. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:439 + def ago(time = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:454 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:443 + def before(time = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:240 + def coerce(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:462 + def encode_with(coder); end + + # Returns +true+ if +other+ is also a Duration instance, which has the + # same parts as this one. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:421 + def eql?(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:434 + def from_now(time = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:425 + def hash; end + + # Returns the amount of days a duration covers as a float + # + # 12.hours.in_days # => 0.5 + # + # pkg:gem/activesupport#lib/active_support/duration.rb:394 + def in_days; end + + # Returns the amount of hours a duration covers as a float + # + # 1.day.in_hours # => 24.0 + # + # pkg:gem/activesupport#lib/active_support/duration.rb:387 + def in_hours; end + + # Returns the amount of minutes a duration covers as a float + # + # 1.day.in_minutes # => 1440.0 + # + # pkg:gem/activesupport#lib/active_support/duration.rb:380 + def in_minutes; end + + # Returns the amount of months a duration covers as a float + # + # 9.weeks.in_months # => 2.07 + # + # pkg:gem/activesupport#lib/active_support/duration.rb:408 + def in_months; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:375 + def in_seconds; end + + # Returns the amount of weeks a duration covers as a float + # + # 2.months.in_weeks # => 8.696 + # + # pkg:gem/activesupport#lib/active_support/duration.rb:401 + def in_weeks; end + + # Returns the amount of years a duration covers as a float + # + # 30.days.in_years # => 0.082 + # + # pkg:gem/activesupport#lib/active_support/duration.rb:415 + def in_years; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:458 + def init_with(coder); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:445 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:330 + def instance_of?(klass); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:325 + 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. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:468 + def iso8601(precision: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:328 + def kind_of?(klass); end + + # Returns a copy of the parts hash that defines the duration + # + # pkg:gem/activesupport#lib/active_support/duration.rb:236 + def parts; end + + # Calculates a new Time or Date that is as far in the future + # as this Duration represents. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:431 + def since(time = T.unsafe(nil)); 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://ruby-doc.org/stdlib/libdoc/date/rdoc/Date.html] and + # Time[https://ruby-doc.org/stdlib/libdoc/time/rdoc/Time.html] should be used for precision + # date and time arithmetic. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:372 + 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" + # + # pkg:gem/activesupport#lib/active_support/duration.rb:348 + def to_s; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:442 + def until(time = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:133 + def value; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:472 + def variable?; end + + private + + # pkg:gem/activesupport#lib/active_support/duration.rb:507 + def method_missing(method, *args, &block); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:511 + def raise_type_error(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:503 + def respond_to_missing?(method, _); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:481 + def sum(sign, time = T.unsafe(nil)); end + + class << self + # pkg:gem/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} + # + # pkg:gem/activesupport#lib/active_support/duration.rb:189 + def build(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:167 + def days(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:163 + def hours(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:159 + def minutes(value); end + + # pkg:gem/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+. + # + # pkg:gem/activesupport#lib/active_support/duration.rb:144 + def parse(iso8601duration); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:155 + def seconds(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:171 + def weeks(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:179 + def years(value); end + + private + + # pkg:gem/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. +# +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:12 +class ActiveSupport::Duration::ISO8601Parser + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:34 + def initialize(string); end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:32 + def mode; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:32 + def mode=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:41 + def parse!; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:31 + def parts; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:31 + def scanner; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:32 + def sign; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:32 + def sign=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:83 + def finished?; end + + # Parses number which can be a float with either comma or period. + # + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:88 + def number; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:96 + def raise_parsing_error(reason = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:92 + def scan(pattern); end + + # Checks for various semantic errors as stated in ISO 8601 standard. + # + # pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:101 + def validate!; end +end + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:17 +ActiveSupport::Duration::ISO8601Parser::COMMA = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:22 +ActiveSupport::Duration::ISO8601Parser::DATE_COMPONENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:28 +ActiveSupport::Duration::ISO8601Parser::DATE_COMPONENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:20 +ActiveSupport::Duration::ISO8601Parser::DATE_MARKER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:25 +ActiveSupport::Duration::ISO8601Parser::DATE_TO_PART = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:16 +ActiveSupport::Duration::ISO8601Parser::PERIOD = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:15 +ActiveSupport::Duration::ISO8601Parser::PERIOD_OR_COMMA = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:13 +class ActiveSupport::Duration::ISO8601Parser::ParsingError < ::ArgumentError; end + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:19 +ActiveSupport::Duration::ISO8601Parser::SIGN_MARKER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:23 +ActiveSupport::Duration::ISO8601Parser::TIME_COMPONENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:29 +ActiveSupport::Duration::ISO8601Parser::TIME_COMPONENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_parser.rb:21 +ActiveSupport::Duration::ISO8601Parser::TIME_MARKER = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/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. +# +# pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:6 +class ActiveSupport::Duration::ISO8601Serializer + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:9 + def initialize(duration, precision: T.unsafe(nil)); end + + # Builds and returns output string. + # + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:15 + def serialize; end + + private + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:56 + 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. + # If all parts are negative it will negate all of them and return minus as a sign. + # + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:39 + def normalize; end + + # pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:52 + def week_mixed_with_date?(parts); end +end + +# pkg:gem/activesupport#lib/active_support/duration/iso8601_serializer.rb:7 +ActiveSupport::Duration::ISO8601Serializer::DATE_COMPONENTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/duration.rb:130 +ActiveSupport::Duration::PARTS = T.let(T.unsafe(nil), Array) + +# length of a gregorian year (365.2425 days) +# +# pkg:gem/activesupport#lib/active_support/duration.rb:120 +ActiveSupport::Duration::PARTS_IN_SECONDS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/duration.rb:115 +ActiveSupport::Duration::SECONDS_PER_DAY = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/duration.rb:114 +ActiveSupport::Duration::SECONDS_PER_HOUR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/duration.rb:113 +ActiveSupport::Duration::SECONDS_PER_MINUTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/duration.rb:117 +ActiveSupport::Duration::SECONDS_PER_MONTH = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/duration.rb:116 +ActiveSupport::Duration::SECONDS_PER_WEEK = T.let(T.unsafe(nil), Integer) + +# 1/12 of a gregorian year +# +# pkg:gem/activesupport#lib/active_support/duration.rb:118 +ActiveSupport::Duration::SECONDS_PER_YEAR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/duration.rb:15 +class ActiveSupport::Duration::Scalar < ::Numeric + # pkg:gem/activesupport#lib/active_support/duration.rb:19 + def initialize(value); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:85 + def %(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:66 + def *(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:41 + def +(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:53 + def -(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:27 + def -@; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:77 + def /(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:31 + def <=>(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:23 + def coerce(other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:17 + def to_f(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:17 + def to_i(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:17 + def to_s(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:16 + def value; end + + # pkg:gem/activesupport#lib/active_support/duration.rb:93 + def variable?; end + + private + + # pkg:gem/activesupport#lib/active_support/duration.rb:98 + def calculate(op, other); end + + # pkg:gem/activesupport#lib/active_support/duration.rb:108 + def raise_type_error(other); end +end + +# pkg:gem/activesupport#lib/active_support/duration.rb:131 +ActiveSupport::Duration::VARIABLE_PARTS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/core_ext/range/each.rb:6 +module ActiveSupport::EachTimeWithZone + # pkg:gem/activesupport#lib/active_support/core_ext/range/each.rb:7 + def each(&block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/range/each.rb:12 + def step(n = T.unsafe(nil), &block); end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/range/each.rb:18 + def ensure_iteration_allowed; 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 +# +# pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:35 +class ActiveSupport::EncryptedConfiguration < ::ActiveSupport::EncryptedFile + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:48 + 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 } } + # + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:75 + def config; end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:79 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:46 + def method_missing(method, *args, **, &block); end + + # Reads the file and returns the decrypted content. See EncryptedFile#read. + # + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:56 + def read; end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:63 + def validate!; end + + private + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:84 + def deep_transform(hash); end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:98 + def deserialize(content); end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:94 + def options; end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:46 + def respond_to_missing?(name, include_private = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:36 +class ActiveSupport::EncryptedConfiguration::InvalidContentError < ::RuntimeError + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:37 + def initialize(content_path); end + + # pkg:gem/activesupport#lib/active_support/encrypted_configuration.rb:41 + def message; end +end + +# pkg:gem/activesupport#lib/active_support/encrypted_file.rb:8 +class ActiveSupport::EncryptedFile + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:42 + def initialize(content_path:, key_path:, env_key:, raise_if_missing_key:); end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:83 + def change(&block); end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:40 + def content_path; end + + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:58 + def key?; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:40 + def key_path; end + + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:70 + def read; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:78 + def write(contents); end + + private + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:129 + def check_key_length; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:108 + def decrypt(contents); end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:103 + def encrypt(contents); end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:112 + def encryptor; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:125 + def handle_missing_key; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:117 + def read_env_key; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:121 + def read_key_file; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:89 + def writing(contents); end + + class << self + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:35 + def expected_key_length; end + + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:31 + def generate_key; end + end +end + +# pkg:gem/activesupport#lib/active_support/encrypted_file.rb:29 +ActiveSupport::EncryptedFile::CIPHER = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/encrypted_file.rb:23 +class ActiveSupport::EncryptedFile::InvalidKeyLengthError < ::RuntimeError + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:24 + def initialize; end +end + +# pkg:gem/activesupport#lib/active_support/encrypted_file.rb:9 +class ActiveSupport::EncryptedFile::MissingContentError < ::RuntimeError + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:10 + def initialize(content_path); end +end + +# pkg:gem/activesupport#lib/active_support/encrypted_file.rb:15 +class ActiveSupport::EncryptedFile::MissingKeyError < ::RuntimeError + # pkg:gem/activesupport#lib/active_support/encrypted_file.rb:16 + def initialize(key_path:, env_key:); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:4 +module ActiveSupport::EnumerableCoreExt; end + +# pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:5 +module ActiveSupport::EnumerableCoreExt::Constants + private + + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:7 + def const_missing(name); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:25 +ActiveSupport::EnumerableCoreExt::SoleItemExpectedError = Enumerable::SoleItemExpectedError + +# pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:9 +class ActiveSupport::EnvironmentInquirer < ::ActiveSupport::StringInquirer + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:15 + def initialize(env); end + + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:28 + def development?; end + + # Returns true if we're in the development or test environment. + # + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:36 + def local?; end + + # pkg:gem/activesupport#lib/active_support/environment_inquirer.rb:28 + def production?; end + + # pkg:gem/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. +# +# pkg:gem/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? +# +# pkg:gem/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") } +# +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:26 +class ActiveSupport::ErrorReporter + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:32 + def initialize(*subscribers, logger: T.unsafe(nil)); 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. + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:147 + 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". + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:74 + def handle(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), fallback: T.unsafe(nil), source: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:30 + def logger; end + + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:30 + 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". + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:110 + 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) + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:172 + 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) + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:163 + def set_context(*, **, &); 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. + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:123 + def subscribe(subscriber); 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) + # + # pkg:gem/activesupport#lib/active_support/error_reporter.rb:138 + def unsubscribe(subscriber); end +end + +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:28 +ActiveSupport::ErrorReporter::DEFAULT_SOURCE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/error_reporter.rb:27 +ActiveSupport::ErrorReporter::SEVERITIES = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/execution_context.rb:4 +module ActiveSupport::ExecutionContext + class << self + # pkg:gem/activesupport#lib/active_support/execution_context.rb:34 + def []=(key, value); end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:7 + def after_change(&block); end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:43 + def clear; end + + # Updates the execution context. If a block is given, it resets the provided keys to their + # previous value once the block exits. + # + # pkg:gem/activesupport#lib/active_support/execution_context.rb:13 + def set(**options); end + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:39 + def to_h; end + + private + + # pkg:gem/activesupport#lib/active_support/execution_context.rb:48 + def store; end + end +end + +# pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:8 +class ActiveSupport::ExecutionWrapper + include ::ActiveSupport::Callbacks + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:9 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:9 + def __callbacks?; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:16 + def _complete_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _run_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:16 + def _run_complete_callbacks(&block); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _run_run_callbacks(&block); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:142 + 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+. + # + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:136 + def complete!; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:128 + def run; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:123 + def run!; end + + private + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:147 + def hook_state; end + + class << self + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:9 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:9 + def __callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:9 + def __callbacks?; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:16 + def _complete_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:16 + def _complete_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _run_callbacks; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:15 + def _run_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:119 + def active?; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:115 + def active_key; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:111 + def error_reporter; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:101 + 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.) + # + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:51 + 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+. + # + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:67 + def run!(reset: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:22 + def to_complete(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:18 + def to_run(*args, &block); end + + # Perform the work in the supplied block as an execution. + # + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:87 + def wrap(source: T.unsafe(nil)); end + end +end + +# pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:33 +class ActiveSupport::ExecutionWrapper::CompleteHook < ::Struct + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:40 + def after(target); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:34 + def before(target); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:33 + def hook; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:33 + def hook=(_); end + + class << self + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:33 + def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:33 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:33 + def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:33 + def members; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:33 + def new(*_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:11 +ActiveSupport::ExecutionWrapper::Null = T.let(T.unsafe(nil), Object) + +# pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:26 +class ActiveSupport::ExecutionWrapper::RunHook < ::Struct + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:27 + def before(target); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:26 + def hook; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:26 + def hook=(_); end + + class << self + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:26 + def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:26 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:26 + def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:26 + def members; end + + # pkg:gem/activesupport#lib/active_support/execution_wrapper.rb:26 + def new(*_arg0); end + end +end + +# pkg:gem/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 +# +# pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:82 + def execute; end + + # Execute the block given if updated. + # + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:92 + 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+. + # + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:63 + def updated?; end + + private + + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:158 + def compile_ext(array); end + + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:144 + def compile_glob(hash); end + + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:154 + 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. + # + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:122 + def max_mtime(paths); end + + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:111 + def updated_at(paths); end + + # pkg:gem/activesupport#lib/active_support/file_update_checker.rb:103 + def watched; end +end + +# pkg:gem/activesupport#lib/active_support/fork_tracker.rb:4 +module ActiveSupport::ForkTracker + class << self + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:67 + def after_fork(&block); end + + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:40 + def after_fork_callback; end + + # Ruby 3.1+ + # + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:49 + def check!; end + + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:56 + def hook!; end + + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:72 + def unregister(callback); end + end +end + +# pkg:gem/activesupport#lib/active_support/fork_tracker.rb:15 +module ActiveSupport::ForkTracker::CoreExt + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:16 + def fork(*, **, &); end +end + +# pkg:gem/activesupport#lib/active_support/fork_tracker.rb:31 +module ActiveSupport::ForkTracker::CoreExtPrivate + include ::ActiveSupport::ForkTracker::CoreExt + + private + + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:33 + def fork(*, **, &); end +end + +# pkg:gem/activesupport#lib/active_support/fork_tracker.rb:5 +module ActiveSupport::ForkTracker::ModernCoreExt + # pkg:gem/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!" +# +# pkg:gem/activesupport#lib/active_support/gzip.rb:17 +module ActiveSupport::Gzip + class << self + # Compresses a string using gzip. + # + # pkg:gem/activesupport#lib/active_support/gzip.rb:32 + def compress(source, level = T.unsafe(nil), strategy = T.unsafe(nil)); end + + # Decompresses a gzipped string. + # + # pkg:gem/activesupport#lib/active_support/gzip.rb:27 + def decompress(source); end + end +end + +# pkg:gem/activesupport#lib/active_support/gzip.rb:18 +class ActiveSupport::Gzip::Stream < ::StringIO + # pkg:gem/activesupport#lib/active_support/gzip.rb:19 + def initialize(*); end + + # pkg:gem/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. +# +# pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:55 +class ActiveSupport::HashWithIndifferentAccess < ::Hash + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:168 + 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'. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:98 + 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 + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:181 + def assoc(key); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:375 + def compact; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:319 + def deep_stringify_keys; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:317 + def deep_stringify_keys!; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:324 + 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' + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:223 + def default(key = T.unsafe(nil)); end + + # Removes the specified key from the hash. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:303 + 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 + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:208 + 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" + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:264 + 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 + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:311 + def except(*keys); end + + # Returns +true+ so that Array#extract_options! finds members of + # this class. + # + # pkg:gem/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" + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:195 + 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" + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:251 + def fetch_values(*indices, &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:156 + def has_key?(key); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:155 + 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 + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:151 + def key?(key); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:157 + 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. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:273 + def merge(*hashes, &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:143 + def merge!(*other_hashes, &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:66 + def nested_under_indifferent_access; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:90 + def regular_update(*_arg0); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:89 + def regular_writer(_arg0, _arg1); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:332 + 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} + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:298 + 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} + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:283 + def reverse_merge(other_hash); end + + # Same semantics as +reverse_merge+ but modifies the receiver in-place. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:289 + def reverse_merge!(other_hash); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:327 + def select(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:365 + def slice(*keys); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:370 + def slice!(*keys); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:102 + def store(key, value); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:318 + def stringify_keys; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:316 + def stringify_keys!; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:322 + def symbolize_keys; end + + # Convert to a regular hash with string keys. + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:380 + def to_hash; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:323 + def to_options; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:325 + def to_options!; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:344 + def transform_keys(hash = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:349 + def transform_keys!(hash = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:337 + 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} + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:132 + 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"] + # + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:237 + def values_at(*keys); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:286 + def with_defaults(other_hash); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:292 + def with_defaults!(other_hash); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:62 + def with_indifferent_access; end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:314 + def without(*keys); end + + private + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:392 + def convert_key(key); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:401 + def convert_value(value, conversion: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:418 + def set_defaults(target); end + + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:426 + def update_with_single_argument(other_hash, block); end + + class << self + # pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:85 + def [](*args); end + end +end + +# pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:342 +ActiveSupport::HashWithIndifferentAccess::NOT_GIVEN = T.let(T.unsafe(nil), Object) + +# pkg:gem/activesupport#lib/active_support/html_safe_translation.rb:4 +module ActiveSupport::HtmlSafeTranslation + extend ::ActiveSupport::HtmlSafeTranslation + + # pkg:gem/activesupport#lib/active_support/html_safe_translation.rb:7 + def translate(key, **options); end + + private + + # pkg:gem/activesupport#lib/active_support/html_safe_translation.rb:32 + def html_escape_translation_options(options); end + + # pkg:gem/activesupport#lib/active_support/html_safe_translation.rb:45 + def html_safe_translation(translation); end + + # pkg:gem/activesupport#lib/active_support/html_safe_translation.rb:28 + def html_safe_translation_key?(key); end + + # pkg:gem/activesupport#lib/active_support/html_safe_translation.rb:40 + 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). +# +# pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:7 +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" + # + # pkg:gem/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" + # + # pkg:gem/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. + # + # pkg:gem/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" + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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('') # => "" + # + # pkg:gem/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" + # + # pkg:gem/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" + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:265 + 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" + # + # pkg:gem/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" + # + # pkg:gem/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. + # + # pkg:gem/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" + # + # pkg:gem/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 + # + # pkg:gem/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" + # + # pkg:gem/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" + # + # pkg:gem/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" + # + # pkg:gem/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. + # + # pkg:gem/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" + # + # pkg:gem/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('') # => "" + # + # pkg:gem/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" + # + # pkg:gem/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("::") # => "::" + # + # pkg:gem/activesupport#lib/active_support/inflector/methods.rb:357 + def const_regexp(camel_cased_word); end +end + +# pkg:gem/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. +# +# pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:30 +class ActiveSupport::Inflector::Inflections + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:80 + 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' + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:142 + def acronym(word); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:76 + def acronyms; end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:78 + def acronyms_camelize_regex; end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:78 + 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 + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:231 + 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' + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:220 + def human(rule, replacement); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:76 + 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' + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:174 + 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. + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:151 + def plural(rule, replacement); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:76 + 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. + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:161 + def singular(rule, replacement); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:76 + def singulars; end + + # Specifies words that are uncountable and should not be inflected. + # + # uncountable 'money' + # uncountable 'money', 'information' + # uncountable %w( money information rice ) + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:208 + def uncountable(*words); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:76 + def uncountables; end + + private + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:250 + def define_acronym_regex_patterns; end + + # Private, for the test suite. + # + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:86 + def initialize_dup(orig); end + + class << self + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:65 + def instance(locale = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:69 + def instance_or_fallback(locale); end + end +end + +# pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:33 +class ActiveSupport::Inflector::Inflections::Uncountables < ::Array + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:34 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:44 + def <<(*word); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:48 + def add(words); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:39 + def delete(entry); end + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:55 + def uncountable?(str); end + + private + + # pkg:gem/activesupport#lib/active_support/inflector/inflections.rb:60 + def to_regex(string); 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' +# +# pkg:gem/activesupport#lib/active_support/ordered_options.rb:93 +class ActiveSupport::InheritableOptions < ::ActiveSupport::OrderedOptions + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:94 + def initialize(parent = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:105 + def inheritable_copy; end +end + +# pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:6 +module ActiveSupport::IsolatedExecutionState + class << self + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:37 + def [](key); end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:41 + def []=(key, value); end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:53 + def clear; end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:57 + def context; end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:49 + def delete(key); end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:13 + def isolation_level; end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:15 + def isolation_level=(level); end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:45 + def key?(key); end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:13 + def scope; end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:61 + def share_with(other); end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:33 + def unique_id; end + + private + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:69 + def state; end + end +end + +# pkg:gem/activesupport#lib/active_support/json/decoding.rb:11 +module ActiveSupport::JSON + class << self + # Parses a JSON string (JavaScript Object Notation) into a hash. + # See http://www.json.org for more info. + # + # ActiveSupport::JSON.decode("{\"team\":\"rails\",\"players\":\"36\"}") + # => {"team" => "rails", "players" => "36"} + # + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:22 + def decode(json); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:25 + def dump(value, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:22 + def encode(value, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:31 + def load(json); 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 + # + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:43 + def parse_error; end + + private + + # pkg:gem/activesupport#lib/active_support/json/decoding.rb:48 + def convert_dates_from(data); end + end +end + +# pkg:gem/activesupport#lib/active_support/json/decoding.rb:14 +ActiveSupport::JSON::DATETIME_REGEX = T.let(T.unsafe(nil), Regexp) + +# matches YAML-formatted dates +# +# pkg:gem/activesupport#lib/active_support/json/decoding.rb:13 +ActiveSupport::JSON::DATE_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:28 +module ActiveSupport::JSON::Encoding + class << self + # If true, encode >, <, & as escaped unicode sequences (e.g. > as \u003e) + # as a safety measure. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:103 + def escape_html_entities_in_json; end + + # If true, encode >, <, & as escaped unicode sequences (e.g. > as \u003e) + # as a safety measure. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:103 + def escape_html_entities_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+. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:111 + def json_encoder; end + + # Sets the encoder used by \Rails to encode Ruby objects into JSON strings + # in +Object#to_json+ and +ActiveSupport::JSON.encode+. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:111 + def json_encoder=(_arg0); end + + # Sets the precision of encoded time values. + # Defaults to 3 (equivalent to millisecond precision) + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:107 + def time_precision; end + + # Sets the precision of encoded time values. + # Defaults to 3 (equivalent to millisecond precision) + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:107 + def time_precision=(_arg0); end + + # If true, use ISO 8601 format for dates and times. Otherwise, fall back + # to the Active Support legacy format. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:99 + 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. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:99 + def use_standard_json_time_format=(_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/json/encoding.rb:29 +class ActiveSupport::JSON::Encoding::JSONGemEncoder + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:32 + def initialize(options = T.unsafe(nil)); end + + # Encode the given object into a JSON string + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:37 + def encode(value); end + + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:30 + 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. + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:70 + def jsonify(value); end + + # Encode a "jsonified" Ruby data structure using the JSON gem + # + # pkg:gem/activesupport#lib/active_support/json/encoding.rb:91 + def stringify(jsonified); end +end + +# = 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. +# +# pkg:gem/activesupport#lib/active_support/key_generator.rb:13 +class ActiveSupport::KeyGenerator + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/key_generator.rb:41 + def generate_key(salt, key_size = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/key_generator.rb:45 + def inspect; end + + class << self + # pkg:gem/activesupport#lib/active_support/key_generator.rb:23 + def hash_digest_class; end + + # pkg:gem/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 +# +# pkg:gem/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. + # + # pkg:gem/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+. + # + # pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:75 + def run_load_hooks(name, base = T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:91 + def execute_hook(name, base, options, block); end + + # pkg:gem/activesupport#lib/active_support/lazy_load_hooks.rb:83 + def with_execution_control(name, block, once); end + + class << self + # pkg:gem/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. +# +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:63 +class ActiveSupport::LogSubscriber < ::ActiveSupport::Subscriber + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:136 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:149 + def call(event); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:86 + def colorize_logging; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:86 + def colorize_logging=(val); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:166 + def debug(progname = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:166 + def error(progname = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:161 + def event_levels=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:166 + def fatal(progname = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:166 + def info(progname = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:141 + def logger; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:155 + def publish_event(event); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:145 + def silenced?(event); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:166 + def unknown(progname = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:166 + 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. + # + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:175 + def color(text, color, mode_options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:197 + def log_exception(name, e); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:183 + def mode_from(options); end + + class << self + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:102 + def attach_to(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:86 + def colorize_logging; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:86 + def colorize_logging=(val); end + + # Flush all log_subscribers' logger. + # + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:115 + def flush_all!; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:87 + def log_levels; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:87 + def log_levels=(value); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:87 + def log_levels?; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:110 + def log_subscribers; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:96 + def logger; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:108 + def logger=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:120 + def fetch_public_methods(subscriber, inherit_all); end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:124 + def set_event_levels; end + + # pkg:gem/activesupport#lib/active_support/log_subscriber.rb:130 + def subscribe_log_level(method, level); end + end +end + +# ANSI sequence colors +# +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:77 +ActiveSupport::LogSubscriber::BLACK = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:81 +ActiveSupport::LogSubscriber::BLUE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:66 +ActiveSupport::LogSubscriber::BOLD = T.let(T.unsafe(nil), ActiveSupport::Deprecation::DeprecatedObjectProxy) + +# Embed in a String to clear all previous ANSI sequences. +# +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:65 +ActiveSupport::LogSubscriber::CLEAR = T.let(T.unsafe(nil), ActiveSupport::Deprecation::DeprecatedObjectProxy) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:83 +ActiveSupport::LogSubscriber::CYAN = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:79 +ActiveSupport::LogSubscriber::GREEN = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:89 +ActiveSupport::LogSubscriber::LEVEL_CHECKS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:82 +ActiveSupport::LogSubscriber::MAGENTA = T.let(T.unsafe(nil), String) + +# ANSI sequence modes +# +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:69 +ActiveSupport::LogSubscriber::MODES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:78 +ActiveSupport::LogSubscriber::RED = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:84 +ActiveSupport::LogSubscriber::WHITE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/log_subscriber.rb:80 +ActiveSupport::LogSubscriber::YELLOW = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/logger.rb:8 +class ActiveSupport::Logger < ::Logger + include ::ActiveSupport::LoggerSilence + include ::ActiveSupport::LoggerThreadSafeLevel + + # pkg:gem/activesupport#lib/active_support/logger.rb:29 + def initialize(*args, **kwargs); end + + # pkg:gem/activesupport#lib/active_support/logger.rb:9 + def silencer; end + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/logger.rb:16 + def logger_outputs_to?(logger, *sources); end + + # pkg:gem/activesupport#lib/active_support/logger.rb:9 + def silencer; end + + # pkg:gem/activesupport#lib/active_support/logger.rb:9 + def silencer=(val); end + end +end + +# Simple formatter which only displays the message. +# +# pkg:gem/activesupport#lib/active_support/logger.rb:35 +class ActiveSupport::Logger::SimpleFormatter < ::Logger::Formatter + # This method is invoked when a log event occurs + # + # pkg:gem/activesupport#lib/active_support/logger.rb:37 + def call(severity, timestamp, progname, msg); end +end + +# pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/logger_silence.rb:17 + def silence(severity = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:7 +module ActiveSupport::LoggerThreadSafeLevel + extend ::ActiveSupport::Concern + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:11 + def debug?; end + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:11 + def error?; end + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:11 + def fatal?; end + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:11 + def info?; end + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:38 + def level; end + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:18 + def local_level; end + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:22 + def local_level=(level); end + + # Change the thread-local level for the duration of the given block. + # + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:43 + def log_at(level); end + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:11 + def unknown?; end + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:11 + def warn?; end + + private + + # pkg:gem/activesupport#lib/active_support/logger_thread_safe_level.rb:51 + 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" +# +# pkg:gem/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+. + # + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:183 + def initialize(*args, on_rotation: T.unsafe(nil), **options); end + + # pkg:gem/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 + # + # pkg:gem/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.) + # + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:220 + def encrypt_and_sign(value, **options); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:264 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:260 + def read_message(message, on_rotation: T.unsafe(nil), **options); end + + private + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:371 + def aead_mode; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:372 + def aead_mode?; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:295 + def decrypt(encrypted_message); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:277 + def encrypt(data); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:340 + def extract_part(encrypted_message, rindex, length); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:350 + def extract_parts(encrypted_message); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:336 + def join_parts(parts); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:320 + def length_after_encode(length_before_encode); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:332 + def length_of_encoded_auth_tag; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:328 + def length_of_encoded_iv; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:367 + def new_cipher; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:269 + def sign(data); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:273 + def verify(data); end + + class << self + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:252 + def key_len(cipher = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:93 + def use_authenticated_message_encryption; end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:93 + def use_authenticated_message_encryption=(val); end + end +end + +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:118 +ActiveSupport::MessageEncryptor::AUTH_TAG_LENGTH = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:115 +class ActiveSupport::MessageEncryptor::InvalidMessage < ::StandardError; end + +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:105 +module ActiveSupport::MessageEncryptor::NullSerializer + class << self + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:110 + def dump(value); end + + # pkg:gem/activesupport#lib/active_support/message_encryptor.rb:106 + def load(value); end + end +end + +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:116 +ActiveSupport::MessageEncryptor::OpenSSLCipherError = OpenSSL::Cipher::CipherError + +# pkg:gem/activesupport#lib/active_support/message_encryptor.rb:119 +ActiveSupport::MessageEncryptor::SEPARATOR = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/message_encryptors.rb:6 +class ActiveSupport::MessageEncryptors < ::ActiveSupport::Messages::RotationCoordinator + private + + # pkg:gem/activesupport#lib/active_support/message_encryptors.rb:135 + 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 +# +# === 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) +# +# pkg:gem/activesupport#lib/active_support/message_verifier.rb:98 +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+. + # + # [+: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+. + # + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:153 + def initialize(*args, on_rotation: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:296 + 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.) + # + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:292 + def generate(value, **options); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:304 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:300 + 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 + # + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:169 + 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 + # + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:210 + 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 + # + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:248 + def verify(message, **options); end + + private + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:335 + def digest_length_in_hex; end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:352 + def digest_matches_data?(digest, data); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:314 + def extract_encoded(signed); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:331 + def generate_digest(data); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:343 + def separator_at?(signed_message, index); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:347 + def separator_index_for(signed_message); end + + # pkg:gem/activesupport#lib/active_support/message_verifier.rb:309 + def sign_encoded(encoded); end +end + +# pkg:gem/activesupport#lib/active_support/message_verifier.rb:101 +class ActiveSupport::MessageVerifier::InvalidSignature < ::StandardError; end + +# pkg:gem/activesupport#lib/active_support/message_verifier.rb:103 +ActiveSupport::MessageVerifier::SEPARATOR = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/message_verifier.rb:104 +ActiveSupport::MessageVerifier::SEPARATOR_LENGTH = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/message_verifiers.rb:6 +class ActiveSupport::MessageVerifiers < ::ActiveSupport::Messages::RotationCoordinator + private + + # pkg:gem/activesupport#lib/active_support/message_verifiers.rb:131 + def build(salt, secret_generator:, secret_generator_options:, **options); end +end + +# pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:6 +module ActiveSupport::Messages; end + +# pkg:gem/activesupport#lib/active_support/messages/codec.rb:9 +class ActiveSupport::Messages::Codec + include ::ActiveSupport::Messages::Metadata + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:15 + def initialize(**options); end + + private + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:45 + def catch_and_ignore(throwable, &block); end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:52 + def catch_and_raise(throwable, as: T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:29 + def decode(encoded, url_safe: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:39 + def deserialize(serialized); end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:25 + def encode(data, url_safe: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:35 + def serialize(data); end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:23 + def serializer; end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:60 + def use_message_serializer_for_metadata?; end + + class << self + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:12 + def default_serializer; end + + # pkg:gem/activesupport#lib/active_support/messages/codec.rb:12 + def default_serializer=(value); end + end +end + +# pkg:gem/activesupport#lib/active_support/messages/metadata.rb:9 +module ActiveSupport::Messages::Metadata + private + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:128 + def deserialize_from_json(serialized); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:141 + def deserialize_from_json_safe_string(string); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:43 + def deserialize_with_metadata(message, **expected_metadata); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:96 + def dual_serialized_metadata_envelope_json?(string); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:78 + def extract_from_metadata_envelope(envelope, purpose: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:92 + def metadata_envelope?(object); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:114 + def parse_expiry(expires_at); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:100 + def pick_expiry(expires_at, expires_in); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:124 + def serialize_to_json(data); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:137 + def serialize_to_json_safe_string(data); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:30 + def serialize_with_metadata(data, **metadata); end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:60 + def use_message_serializer_for_metadata?; end + + # pkg:gem/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 + + # pkg:gem/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 + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:10 + def use_message_serializer_for_metadata; end + + # pkg:gem/activesupport#lib/active_support/messages/metadata.rb:10 + def use_message_serializer_for_metadata=(_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/messages/metadata.rb:12 +ActiveSupport::Messages::Metadata::ENVELOPE_SERIALIZERS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/messages/metadata.rb:19 +ActiveSupport::Messages::Metadata::TIMESTAMP_SERIALIZERS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/messages/rotation_configuration.rb:5 +class ActiveSupport::Messages::RotationConfiguration + # pkg:gem/activesupport#lib/active_support/messages/rotation_configuration.rb:8 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_configuration.rb:6 + def encrypted; end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_configuration.rb:12 + def rotate(kind, *args, **options); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_configuration.rb:6 + def signed; end +end + +# pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:7 +class ActiveSupport::Messages::RotationCoordinator + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:10 + def initialize(&secret_generator); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:18 + def [](salt); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:22 + def []=(salt, codec); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:39 + def clear_rotations; end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:45 + def on_rotation(&callback); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:26 + def rotate(**options, &block); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:35 + def rotate_defaults; end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:8 + def transitional; end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:8 + def transitional=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:88 + def build(salt, secret_generator:, secret_generator_options:, **options); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:76 + def build_with_rotations(salt); end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:51 + def changing_configuration!; end + + # pkg:gem/activesupport#lib/active_support/messages/rotation_coordinator.rb:62 + def normalize_options(options); end +end + +# pkg:gem/activesupport#lib/active_support/messages/rotator.rb:5 +module ActiveSupport::Messages::Rotator + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:6 + def initialize(*args, on_rotation: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:18 + def fall_back_to(fallback); end + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:23 + def read_message(message, on_rotation: T.unsafe(nil), **options); end + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:14 + def rotate(*args, **options); end + + private + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:44 + def build_rotation(*args, **options); end + + # pkg:gem/activesupport#lib/active_support/messages/rotator.rb:48 + def catch_rotation_error(&block); end +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:8 +module ActiveSupport::Messages::SerializerWithFallback + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:17 + def load(dumped); end + + private + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:33 + def detect_format(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:44 + def fallback?(format); end + + class << self + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:9 + def [](format); end + end +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:48 +module ActiveSupport::Messages::SerializerWithFallback::AllowMarshal + private + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:50 + def fallback?(format); end +end + +# pkg:gem/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 + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:90 + def _load(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:86 + def dump(object); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:96 + def dumped?(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:82 + def format; end + + private + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:101 + def detect_format(dumped); end +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:94 +ActiveSupport::Messages::SerializerWithFallback::JsonWithFallback::JSON_START_WITH = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/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 + +# pkg:gem/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 + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:67 + def _load(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:63 + def dump(object); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:73 + def dumped?(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:59 + def format; end +end + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:71 +ActiveSupport::Messages::SerializerWithFallback::MarshalWithFallback::MARSHAL_SIGNATURE = T.let(T.unsafe(nil), String) + +# pkg:gem/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 + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:125 + def _load(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:121 + def dump(object); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:129 + def dumped?(dumped); end + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:117 + def format; end + + private + + # pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:134 + def available?; end +end + +# pkg:gem/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 + +# pkg:gem/activesupport#lib/active_support/messages/serializer_with_fallback.rb:149 +ActiveSupport::Messages::SerializerWithFallback::SERIALIZERS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/multibyte.rb:4 +module ActiveSupport::Multibyte + class << self + # Returns the current proxy class. + # + # pkg:gem/activesupport#lib/active_support/multibyte.rb:19 + 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 + # + # pkg:gem/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 +# +# pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:47 +class ActiveSupport::Multibyte::Chars + include ::Comparable + + # Creates a new Chars instance by wrapping _string_. + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:56 + def initialize(string); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:53 + def <=>(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:53 + def =~(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:53 + def acts_like_string?(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:161 + def as_json(options = T.unsafe(nil)); end + + # Performs composition on all the characters. + # + # 'é'.length # => 1 + # 'é'.mb_chars.compose.to_s.length # => 1 + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:140 + def compose; end + + # Performs canonical decomposition on all the characters. + # + # 'é'.length # => 1 + # 'é'.mb_chars.decompose.to_s.length # => 2 + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:132 + def decompose; end + + # Returns the number of grapheme clusters in the string. + # + # 'क्षि'.mb_chars.length # => 4 + # 'क्षि'.mb_chars.grapheme_length # => 2 + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:148 + 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 # => "こん" + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:115 + def limit(limit); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:53 + def match?(*, **, &); end + + # Forward all undefined methods to the wrapped string. + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:62 + def method_missing(method, *args, &block); end + + # Reverses all characters in the string. + # + # 'Café'.mb_chars.reverse.to_s # => 'éfaC' + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:106 + def reverse; end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:166 + 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' + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:96 + 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"] + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:83 + 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. + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:157 + def tidy_bytes(force = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:166 + def tidy_bytes!(*args); end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:126 + 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 # => "日本語" + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:123 + def titleize; end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:50 + def to_s; end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:51 + def to_str; end + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:49 + def wrapped_string; end + + private + + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:173 + 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+. + # + # pkg:gem/activesupport#lib/active_support/multibyte/chars.rb:74 + def respond_to_missing?(method, include_private); end +end + +# pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:5 +module ActiveSupport::Multibyte::Unicode + extend ::ActiveSupport::Multibyte::Unicode + + # Compose decomposed characters to the composed form. + # + # pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:21 + def compose(codepoints); end + + # Decompose composed characters to the decomposed form. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:30 + def tidy_bytes(string, force = T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/multibyte/unicode.rb:37 + def recode_windows1252_chars(string); end +end + +# The Unicode version that is supported by the implementation +# +# pkg:gem/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 |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 # => Monotonic time, when the instrumented block started execution +# finish # => Monotonic time, when the instrumented block ended execution +# id # => String, unique ID for the instrumenter that fired the event +# payload # => Hash, the payload +# end +# +# The +start+ and +finish+ values above represent monotonic time. +# +# For instance, let's store all "render" events in an array: +# +# events = [] +# +# ActiveSupport::Notifications.subscribe('render') do |*args| +# events << ActiveSupport::Notifications::Event.new(*args) +# 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 } +# +# The block in the subscribe call gets the name of the event, start +# timestamp, end timestamp, a string with a unique identifier for that event's instrumenter +# (something like "535801666f04d0298cd6"), and a hash with the payload, in +# that order. +# +# 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 {|*args| ... } +# 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 |*args| +# ... +# 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. +# +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:7 +module ActiveSupport::Notifications + class << self + # pkg:gem/activesupport#lib/active_support/notifications.rb:204 + def instrument(name, payload = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:268 + 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. + # + # pkg:gem/activesupport#lib/active_support/notifications.rb:253 + def monotonic_subscribe(pattern = T.unsafe(nil), callback = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:194 + def notifier; end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:194 + def notifier=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:196 + def publish(name, *args); end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:200 + 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. + # + # ActiveSupport::Notifications.subscribe(/render/) do |*args| + # @event = ActiveSupport::Notifications::Event.new(*args) + # end + # + # The +block+ will receive five parameters 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 + # + # If the block passed to the method only takes one parameter, + # it will yield an event object to the block: + # + # ActiveSupport::Notifications.subscribe(/render/) do |event| + # @event = event + # end + # + # Raises an error if invalid event name type is passed: + # + # ActiveSupport::Notifications.subscribe(:render) {|*args| ...} + # #=> ArgumentError (pattern must be specified as a String, Regexp or empty) + # + # pkg:gem/activesupport#lib/active_support/notifications.rb:243 + def subscribe(pattern = T.unsafe(nil), callback = T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:257 + def subscribed(callback, pattern = T.unsafe(nil), monotonic: T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/notifications.rb:264 + def unsubscribe(subscriber_or_name); end + + private + + # pkg:gem/activesupport#lib/active_support/notifications.rb:273 + def registry; end + end +end + +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:106 +class ActiveSupport::Notifications::Event + # pkg:gem/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!. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:164 + def allocations; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:168 + def children; end + + # Returns the CPU time (in milliseconds) passed between the call to + # #start! and the call to #finish!. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:151 + 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 |*args| + # @event = ActiveSupport::Notifications::Event.new(*args) + # end + # + # ActiveSupport::Notifications.instrument('wait') do + # sleep 1 + # end + # + # @event.duration # => 1000.138 + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:197 + def duration; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:107 + def end; end + + # Record information at the time this event finishes + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:143 + def finish!; end + + # Returns the idle time time (in milliseconds) passed between the call to + # #start! and the call to #finish!. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:157 + def idle_time; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:107 + def name; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:176 + def parent_of?(event); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:108 + def payload; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:108 + def payload=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:122 + def record; end + + # Record information at the time this event starts + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:136 + def start!; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:107 + def time; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:107 + def transaction_id; end + + private + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:202 + def now; end + + # Likely on JRuby, TruffleRuby + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:219 + def now_allocations; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:209 + def now_cpu; 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. +# +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:51 +class ActiveSupport::Notifications::Fanout + include ::Mutex_m + include ::ActiveSupport::Notifications::FanoutIteration + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:54 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:301 + def all_listeners_for(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:276 + def build_handle(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:105 + def clear_cache(key = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:287 + def finish(name, id, payload, listeners = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:191 + def groups_for(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:63 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:310 + def listeners_for(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:314 + def listening?(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:52 + def lock; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:52 + def locked?; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:293 + def publish(name, *args); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:297 + def publish_event(event); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:280 + def start(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:68 + def subscribe(pattern = T.unsafe(nil), callable = T.unsafe(nil), monotonic: T.unsafe(nil), &block); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:52 + def synchronize(&block); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:52 + def try_lock; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:52 + def unlock; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:85 + def unsubscribe(subscriber_or_name); end + + # This is a sync queue, so there is no waiting. + # + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:319 + def wait; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:117 +class ActiveSupport::Notifications::Fanout::BaseGroup + include ::ActiveSupport::Notifications::FanoutIteration + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:120 + def initialize(listeners, name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:124 + def each(&block); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:129 +class ActiveSupport::Notifications::Fanout::BaseTimeGroup < ::ActiveSupport::Notifications::Fanout::BaseGroup + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:134 + def finish(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:130 + def start(name, id, payload); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:170 +class ActiveSupport::Notifications::Fanout::EventObjectGroup < ::ActiveSupport::Notifications::Fanout::BaseGroup + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:176 + def finish(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:171 + def start(name, id, payload); end + + private + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:186 + def build_event(name, id, payload); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:156 +class ActiveSupport::Notifications::Fanout::EventedGroup < ::ActiveSupport::Notifications::Fanout::BaseGroup + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:163 + def finish(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:157 + 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 +# +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:231 +class ActiveSupport::Notifications::Fanout::Handle + include ::ActiveSupport::Notifications::FanoutIteration + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:234 + def initialize(notifier, name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:253 + def finish; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:257 + def finish_with_values(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:244 + def start; end + + private + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:267 + def ensure_state!(expected); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:142 +class ActiveSupport::Notifications::Fanout::MonotonicTimedGroup < ::ActiveSupport::Notifications::Fanout::BaseTimeGroup + private + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:144 + def now; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:322 +module ActiveSupport::Notifications::Fanout::Subscribers + class << self + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:323 + def new(pattern, listener, monotonic); end + end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:437 +class ActiveSupport::Notifications::Fanout::Subscribers::EventObject < ::ActiveSupport::Notifications::Fanout::Subscribers::Evented + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:438 + def group_class; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:442 + def publish_event(event); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:379 +class ActiveSupport::Notifications::Fanout::Subscribers::Evented + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:382 + def initialize(pattern, delegate); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:380 + def delegate; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:390 + def group_class; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:380 + def pattern; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:394 + def publish(name, *args); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:400 + def publish_event(event); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:380 + def silenceable; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:408 + def silenced?(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:412 + def subscribed_to?(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:416 + def unsubscribe!(name); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:342 +class ActiveSupport::Notifications::Fanout::Subscribers::Matcher + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:355 + def initialize(pattern); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:364 + def ===(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:343 + def exclusions; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:343 + def pattern; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:360 + def unsubscribe!(name); end + + class << self + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:345 + def wrap(pattern); end + end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:368 +class ActiveSupport::Notifications::Fanout::Subscribers::Matcher::AllMessages + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:369 + def ===(name); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:373 + def unsubscribe!(*); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:431 +class ActiveSupport::Notifications::Fanout::Subscribers::MonotonicTimed < ::ActiveSupport::Notifications::Fanout::Subscribers::Timed + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:432 + def group_class; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:421 +class ActiveSupport::Notifications::Fanout::Subscribers::Timed < ::ActiveSupport::Notifications::Fanout::Subscribers::Evented + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:422 + def group_class; end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:426 + def publish(name, *args); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:149 +class ActiveSupport::Notifications::Fanout::TimedGroup < ::ActiveSupport::Notifications::Fanout::BaseTimeGroup + private + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:151 + def now; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:20 +module ActiveSupport::Notifications::FanoutIteration + private + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:22 + def iterate_guarding_exceptions(collection); end +end + +# pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:10 +class ActiveSupport::Notifications::InstrumentationSubscriberError < ::RuntimeError + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:13 + def initialize(exceptions); end + + # pkg:gem/activesupport#lib/active_support/notifications/fanout.rb:11 + def exceptions; end +end + +# Instrumenters are stored in a thread local. +# +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:9 +class ActiveSupport::Notifications::Instrumenter + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:78 + def build_handle(name, payload); end + + # Send a finish notification with +name+ and +payload+. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:92 + def finish(name, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:96 + def finish_with_state(listeners_state, name, payload); end + + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:54 + def instrument(name, payload = T.unsafe(nil)); end + + # pkg:gem/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+. + # + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:87 + def start(name, payload); end + + private + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:101 + def unique_id; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:21 +class ActiveSupport::Notifications::Instrumenter::LegacyHandle + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:34 + def initialize(notifier, name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:45 + def finish; end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:41 + def start; end +end + +# pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:22 +class ActiveSupport::Notifications::Instrumenter::LegacyHandle::Wrapper + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:23 + def initialize(notifier); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:27 + def build_handle(name, id, payload); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:31 + def finish(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/notifications/instrumenter.rb:31 + def start(*, **, &); end +end + +# pkg:gem/activesupport#lib/active_support/number_helper.rb:4 +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" + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:139 + 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" + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:242 + 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" + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:453 + 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. + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:351 + 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 %" + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:201 + 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" + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:66 + 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" + # + # pkg:gem/activesupport#lib/active_support/number_helper.rb:298 + def number_to_rounded(number, options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:12 +class ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:124 + def initialize(number, options); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:130 + def execute; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def namespace=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def namespace?; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:19 + def number; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:19 + def opts; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def validate_float; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def validate_float=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def validate_float?; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:149 + def default_format_options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:174 + def default_value(key); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:145 + def format_options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:155 + def i18n_format_options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:141 + def options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:170 + def translate_in_locale(key, **i18n_options); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:166 + def translate_number_value_with_default(key, **i18n_options); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:178 + def valid_bigdecimal; end + + class << self + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:120 + def convert(number, options); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def namespace=(value); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:14 + def namespace?; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def validate_float; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def validate_float=(value); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:17 + def validate_float?; end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_converter.rb:21 +ActiveSupport::NumberHelper::NumberConverter::DEFAULTS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:7 +class ActiveSupport::NumberHelper::NumberToCurrencyConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:10 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:38 + def i18n_opts; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:29 + def options; end + + class << self + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_currency_converter.rb:8 + def namespace; end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:7 +class ActiveSupport::NumberHelper::NumberToDelimitedConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:12 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:25 + def delimiter_pattern; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:17 + def parts; end + + class << self + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:8 + def validate_float; end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_delimited_converter.rb:10 +ActiveSupport::NumberHelper::NumberToDelimitedConverter::DEFAULT_DELIMITER_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:7 +class ActiveSupport::NumberHelper::NumberToHumanConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:15 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:50 + def calculate_exponent(units); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:38 + def determine_unit(units, exponent); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:34 + def format; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:55 + def unit_exponents(units); end + + class << self + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:12 + def namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:13 + def validate_float; end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:8 +ActiveSupport::NumberHelper::NumberToHumanConverter::DECIMAL_UNITS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_converter.rb:10 +ActiveSupport::NumberHelper::NumberToHumanConverter::INVERTED_DECIMAL_UNITS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:7 +class ActiveSupport::NumberHelper::NumberToHumanSizeConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:13 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:55 + def base; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:31 + def conversion_format; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:44 + def exponent; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:51 + def smaller_than_base?; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:39 + def storage_unit_key; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:35 + def unit; end + + class << self + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:10 + def namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:11 + def validate_float; end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_human_size_converter.rb:8 +ActiveSupport::NumberHelper::NumberToHumanSizeConverter::STORAGE_UNITS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_percentage_converter.rb:7 +class ActiveSupport::NumberHelper::NumberToPercentageConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_percentage_converter.rb:10 + def convert; end + + class << self + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_percentage_converter.rb:8 + def namespace; end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:8 +class ActiveSupport::NumberHelper::NumberToPhoneConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:9 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:16 + def convert_to_phone_number(number); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:24 + def convert_with_area_code(number); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:31 + def convert_without_area_code(number); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:47 + def country_code(code); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:43 + def delimiter; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:51 + def phone_ext(ext); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:55 + def regexp_pattern(default_pattern); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_phone_converter.rb:39 + def start_with_delimiter?(number); end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:7 +class ActiveSupport::NumberHelper::NumberToRoundedConverter < ::ActiveSupport::NumberHelper::NumberConverter + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:11 + def convert; end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:49 + def format_number(number); end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:45 + def strip_insignificant_zeros; end + + class << self + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:8 + def namespace; end + + # pkg:gem/activesupport#lib/active_support/number_helper/number_to_rounded_converter.rb:9 + def validate_float; end + end +end + +# pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:5 +class ActiveSupport::NumberHelper::RoundingHelper + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:8 + def initialize(options); end + + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:20 + def digit_count(number); end + + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:6 + def options; end + + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:12 + def round(number); end + + private + + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:37 + def absolute_precision(number); end + + # pkg:gem/activesupport#lib/active_support/number_helper/rounding_helper.rb:26 + def convert_to_decimal(number); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/conversions.rb:7 +module ActiveSupport::NumericWithFormat + # pkg:gem/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" + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/conversions.rb:113 + def to_fs(format = T.unsafe(nil), options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/option_merger.rb:6 +class ActiveSupport::OptionMerger + # pkg:gem/activesupport#lib/active_support/option_merger.rb:11 + def initialize(context, options); end + + private + + # pkg:gem/activesupport#lib/active_support/option_merger.rb:16 + def method_missing(method, *arguments, &block); end + + # pkg:gem/activesupport#lib/active_support/option_merger.rb:34 + def respond_to_missing?(*arguments); 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. +# +# pkg:gem/activesupport#lib/active_support/ordered_hash.rb:24 +class ActiveSupport::OrderedHash < ::Hash + # pkg:gem/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! + # + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:46 + def extractable_options?; end + + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:41 + def nested_under_indifferent_access; end + + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:37 + def reject(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/ordered_hash.rb:33 + def select(*args, &block); end + + # pkg:gem/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 +# +# pkg:gem/activesupport#lib/active_support/ordered_options.rb:33 +class ActiveSupport::OrderedOptions < ::Hash + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:41 + def [](key); end + + # make it protected + # + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:37 + def []=(key, value); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:45 + def dig(key, *identifiers); end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:68 + def extractable_options?; end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:72 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:49 + def method_missing(name, *args); end + + protected + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:34 + def _get(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/ordered_options.rb:64 + 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]) +# +# pkg:gem/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]". + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:88 + def filter_param(key, value); end + + private + + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:125 + def call(params, full_parent_key = T.unsafe(nil), original_params = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:93 + def compile_filters!(filters); end + + # pkg:gem/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) + # + # pkg:gem/activesupport#lib/active_support/parameter_filter.rb:55 + def precompile_filters(filters); end + end +end + +# pkg:gem/activesupport#lib/active_support/parameter_filter.rb:40 +ActiveSupport::ParameterFilter::FILTERED = T.let(T.unsafe(nil), String) + +# = Active Support Proxy \Object +# +# A class with no predefined methods that behaves similarly to Builder's +# BlankSlate. Used for proxy classes. +# +# pkg:gem/activesupport#lib/active_support/proxy_object.rb:8 +class ActiveSupport::ProxyObject < ::BasicObject + # Let ActiveSupport::ProxyObject at least raise exceptions. + # + # pkg:gem/activesupport#lib/active_support/proxy_object.rb:13 + def raise(*args); end +end + +# pkg:gem/activesupport#lib/active_support/railtie.rb:7 +class ActiveSupport::Railtie < ::Rails::Railtie; end + +# = \Range With Format +# +# pkg:gem/activesupport#lib/active_support/core_ext/range/conversions.rb:5 +module ActiveSupport::RangeWithFormat + # pkg:gem/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)}" } + # + # pkg:gem/activesupport#lib/active_support/core_ext/range/conversions.rb:51 + def to_fs(format = T.unsafe(nil)); end +end + +# pkg:gem/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. +# +# pkg:gem/activesupport#lib/active_support/reloader.rb:28 +class ActiveSupport::Reloader < ::ActiveSupport::ExecutionWrapper + # pkg:gem/activesupport#lib/active_support/reloader.rb:99 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 + def _class_unload_callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def _prepare_callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 + def _run_class_unload_callbacks(&block); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def _run_prepare_callbacks(&block); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def check; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def check=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def check?; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:126 + def class_unload!(&block); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:131 + def complete!; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def executor; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def executor=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def executor?; end + + # Release the unload lock if it has been previously obtained + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/reloader.rb:106 + def require_unload_lock!; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:121 + def run!; end + + class << self + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 + def _class_unload_callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:31 + def _class_unload_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def _prepare_callbacks; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:29 + def _prepare_callbacks=(value); end + + # Registers a callback that will run immediately after the classes are unloaded. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/reloader.rb:39 + def before_class_unload(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def check; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:87 + def check!; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def check=(value); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:85 + def check?; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def executor; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def executor=(value); end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:84 + def executor?; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:95 + def prepare!; end + + # Initiate a manual reload + # + # pkg:gem/activesupport#lib/active_support/reloader.rb:51 + def reload!; end + + # pkg:gem/activesupport#lib/active_support/reloader.rb:91 + def reloaded!; end + + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/reloader.rb:71 + def wrap(**kwargs); end + end +end + +# = Active Support \Rescuable +# +# Rescuable module adds support for easier exception handling. +# +# pkg:gem/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. + # + # pkg:gem/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). + # + # pkg:gem/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 + +# pkg:gem/activesupport#lib/active_support/rescuable.rb:18 +module ActiveSupport::Rescuable::ClassMethods + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/rescuable.rb:90 + def rescue_with_handler(exception, object: T.unsafe(nil), visited_exceptions: T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/rescuable.rb:139 + def constantize_rescue_handler_class(class_or_name); end + + # pkg:gem/activesupport#lib/active_support/rescuable.rb:124 + def find_rescue_handler(exception); end +end + +# pkg:gem/activesupport#lib/active_support/ruby_features.rb:4 +module ActiveSupport::RubyFeatures; end + +# pkg:gem/activesupport#lib/active_support/ruby_features.rb:5 +ActiveSupport::RubyFeatures::CLASS_SUBCLASSES = T.let(T.unsafe(nil), TrueClass) + +# pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:19 +class ActiveSupport::SafeBuffer < ::String + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:70 + def initialize(str = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:130 + def %(args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:123 + def *(_); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:119 + def +(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:93 + def <<(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:38 + def [](*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:111 + def []=(arg1, arg2, arg3 = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:95 + def bytesplice(*args, value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def capitalize(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def capitalize!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def chomp(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def chomp!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def chop(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def chop!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:59 + def chr; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:80 + def clone_empty; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:87 + def concat(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def delete(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def delete!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def delete_prefix(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def delete_prefix!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def delete_suffix(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def delete_suffix!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def downcase(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def downcase!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:153 + def encode_with(coder); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:173 + def gsub(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:173 + def gsub!(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:142 + def html_safe?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:99 + def insert(index, value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def lstrip(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def lstrip!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def next(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def next!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:103 + def prepend(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:107 + def replace(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def reverse(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def reverse!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def rstrip(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def rstrip!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:65 + def safe_concat(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def scrub(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def scrub!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:49 + def slice(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:51 + def slice!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def squeeze(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def squeeze!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def strip(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def strip!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:173 + def sub(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:173 + def sub!(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def succ(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def succ!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def swapcase(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def swapcase!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:149 + def to_param; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:145 + def to_s; end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def tr(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def tr!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def tr_s(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def tr_s!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def unicode_normalize(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def unicode_normalize!(*args); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def upcase(*args, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:159 + def upcase!(*args); end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:200 + def explicit_html_escape_interpolated_argument(arg); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:204 + def implicit_html_escape_interpolated_argument(arg); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:75 + def initialize_copy(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:28 + def original_concat(*_arg0); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:212 + def set_block_back_references(block, match_data); end + + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:218 + def string_into_safe_buffer(new_string, is_html_safe); end +end + +# Raised when ActiveSupport::SafeBuffer#safe_concat is called on unsafe buffers. +# +# pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:32 +class ActiveSupport::SafeBuffer::SafeConcatError < ::StandardError + # pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:33 + def initialize; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/string/output_safety.rb:20 +ActiveSupport::SafeBuffer::UNSAFE_STRING_METHODS = T.let(T.unsafe(nil), Array) + +# pkg:gem/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 +# +# pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:32 +class ActiveSupport::SecureCompareRotator + include ::ActiveSupport::SecurityUtils + + # pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:37 + def initialize(value, on_rotation: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:43 + def rotate(previous_value); end + + # pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:47 + def secure_compare!(other_value, on_rotation: T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/secure_compare_rotator.rb:35 +class ActiveSupport::SecureCompareRotator::InvalidMatch < ::StandardError; end + +# pkg:gem/activesupport#lib/active_support/security_utils.rb:4 +module ActiveSupport::SecurityUtils + private + + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/security_utils.rb:33 + def secure_compare(a, b); end + + class << self + # pkg:gem/activesupport#lib/active_support/security_utils.rb:25 + def fixed_length_secure_compare(a, b); end + + # pkg:gem/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 +# +# pkg:gem/activesupport#lib/active_support/string_inquirer.rb:21 +class ActiveSupport::StringInquirer < ::String + private + + # pkg:gem/activesupport#lib/active_support/string_inquirer.rb:27 + def method_missing(method_name, *arguments); end + + # pkg:gem/activesupport#lib/active_support/string_inquirer.rb:23 + def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end +end + +# = 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) +# +# pkg:gem/activesupport#lib/active_support/subscriber.rb:32 +class ActiveSupport::Subscriber + # pkg:gem/activesupport#lib/active_support/subscriber.rb:130 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:135 + def call(event); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:128 + def patterns; end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:140 + def publish_event(event); end + + class << self + # Attach the subscriber to a namespace. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/subscriber.rb:69 + def method_added(event); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:78 + def subscribers; end + + private + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:85 + def add_event_subscriber(event); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:123 + def fetch_public_methods(subscriber, inherit_all); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:107 + def find_attached_subscriber; end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:111 + def invalid_event?(event); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:83 + def namespace; end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:83 + def notifier; end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:119 + def pattern_subscribed?(pattern); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:115 + def prepare_pattern(event); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:96 + def remove_event_subscriber(event); end + + # pkg:gem/activesupport#lib/active_support/subscriber.rb:83 + 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. +# +# pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:10 +class ActiveSupport::SyntaxErrorProxy + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:11 + def backtrace; end + + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:34 + def backtrace_locations; end + + private + + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:47 + def parse_message_for_trace; end + + # Ruby 3.3+ + # 3.2 and older versions of Ruby + # + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:61 + def source_location_eval?; end +end + +# pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:15 +class ActiveSupport::SyntaxErrorProxy::BacktraceLocation < ::Struct + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:19 + def label; end + + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:16 + def spot(_); end +end + +# pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:23 +class ActiveSupport::SyntaxErrorProxy::BacktraceLocationProxy + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:24 + def initialize(loc, ex); end + + # pkg:gem/activesupport#lib/active_support/syntax_error_proxy.rb:29 + def spot(_); end +end + +# = 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. +# +# pkg:gem/activesupport#lib/active_support/tagged_logging.rb:30 +module ActiveSupport::TaggedLogging + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:131 + def clear_tags!(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:144 + def flush; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:131 + def pop_tags(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:131 + def push_tags(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:133 + def tagged(*tags); end + + class << self + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:117 + def new(logger); end + end +end + +# pkg:gem/activesupport#lib/active_support/tagged_logging.rb:31 +module ActiveSupport::TaggedLogging::Formatter + # This method is invoked when a log event occurs. + # + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:33 + def call(severity, timestamp, progname, msg); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:52 + def clear_tags!; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:62 + def current_tags; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:48 + def pop_tags(count = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:44 + def push_tags(*tags); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:56 + def tag_stack; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:37 + def tagged(*tags); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:66 + def tags_text; end +end + +# pkg:gem/activesupport#lib/active_support/tagged_logging.rb:109 +module ActiveSupport::TaggedLogging::LocalTagStorage + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:110 + def tag_stack; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:110 + def tag_stack=(_arg0); end + + class << self + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:112 + def extended(base); end + end +end + +# pkg:gem/activesupport#lib/active_support/tagged_logging.rb:71 +class ActiveSupport::TaggedLogging::TagStack + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:74 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:92 + def clear; end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:97 + def format_message(message); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:87 + def pop_tags(count); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:79 + def push_tags(tags); end + + # pkg:gem/activesupport#lib/active_support/tagged_logging.rb:72 + def tags; end +end + +# pkg:gem/activesupport#lib/active_support/test_case.rb:20 +class ActiveSupport::TestCase < ::Minitest::Test + include ::ActiveSupport::Testing::SetupAndTeardown + include ::ActiveSupport::Testing::TaggedLogging + include ::ActiveSupport::Callbacks + include ::ActiveSupport::Testing::Assertions + include ::ActiveSupport::Testing::ErrorReporterAssertions + include ::ActiveSupport::Testing::Deprecation + include ::ActiveSupport::Testing::ConstantStubbing + include ::ActiveSupport::Testing::TimeHelpers + include ::ActiveSupport::Testing::FileFixtures + extend ::ActiveSupport::Callbacks::ClassMethods + extend ::ActiveSupport::DescendantsTracker + extend ::ActiveSupport::Testing::SetupAndTeardown::ClassMethods + extend ::ActiveSupport::Testing::Declarative + + # pkg:gem/activesupport#lib/active_support/test_case.rb:144 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:144 + def __callbacks?; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:144 + def _run_setup_callbacks(&block); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:144 + def _run_teardown_callbacks(&block); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:144 + def _setup_callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:144 + def _teardown_callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:239 + def assert_no_match(matcher, obj, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:162 + def assert_not_empty(obj, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:173 + def assert_not_equal(exp, act, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:184 + def assert_not_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:195 + def assert_not_in_epsilon(a, b, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:206 + def assert_not_includes(collection, obj, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:217 + def assert_not_instance_of(cls, obj, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:228 + def assert_not_kind_of(cls, obj, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:250 + def assert_not_nil(obj, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:261 + def assert_not_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:272 + def assert_not_predicate(o1, op, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:283 + def assert_not_respond_to(obj, meth, msg = T.unsafe(nil), include_all: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:294 + def assert_not_same(exp, act, msg = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:150 + def file_fixture_path; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:150 + def file_fixture_path?; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:298 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:141 + def method_name; end + + class << self + # pkg:gem/activesupport#lib/active_support/test_case.rb:144 + def __callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:144 + def __callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:144 + def __callbacks?; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:144 + def _setup_callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:144 + def _setup_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:144 + def _teardown_callbacks; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:144 + def _teardown_callbacks=(value); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:150 + def file_fixture_path; end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:150 + def file_fixture_path=(value); end + + # pkg:gem/activesupport#lib/active_support/test_case.rb:150 + def file_fixture_path?; 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+. + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:80 + def parallelize(workers: T.unsafe(nil), with: T.unsafe(nil), threshold: T.unsafe(nil)); end + + # Set up 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 + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:100 + 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 + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:117 + 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+. + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:43 + 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+) + # + # pkg:gem/activesupport#lib/active_support/test_case.rb:33 + def test_order=(new_order); end + end +end + +# pkg:gem/activesupport#lib/active_support/test_case.rb:21 +ActiveSupport::TestCase::Assertion = Minitest::Assertion + +# pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:4 +module ActiveSupport::Testing; end + +# pkg:gem/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. + # + # assert_changes :@object, from: nil, to: :foo do + # @object = :foo + # 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 + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:191 + 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 also 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 also be passed in and evaluated. + # + # assert_difference ->{ Article.count } => 1, ->{ Notification.count } => 2 do + # post :create, params: { article: {...} } + # end + # + # A lambda or a list of lambdas 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 + # + # An error message can be specified. + # + # assert_difference 'Article.count', -1, 'An Article should be destroyed' do + # post :delete, params: { id: ... } + # end + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:101 + 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. + # + # assert_no_changes -> { Status.all_good? }, from: true do + # post :create, params: { status: { ok: true } } + # 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 + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:238 + 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 + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:153 + 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' + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:48 + def assert_nothing_raised; end + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:34 + def assert_raises(*exp, match: T.unsafe(nil), &block); end + + private + + # pkg:gem/activesupport#lib/active_support/testing/assertions.rb:265 + def _assert_nothing_raised_or_warn(assertion, &block); end +end + +# pkg:gem/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 +# +# pkg:gem/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 + +# pkg:gem/activesupport#lib/active_support/testing/constant_lookup.rb:35 +module ActiveSupport::Testing::ConstantLookup::ClassMethods + # pkg:gem/activesupport#lib/active_support/testing/constant_lookup.rb:36 + def determine_constant_from_test_name(test_name); end +end + +# pkg:gem/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. + # + # 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. + # + # pkg:gem/activesupport#lib/active_support/testing/constant_stubbing.rb:21 + def stub_const(mod, constant, new_value); end +end + +# pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/testing/declarative.rb:13 + def test(name, &block); end +end + +# pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/testing/deprecation.rb:54 + def assert_not_deprecated(deprecator = T.unsafe(nil), &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"]] + # + # pkg:gem/activesupport#lib/active_support/testing/deprecation.rb:72 + def collect_deprecations(deprecator = T.unsafe(nil)); end +end + +# pkg:gem/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? + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:62 + def assert_no_error_reported(&block); end +end + +# pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:6 +module ActiveSupport::Testing::ErrorReporterAssertions::ErrorCollector + class << self + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:16 + def record; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:29 + def report(error, **kwargs); end + + private + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:38 + def subscribe; end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 +class ActiveSupport::Testing::ErrorReporterAssertions::ErrorCollector::Report < ::Struct + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def context; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def context=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def error; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def error=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def handled; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def handled=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:12 + def handled?; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def severity; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def severity=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def source; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def source=(_); end + + class << self + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def members; end + + # pkg:gem/activesupport#lib/active_support/testing/error_reporter_assertions.rb:10 + def new(*_arg0); end + 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 +# +# pkg:gem/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. + # + # pkg:gem/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 + +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:5 +module ActiveSupport::Testing::Isolation + include ::ActiveSupport::Testing::Isolation::Forking + + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:18 + def run; end + + class << self + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:14 + def forking_env?; end + + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:8 + def included(klass); end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:26 +module ActiveSupport::Testing::Isolation::Forking + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:27 + def run_in_isolation(&blk); end +end + +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:64 +module ActiveSupport::Testing::Isolation::Subprocess + # Complicated H4X to get this working in Windows / JRuby with + # no forking. + # + # pkg:gem/activesupport#lib/active_support/testing/isolation.rb:69 + def run_in_isolation(&blk); end +end + +# pkg:gem/activesupport#lib/active_support/testing/isolation.rb:65 +ActiveSupport::Testing::Isolation::Subprocess::ORIG_ARGV = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:8 +class ActiveSupport::Testing::Parallelization + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:28 + def initialize(worker_count); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:41 + def <<(work); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:18 + def after_fork_hooks; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:26 + def run_cleanup_hooks; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:49 + def shutdown; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:45 + def size; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:35 + def start; end + + class << self + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:14 + def after_fork_hook(&blk); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:18 + def after_fork_hooks; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:22 + def run_cleanup_hook(&blk); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization.rb:26 + def run_cleanup_hooks; end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:9 +class ActiveSupport::Testing::Parallelization::Server + include ::DRb::DRbUndumped + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:12 + def initialize; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:28 + def <<(o); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:48 + def active_workers?; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:52 + def interrupt; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:33 + def pop; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:18 + def record(reporter, result); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:56 + def shutdown; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:40 + def start_worker(worker_id); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/server.rb:44 + def stop_worker(worker_id); end +end + +# pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:6 +class ActiveSupport::Testing::Parallelization::Worker + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:7 + def initialize(number, url); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:80 + def after_fork; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:42 + def perform_job(job); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:86 + def run_cleanup; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:56 + def safe_record(reporter, result); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:14 + def start; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:36 + def work_from_queue; end + + private + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:93 + def add_setup_exception(result); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelization/worker.rb:97 + def set_process_title(status); end +end + +# pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:5 +class ActiveSupport::Testing::ParallelizeExecutor + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:8 + def initialize(size:, with:, threshold: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:22 + def <<(work); end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:6 + def parallelize_with; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:26 + def shutdown; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:6 + def size; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:15 + def start; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:6 + def threshold; end + + private + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:35 + def build_parallel_executor; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:72 + def execution_info; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:60 + def many_workers?; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:31 + def parallel_executor; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:47 + def parallelize; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:52 + def parallelized?; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:56 + def should_parallelize?; end + + # pkg:gem/activesupport#lib/active_support/testing/parallelize_executor.rb:68 + def show_execution_info; end + + # pkg:gem/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 +# +# pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:20 +module ActiveSupport::Testing::SetupAndTeardown + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:44 + def after_teardown; end + + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:39 + def before_setup; end + + class << self + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:21 + def prepended(klass); end + end +end + +# pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:27 +module ActiveSupport::Testing::SetupAndTeardown::ClassMethods + # Add a callback, which runs before TestCase#setup. + # + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:29 + def setup(*args, &block); end + + # Add a callback, which runs after TestCase#teardown. + # + # pkg:gem/activesupport#lib/active_support/testing/setup_and_teardown.rb:34 + def teardown(*args, &block); end +end + +# Manages stubs for TimeHelpers +# +# pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:9 +class ActiveSupport::Testing::SimpleStubs + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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) + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:48 + def stubbing(object, method_name); end + + # Remove all object-method stubs held by this instance + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:37 + def unstub_all!; end + + private + + # Restores the original object.method described by the Stub + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:59 + def unstub_object(stub); end +end + +# pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 +class ActiveSupport::Testing::SimpleStubs::Stub < ::Struct + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def method_name; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def method_name=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def object; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def object=(_); end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def original_method; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def original_method=(_); end + + class << self + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def [](*_arg0); end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def inspect; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def keyword_init?; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:10 + def members; end + + # pkg:gem/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. +# +# pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:7 +module ActiveSupport::Testing::TaggedLogging + # pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:10 + def before_setup; end + + # pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:8 + def tagged_logger=(_arg0); end + + private + + # pkg:gem/activesupport#lib/active_support/testing/tagged_logging.rb:22 + def tagged_logger; end +end + +# Contains helpers that help you test passage of time. +# +# pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:68 +module ActiveSupport::Testing::TimeHelpers + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:69 + def after_teardown; end + + # Calls +travel_to+ with +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 + # + # 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 + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:256 + def freeze_time(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 + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:230 + 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 + # + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:133 + def travel_to(date_or_time, with_usec: T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:238 + def unfreeze_time; end + + private + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:265 + def in_block; end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:265 + def in_block=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/testing/time_helpers.rb:261 + 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 +# +# pkg:gem/activesupport#lib/active_support/time_with_zone.rb:44 +class ActiveSupport::TimeWithZone + include ::DateAndTime::Compatibility + include ::Comparable + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:299 + 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 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:333 + def -(other); end + + # Use the time in UTC for comparisons. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:232 + def <=>(other); end + + # So that +self+ acts_like?(:time). + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:494 + 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 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:422 + def advance(options); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:236 + 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 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:361 + 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").to_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").to_json + # # => "2005/02/01 05:15:10 -1000" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:166 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:235 + def before?(_arg0); end + + # Returns true if the current object's time is within the specified + # +min+ and +max+ time. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:240 + def between?(min, max); end + + # An instance of ActiveSupport::TimeWithZone is never blank + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:505 + 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.116992711 EST -05:00 + # t.change(min: 30) # => Fri, 14 Apr 2017 11:30:00.116992711 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 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:382 + def change(options); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:66 + def comparable_time; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:433 + 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 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:94 + def dst?; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:178 + def encode_with(coder); end + + # Returns +true+ if +other+ is equal to current object. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:275 + 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" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:125 + def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:509 + def freeze; end + + # Returns true if the current object's time is in the future. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:270 + def future?; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:67 + def getgm; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:86 + def getlocal(utc_offset = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:68 + def getutc; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:108 + def gmt?; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:114 + def gmt_offset; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:69 + def gmtime; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:115 + def gmtoff; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:279 + def hash; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:433 + 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" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:186 + def httpdate; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:308 + def in(other); end + + # Returns the simultaneous time in Time.zone, or the specified zone. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:77 + def in_time_zone(new_zone = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:174 + def init_with(coder); end + + # Returns a string of the object's date, time, zone, and offset from UTC. + # + # Time.zone.now.inspect # => "Thu, 04 Dec 2014 11:00:25.624541392 EST -05:00" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:140 + def inspect; end + + # Say we're a Time to thwart type checking. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:499 + def is_a?(klass); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:97 + def isdst; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:151 + def iso8601(fraction_digits = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:502 + def kind_of?(klass); end + + # Returns a Time instance of the simultaneous time in the system timezone. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:83 + def localtime(utc_offset = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:515 + def marshal_dump; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:519 + def marshal_load(variables); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:433 + def mday; end + + # Send the missing method to +time+ instance, and wrap result in a new + # TimeWithZone with the existing +time_zone+. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:540 + def method_missing(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:433 + def min; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:433 + def mon; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:433 + def month; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:260 + def next_day?; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:433 + def nsec; end + + # Returns true if the current object's time is in the past. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:245 + def past?; end + + # Returns the underlying +TZInfo::TimezonePeriod+. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:72 + def period; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:267 + def prev_day?; end + + # respond_to_missing? is not called in some cases, such as when type conversion is + # performed with Kernel#String + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:525 + 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" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:194 + def rfc2822; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:152 + def rfc3339(fraction_digits = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:197 + def rfc822; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:433 + def sec; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:307 + def since(other); end + + # Replaces %Z directive with +zone before passing to Time#strftime, + # so that zone information is correct. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:226 + def strftime(format); end + + # Returns a Time instance that represents the time in +time_zone+. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:58 + def time; end + + # pkg:gem/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"] + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:445 + def to_a; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:433 + 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 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:478 + 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 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:453 + def to_f; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:222 + 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. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:212 + 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 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:461 + 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) + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:470 + def to_r; end + + # Returns a string of the object's date and time. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:200 + def to_s; end + + # Returns an instance of +Time+, either with the same UTC offset + # as +self+ or in the local system timezone depending on the setting + # of +ActiveSupport.to_time_preserves_timezone+. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:485 + def to_time; end + + # Returns true if the current object's time falls within + # the current day. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:251 + def today?; end + + # Returns true if the current object's time falls within + # the next day (tomorrow). + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:257 + def tomorrow?; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:464 + def tv_sec; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:433 + def usec; end + + # Returns a Time instance of the simultaneous time in the UTC timezone. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:63 + 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 + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:105 + def utc?; end + + # Returns the offset from current time to UTC time in seconds. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:111 + def utc_offset; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:433 + 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" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:148 + def xmlschema(fraction_digits = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:433 + def yday; end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:433 + def year; end + + # Returns true if the current object's time falls within + # the previous day (yesterday). + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:264 + def yesterday?; end + + # Returns the time zone abbreviation. + # + # Time.zone = 'Eastern Time (US & Canada)' # => "Eastern Time (US & Canada)" + # Time.zone.now.zone # => "EST" + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:133 + def zone; end + + private + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:576 + def duration_of_variable_length?(obj); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:557 + def get_period_and_ensure_valid_local_time(period); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:549 + def incorporate_utc_offset(time, offset); end + + # Ensure proxy class responds to all methods that underlying time instance + # responds to. + # + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:533 + def respond_to_missing?(sym, include_priv); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:570 + def transfer_time_values_to_utc_constructor(time); end + + # pkg:gem/activesupport#lib/active_support/time_with_zone.rb:580 + def wrap_with_time_zone(time); end +end + +# pkg:gem/activesupport#lib/active_support/time_with_zone.rb:45 +ActiveSupport::TimeWithZone::PRECISIONS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/time_with_zone.rb:547 +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 +# +# pkg:gem/activesupport#lib/active_support/values/time_zone.rb:31 +class ActiveSupport::TimeZone + include ::Comparable + + # Create a new TimeZone object with the given name and offset. The + # offset is the number of seconds that this time zone is offset from UTC + # (GMT). Seconds were chosen as the offset unit because that is the unit + # that Ruby uses to represent time zone offsets (see Time#utc_offset). + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:303 + 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. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:326 + def <=>(zone); end + + # Compare #name and TZInfo identifier to a supplied regexp, returning +true+ + # if a match is found. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:335 + def =~(re); 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 + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:372 + def at(*args); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:568 + 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" + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:320 + def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:564 + 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. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:389 + 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 + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:356 + def local(*args); end + + # Adjust the given time to the simultaneous time in UTC. Returns a + # Time.utc() instance. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:544 + 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. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:341 + def match?(re); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:296 + 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 + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:509 + 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. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:446 + def parse(str, now = T.unsafe(nil)); end + + # Available so that TimeZone instances respond like +TZInfo::Timezone+ + # instances. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:556 + def period_for_local(time, dst = T.unsafe(nil)); end + + # Available so that TimeZone instances respond like +TZInfo::Timezone+ + # instances. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:550 + def period_for_utc(time); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:560 + 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 + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:462 + def rfc3339(str); 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 + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:500 + def strptime(str, format, now = T.unsafe(nil)); end + + # Returns a textual representation of this time zone. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:347 + def to_s; end + + # Returns the current date in this time zone. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:514 + def today; end + + # Returns the next date in this time zone. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:519 + def tomorrow; end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:297 + def tzinfo; end + + # Returns the offset of this time zone from UTC in seconds. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:310 + 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. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:535 + def utc_to_local(time); end + + # Returns the previous date in this time zone. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:524 + def yesterday; end + + private + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:574 + def parts_to_time(parts, now); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:599 + 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. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:232 + 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. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:223 + def all; end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:265 + 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. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:260 + def country_zones(country_code); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:211 + def create(*_arg0); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:207 + 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.) + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:216 + 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" + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:199 + 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. + # + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:254 + def us_zones; end + + private + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:273 + def load_country_zones(code); end + + # pkg:gem/activesupport#lib/active_support/values/time_zone.rb:287 + def zones_map; end + end +end + +# Keys are \Rails TimeZone names, values are TZInfo identifiers. +# +# pkg:gem/activesupport#lib/active_support/values/time_zone.rb:33 +ActiveSupport::TimeZone::MAPPING = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/values/time_zone.rb:188 +ActiveSupport::TimeZone::UTC_OFFSET_WITHOUT_COLON = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/values/time_zone.rb:187 +ActiveSupport::TimeZone::UTC_OFFSET_WITH_COLON = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:35 +module ActiveSupport::ToJsonWithActiveSupportEncoder + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:36 + def to_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:6 +module ActiveSupport::Tryable + # pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:7 + def try(*args, **, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:20 + def try!(*args, **, &block); end +end + +# pkg:gem/activesupport#lib/active_support/gem_version.rb:9 +module ActiveSupport::VERSION; end + +# pkg:gem/activesupport#lib/active_support/gem_version.rb:10 +ActiveSupport::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/gem_version.rb:11 +ActiveSupport::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/gem_version.rb:13 +ActiveSupport::VERSION::PRE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/gem_version.rb:15 +ActiveSupport::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/gem_version.rb:12 +ActiveSupport::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:140 +class ActiveSupport::XMLConverter + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:151 + def initialize(xml, disallowed_types = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:156 + def to_h; end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:222 + def become_array?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:218 + def become_content?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:226 + def become_empty_string?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:232 + def become_hash?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:172 + def deep_to_h(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:241 + def garbage?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:161 + def normalize_keys(params); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:236 + def nothing?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:257 + def process_array(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:248 + def process_content(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:185 + def process_hash(value); end +end + +# pkg:gem/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. +# +# pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:143 +class ActiveSupport::XMLConverter::DisallowedType < ::StandardError + # pkg:gem/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' +# +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:17 +module ActiveSupport::XmlMini + extend ::ActiveSupport::XmlMini + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:97 + def backend; end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:101 + def backend=(name); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:92 + def depth; end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:92 + def depth=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:95 + def parse(*, **, &); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:148 + def rename_key(key, options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:115 + def to_tag(key, value, options); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:107 + def with_backend(name); end + + private + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:159 + def _dasherize(key); end + + # TODO: Add support for other encodings + # + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:166 + def _parse_binary(bin, entity); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:175 + def _parse_file(file, entity); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:191 + def cast_backend_name_to_module(name); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:183 + def current_thread_backend; end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:187 + def current_thread_backend=(name); end +end + +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:34 +ActiveSupport::XmlMini::DEFAULT_ENCODINGS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:55 +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. +# +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:22 +module ActiveSupport::XmlMini::FileLike + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:29 + def content_type; end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:23 + def content_type=(_arg0); end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:25 + def original_filename; end + + # pkg:gem/activesupport#lib/active_support/xml_mini.rb:23 + def original_filename=(_arg0); end +end + +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:65 +ActiveSupport::XmlMini::PARSING = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/xml_mini.rb:39 +ActiveSupport::XmlMini::TYPE_NAMES = T.let(T.unsafe(nil), Hash) + +# pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:81 + def merge_texts!(hash, element); end + + # pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:41 + def require_rexml; end +end + +# pkg:gem/activesupport#lib/active_support/xml_mini/rexml.rb:11 +ActiveSupport::XmlMini_REXML::CONTENT_KEY = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/core_ext/array/extract_options.rb:14 +class Array + include ::Enumerable + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:166 + 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] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:90 + 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] + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:258 + 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 + # + # pkg:gem/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. + # + # pkg:gem/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] + # + # pkg:gem/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} + # + # pkg:gem/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" + # + # pkg:gem/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 + # + # pkg:gem/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" + # + # pkg:gem/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) # => [] + # + # pkg:gem/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"] + # + # pkg:gem/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"] + # + # pkg:gem/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 ] ] + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/inquiry.rb:16 + def inquiry; end + + # Equal to self[1]. + # + # %w( a b c d e ).second # => "b" + # + # pkg:gem/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" + # + # pkg:gem/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]] + # + # pkg:gem/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" + # + # pkg:gem/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" + # + # pkg:gem/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) # => [] + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/access.rb:24 + def to(position); end + + # pkg:gem/activesupport#lib/active_support/core_ext/array/conversions.rb:107 + def to_default_s(*args, **, &block); end + + # pkg:gem/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]" + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:42 + 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" + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:50 + 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" + # + # pkg:gem/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 + # + # + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/conversions.rb:185 + def to_xml(options = T.unsafe(nil)); end + + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/wrap.rb:39 + def wrap(object); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:126 +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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:136 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/class/attribute.rb:5 +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: {} + # + # pkg:gem/activesupport#lib/active_support/core_ext/class/attribute.rb:85 + 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] + # + # pkg:gem/activesupport#lib/active_support/core_ext/class/subclasses.rb:21 + def descendants; end + + # Returns an array with the direct children of +self+. + # + # class Foo; end + # class Bar < Foo; end + # class Baz < Bar; end + # + # Foo.subclasses # => [Bar] + # + # pkg:gem/activesupport#lib/active_support/descendants_tracker.rb:60 + def subclasses; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:69 +class Data + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:70 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/date/zones.rb:6 +class Date + include ::Comparable + include ::DateAndTime::Zones + include ::DateAndTime::Calculations + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:98 + def +(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:108 + def -(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:160 + def <=>(other); end + + # Duck-types as a Date-like class. See Object#acts_like?. + # + # pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:55 + def ago(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:205 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:72 + def at_beginning_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:88 + def at_end_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:80 + def at_midday; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:82 + def at_middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:71 + def at_midnight; end + + # pkg:gem/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) + # + # pkg:gem/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] + # + # pkg:gem/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) + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:152 + def compare_with_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:159 + def compare_without_coercion(_arg0); end + + # pkg:gem/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) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:85 + def end_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:64 + def in(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:67 + def inspect; end + + # pkg:gem/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) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:75 + def middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:70 + def midnight; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:100 + def minus_with_duration(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:107 + def minus_without_duration(_arg0); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:79 + def noon; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:90 + def plus_with_duration(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:97 + def plus_without_duration(_arg0); end + + # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005" + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:61 + def since(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:59 + def to_default_s(*args, **, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:58 + 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(: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}") } + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:47 + 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. + # + # pkg:gem/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" + # + # pkg:gem/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+. + # + # pkg:gem/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+ + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:27 + def beginning_of_week=(week_start); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:14 + def beginning_of_week_default; end + + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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). + # + # pkg:gem/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). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date/calculations.rb:38 + def yesterday; end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/date/conversions.rb:9 +Date::DATE_FORMATS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:5 +module DateAndTime; end + +# pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:331 + def all_year; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:128 + def at_beginning_of_month; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:143 + def at_beginning_of_quarter; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:271 + def at_beginning_of_week(start_day = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:182 + def at_beginning_of_year; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:300 + def at_end_of_month; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:158 + def at_end_of_quarter; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:286 + def at_end_of_week(start_day = T.unsafe(nil)); end + + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:52 + def future?; end + + # Short-hand for months_ago(1). + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:240 + def last_month; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:248 + def last_quarter; end + + # pkg:gem/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 + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:237 + def last_weekday; end + + # Short-hand for years_ago(1). + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:102 + def months_since(months); end + + # pkg:gem/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 + # + # pkg:gem/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). + # + # pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:47 + def past?; end + + # pkg:gem/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 + # + # pkg:gem/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). + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:290 + def sunday; end + + # Returns true if the date/time is today. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:30 + def today?; end + + # Returns a new date/time representing tomorrow. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:25 + def tomorrow; end + + # Returns true if the date/time is tomorrow. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:112 + def years_since(years); end + + # Returns a new date/time representing yesterday. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:20 + def yesterday; end + + # Returns true if the date/time is yesterday. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:41 + def yesterday?; end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:370 + def copy_time_to(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:366 + def days_span(day); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:358 + def first_hour(date_or_time); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:362 + def last_hour(date_or_time); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:8 +DateAndTime::Calculations::DAYS_INTO_WEEK = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/calculations.rb:17 +DateAndTime::Calculations::WEEKEND_DAYS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:6 +module DateAndTime::Compatibility + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:14 + def preserve_timezone; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:29 + def utc_to_local_returns_utc_offset_times; end + + class << self + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:14 + def preserve_timezone; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:14 + def preserve_timezone=(val); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:29 + def utc_to_local_returns_utc_offset_times; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/compatibility.rb:29 + def utc_to_local_returns_utc_offset_times=(val); end + end +end + +# pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/zones.rb:20 + def in_time_zone(zone = T.unsafe(nil)); end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/date_and_time/zones.rb:32 + def time_with_zone(time, zone); end +end + +# pkg:gem/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. + # + # pkg:gem/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?. + # + # pkg:gem/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?. + # + # pkg:gem/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. + # + # pkg:gem/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! + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:109 + def ago(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:215 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:127 + def at_beginning_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:149 + def at_beginning_of_hour; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:161 + def at_beginning_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:143 + def at_end_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:155 + def at_end_of_hour; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:167 + def at_end_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:135 + def at_midday; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:137 + def at_middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:126 + def at_midnight; end + + # pkg:gem/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). + # + # pkg:gem/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). + # + # pkg:gem/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). + # + # pkg:gem/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] + # + # pkg:gem/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) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:51 + def change(options); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:63 + def default_inspect; end + + # Returns a new DateTime representing the end of the day (23:59:59). + # + # pkg:gem/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). + # + # pkg:gem/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). + # + # pkg:gem/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" + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:55 + def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:192 + def getgm; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:178 + def getlocal(utc_offset = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:193 + def getutc; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:194 + def gmtime; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:119 + def in(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:64 + def inspect; end + + # Returns a Time instance of the simultaneous time in the system timezone. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:170 + def localtime(utc_offset = T.unsafe(nil)); end + + # pkg:gem/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) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:130 + def middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:125 + def midnight; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:134 + def noon; end + + # Returns the fraction of a second as nanoseconds + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:98 + def nsec; end + + # Overrides the default inspect method with a human readable one, e.g., "Mon, 21 Feb 2005 14:30:00 +0000". + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:60 + 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 + # + # pkg:gem/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 + # + # pkg:gem/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! + # + # pkg:gem/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) + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:36 + def subsec; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:44 + def to_default_s(*args, **, &block); end + + # Converts +self+ to a floating-point number of seconds, including fractional microseconds, since the Unix epoch. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:83 + def to_f; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:42 + 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}") } + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:35 + def to_fs(format = T.unsafe(nil)); end + + # Converts +self+ to an integer number of seconds since the Unix epoch. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:88 + def to_i; end + + # Either return an instance of +Time+ with the same UTC offset + # as +self+ or an instance of +Time+ representing the same time + # in the local system timezone depending on the setting of + # on the setting of +ActiveSupport.to_time_preserves_timezone+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/compatibility.rb:9 + def to_time; end + + # Returns the fraction of a second as microseconds + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:93 + 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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:184 + def utc; end + + # Returns +true+ if offset == 0. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:197 + def utc?; end + + # Returns the offset value in seconds. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:202 + def utc_offset; end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:103 + def offset_in_seconds; end + + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:107 + 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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/conversions.rb:73 + 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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/date_time/calculations.rb:10 + def current; end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:117 +class Delegator < ::BasicObject + include ::ActiveSupport::Tryable +end + +# pkg:gem/activesupport#lib/active_support/core_ext/digest/uuid.rb:7 +module Digest::UUID + class << self + # 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 + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/digest/uuid.rb:42 + def uuid_v3(uuid_namespace, name); end + + # Convenience method for SecureRandom.uuid. + # + # pkg:gem/activesupport#lib/active_support/core_ext/digest/uuid.rb:52 + def uuid_v4; end + + # Convenience method for uuid_from_hash using OpenSSL::Digest::SHA1. + # + # pkg:gem/activesupport#lib/active_support/core_ext/digest/uuid.rb:47 + def uuid_v5(uuid_namespace, name); end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/digest/uuid.rb:56 + def pack_uuid_namespace(namespace); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/digest/uuid.rb:8 +Digest::UUID::DNS_NAMESPACE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/core_ext/digest/uuid.rb:10 +Digest::UUID::OID_NAMESPACE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/core_ext/digest/uuid.rb:9 +Digest::UUID::URL_NAMESPACE = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/core_ext/digest/uuid.rb:11 +Digest::UUID::X500_NAMESPACE = T.let(T.unsafe(nil), String) + +# pkg:gem/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" + # + # pkg:gem/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). + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:142 + def xml_name_escape(name); end + + class << self + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:67 + def html_escape_once(s); end + + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:161 + def tokenize(source); end + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:10 + def unwrapped_html_escape(s); end + + # pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:157 + def xml_name_escape(name); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:40 +ERB::Util::HTML_ESCAPE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:41 +ERB::Util::HTML_ESCAPE_ONCE_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:49 +ERB::Util::INVALID_TAG_NAME_FOLLOWING_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:47 +ERB::Util::INVALID_TAG_NAME_START_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:50 +ERB::Util::SAFE_XML_TAG_NAME_REGEXP = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:48 +ERB::Util::TAG_NAME_FOLLOWING_CODEPOINTS = T.let(T.unsafe(nil), String) + +# pkg:gem/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 +# +# pkg:gem/activesupport#lib/active_support/core_ext/erb/util.rb:44 +ERB::Util::TAG_NAME_START_CODEPOINTS = T.let(T.unsafe(nil), String) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:147 +module Enumerable + include ::ActiveSupport::ToJsonWithActiveSupportEncoder + extend ::ActiveSupport::EnumerableCoreExt::Constants + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:148 + 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 } + # + # pkg:gem/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. + # + # pkg:gem/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} + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:196 + def in_order_of(key, series); 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"] + # + # pkg:gem/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" => , ...} + # + # pkg:gem/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 } + # + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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"] + # + # pkg:gem/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"]] + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:206 + def sole; end + + # pkg:gem/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. +# +# pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:21 +class Enumerable::SoleItemExpectedError < ::StandardError; end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:248 +class Exception + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:249 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:61 +class FalseClass + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:89 + def as_json(options = T.unsafe(nil)); end + + # +false+ is blank: + # + # false.blank? # => true + # + # @return [true] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:67 + def blank?; end + + # Returns +self+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:34 + def to_param; end +end + +# pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/file/atomic.rb:21 + def atomic_write(file_name, temp_dir = T.unsafe(nil)); end + + # Private utility method. + # + # pkg:gem/activesupport#lib/active_support/core_ext/file/atomic.rb:56 + def probe_stat_in(dir); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:118 +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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:121 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/hash/deep_merge.rb:5 +class Hash + include ::Enumerable + include ::ActiveSupport::DeepMergeable + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:172 + 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 + # + # pkg:gem/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] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:100 + def blank?; end + + # Hash#reject has its own definition, so this needs one too. + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:217 + 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 } + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:227 + 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" + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/deep_dup.rb:43 + def deep_dup; end + + # :method: deep_merge! + # :call-seq: deep_merge!(other_hash, &block) + # + # Same as #deep_merge, but modifies +self+. + # + # -- + # Implemented by ActiveSupport::DeepMergeable#deep_merge!. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/deep_merge.rb:39 + 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"}} + # + # pkg:gem/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. + # + # pkg:gem/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"}} + # + # pkg:gem/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. + # + # pkg:gem/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"}} + # + # pkg:gem/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. + # + # pkg:gem/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"}} + # + # pkg:gem/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. + # + # pkg:gem/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 } + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/except.rb:20 + 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} + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/array/extract_options.rb:9 + def extractable_options?; end + + # 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} + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/indifferent_access.rb:23 + def nested_under_indifferent_access; 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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/reverse_merge.rb:14 + def reverse_merge(other_hash); end + + # Destructive +reverse_merge+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/reverse_merge.rb:20 + def reverse_merge!(other_hash); end + + # pkg:gem/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} + # + # pkg:gem/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"} + # + # pkg:gem/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+. + # + # pkg:gem/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"} + # + # pkg:gem/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+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:34 + def symbolize_keys!; end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:30 + def to_options; end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:37 + def to_options!; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:86 + 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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:75 + 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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:74 + def to_xml(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/hash/reverse_merge.rb:17 + def with_defaults(other_hash); end + + # pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/keys.rb:116 + def _deep_transform_keys_in_object(object, &block); end + + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/deep_transform_values.rb:25 + def _deep_transform_values_in_object(object, &block); end + + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/hash/conversions.rb:128 + def from_xml(xml, disallowed_types = T.unsafe(nil)); end + end +end + +# :stopdoc: +# +# pkg:gem/activesupport#lib/active_support/hash_with_indifferent_access.rb:443 +HashWithIndifferentAccess = ActiveSupport::HashWithIndifferentAccess + +# :enddoc: +# +# pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:8 +module I18n; end + +# pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:9 +class I18n::Railtie < ::Rails::Railtie + class << self + # pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:95 + def include_fallbacks_module; end + + # pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:99 + def init_fallbacks(fallbacks); end + + # Setup i18n configuration. + # + # pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:32 + def initialize_i18n(app); end + + # pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:80 + def setup_raise_on_missing_translations_config(app); end + + # pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:115 + def validate_fallbacks(fallbacks); end + + # pkg:gem/activesupport#lib/active_support/i18n_railtie.rb:126 + def watched_dirs_with_extensions(paths); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:153 +class IO + include ::Enumerable + include ::File::Constants + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:154 + 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::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) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:236 +class IPAddr + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:237 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/integer/time.rb:6 +class Integer < ::Numeric + include ::ActiveSupport::NumericWithFormat + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/integer/time.rb:10 + def months; end + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/integer/time.rb:18 + def years; end +end + +# pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/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' + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/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' + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/kernel/reporting.rb:26 + def with_warnings(flag); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:31 +class Method + # Methods are not duplicable: + # + # method(:puts).duplicable? # => false + # method(:puts).dup # => TypeError: allocator undefined for Method + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:36 + def duplicable?; end +end + +# == Attribute Accessors +# +# Extends the module object with class/module and instance accessors for +# class/module attributes, just like the native attr* accessors for instance +# attributes. +# == 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+. +# +# pkg:gem/activesupport#lib/active_support/core_ext/module/attribute_accessors.rb:8 +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" + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/anonymous.rb:27 + def anonymous?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:53 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:10 + def attr_internal_writer(*attrs); end + + # pkg:gem/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 + + # pkg:gem/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 + + # pkg:gem/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 + # + # pkg:gem/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 +Module::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 + # +Module::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 + # # => Module::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+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/delegation.rb:171 + 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 +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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/delegation.rb:318 + 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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/deprecation.rb:17 + def deprecate(*method_names, deprecator: T.unsafe(nil), **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] + # + # pkg:gem/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] + # + # pkg:gem/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] + # + # pkg:gem/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 + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/introspection.rb:34 + def module_parent; end + + # Returns the name of the module containing this one. + # + # M::N.module_parent_name # => "M" + # + # pkg:gem/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] + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/introspection.rb:50 + def module_parents; end + + # Replaces the existing method definition, if there is one, with the passed + # block as its body. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/redefine_method.rb:7 + def silence_redefinition_of_method(method); end + + # pkg:gem/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 + + # pkg:gem/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 + + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:30 + def attr_internal_define(attr_name, type); end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:26 + def attr_internal_ivar_name(attr); end + + class << self + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:22 + def attr_internal_naming_format; end + + # pkg:gem/activesupport#lib/active_support/core_ext/module/attr_internal.rb:22 + def attr_internal_naming_format=(_arg0); 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. +# +# pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/concerning.rb:132 + def concern(topic, &module_definition); end + + # Define a new concern and mix it in. + # + # pkg:gem/activesupport#lib/active_support/core_ext/module/concerning.rb:114 + def concerning(topic, prepend: T.unsafe(nil), &block); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/module/delegation.rb:13 +Module::DELEGATION_RESERVED_KEYWORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/core_ext/module/delegation.rb:14 +Module::DELEGATION_RESERVED_METHOD_NAMES = T.let(T.unsafe(nil), Set) + +# Error generated by +delegate+ when a method is called on +nil+ and +allow_nil+ +# option is not used. +# +# pkg:gem/activesupport#lib/active_support/core_ext/module/delegation.rb:8 +class Module::DelegationError < ::NoMethodError; end + +# pkg:gem/activesupport#lib/active_support/core_ext/module/delegation.rb:10 +Module::RUBY_RESERVED_KEYWORDS = T.let(T.unsafe(nil), Array) + +# pkg:gem/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" + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/name_error.rb:44 + def missing_name?(name); end + + private + + # pkg:gem/activesupport#lib/active_support/core_ext/name_error.rb:56 + def real_mod_name(mod); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/name_error.rb:53 +NameError::UNBOUND_METHOD_MODULE_NAME = T.let(T.unsafe(nil), UnboundMethod) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:50 +class NilClass + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:95 + def as_json(options = T.unsafe(nil)); end + + # +nil+ is blank: + # + # nil.blank? # => true + # + # @return [true] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:56 + def blank?; end + + # Returns +self+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:20 + def to_param; 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) + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:148 + def try(*); end + + # Calling +try!+ on +nil+ always returns +nil+. + # + # nil.try!(:name) # => nil + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/try.rb:155 + def try!(*); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:134 +class Numeric + include ::Comparable + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:113 + def as_json(options = T.unsafe(nil)); end + + # No number is blank: + # + # 1.blank? # => false + # 0.blank? # => false + # + # @return [false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:141 + def blank?; end + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:15 + def bytes; end + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:37 + def days; end + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:63 + def exabytes; end + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:53 + def fortnights; end + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:39 + def gigabytes; end + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:29 + def hours; end + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:63 + def in_milliseconds; end + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:23 + def kilobytes; end + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:31 + def megabytes; end + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:21 + def minutes; end + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:55 + def petabytes; end + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:13 + def seconds; end + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:47 + def terabytes; end + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/time.rb:45 + def weeks; end + + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:71 + def zettabytes; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:9 +Numeric::EXABYTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:6 +Numeric::GIGABYTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:4 +Numeric::KILOBYTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:5 +Numeric::MEGABYTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:8 +Numeric::PETABYTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/activesupport#lib/active_support/core_ext/numeric/bytes.rb:7 +Numeric::TERABYTE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/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. +# ++ +# +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:5 +class Object < ::BasicObject + include ::ActiveSupport::ToJsonWithActiveSupportEncoder + include ::ActiveSupport::Dependencies::RequireDependency + include ::Kernel + include ::PP::ObjectMixin + include ::ActiveSupport::Tryable + + # 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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/acts_like.rb:33 + def acts_like?(duck); end + + # pkg:gem/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] + # + # pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:26 + def duplicable?; end + + # pkg:gem/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?+. + # + # pkg:gem/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} + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/instance_variables.rb:14 + def instance_values; end + + # RUBY_VERSION >= "3.0" + # 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"] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/instance_variables.rb:30 + 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] + # + # pkg:gem/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] + # + # pkg:gem/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] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:25 + def present?; end + + # Alias of to_s. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:7 + 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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:13 + def to_query(key); end + + # Set and restore public attributes around a block. + # + # client.timeout # => 5 + # client.with(timeout: 1) do + # client.timeout # => 1 + # end + # client.timeout # => 5 + # + # 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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/with.rb:24 + 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!" + # # => + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/with_options.rb:92 + def with_options(options, &block); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:230 +class Pathname + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:231 + def as_json(options = T.unsafe(nil)); end +end + +module Process + extend ::ConnectionPool::ForkTracker + extend ::ActiveSupport::ForkTracker::ModernCoreExt + + class << self + # pkg:gem/activesupport#lib/active_support/fork_tracker.rb:6 + def _fork; end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:242 +class Process::Status + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:243 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:159 +class Range + include ::ActiveSupport::RangeWithFormat + include ::ActiveSupport::CompareWithRange + include ::ActiveSupport::EachTimeWithZone + include ::Enumerable + + # pkg:gem/activesupport#lib/active_support/core_ext/range/compare_range.rb:16 + def ===(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:160 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/range/each.rb:7 + def each(&block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/range/compare_range.rb:41 + def include?(value); end + + # pkg:gem/activesupport#lib/active_support/core_ext/range/overlap.rb:39 + def overlaps?(_arg0); end + + # pkg:gem/activesupport#lib/active_support/core_ext/range/each.rb:12 + def step(n = T.unsafe(nil), &block); end + + # Optimize range sum to use arithmetic progression if a block is not given and + # we have a range of numeric values. + # + # pkg:gem/activesupport#lib/active_support/core_ext/enumerable.rb:236 + def sum(initial_value = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:141 +class Regexp + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:142 + 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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/regexp.rb:11 + def multiline?; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/securerandom.rb:5 +module SecureRandom + class << self + # pkg:gem/activesupport#lib/active_support/core_ext/securerandom.rb:45 + def base36(n = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/securerandom.rb:20 + def base58(n = T.unsafe(nil)); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/securerandom.rb:7 +SecureRandom::BASE36_ALPHABET = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/core_ext/securerandom.rb:6 +SecureRandom::BASE58_ALPHABET = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:53 +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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:57 + 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" +# +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:103 +class String + include ::Comparable + + # Enables more predictable duck-typing on String-like classes. See Object#acts_like?. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/behavior.rb:5 + def acts_like_string?; end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:101 + 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 + # + # pkg:gem/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] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:121 + def blank?; end + + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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+. + # + # pkg:gem/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+. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:284 + def downcase_first; 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" + # + # pkg:gem/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. + # + # pkg:gem/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" + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/zones.rb:9 + def in_time_zone(zone = 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 + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/multibyte.rb:48 + 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" + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:35 + def pluralize(count = T.unsafe(nil), locale = T.unsafe(nil)); 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" + # + # pkg:gem/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 " + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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" + # + # pkg:gem/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" + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/filters.rb:21 + def squish!; 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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:227 + def tableize; end + + # pkg:gem/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. + # + # pkg:gem/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" + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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)" + # + # pkg:gem/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. + # + # pkg:gem/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)" + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/string/inflections.rb:273 + def upcase_first; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:104 +String::BLANK_RE = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:105 +String::ENCODED_BLANKS = T.let(T.unsafe(nil), Concurrent::Map) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:76 +class Struct + include ::Enumerable + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:77 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:106 +class Symbol + include ::Comparable + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:107 + def as_json(options = T.unsafe(nil)); end +end + +class Thread + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:9 + def active_support_execution_state; end + + # pkg:gem/activesupport#lib/active_support/isolated_execution_state.rb:9 + def active_support_execution_state=(_arg0); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/thread/backtrace/location.rb:3 +class Thread::Backtrace::Location + # pkg:gem/activesupport#lib/active_support/core_ext/thread/backtrace/location.rb:5 + def spot(ex); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:146 +class Time + include ::Comparable + include ::DateAndTime::Zones + include ::DateAndTime::Calculations + include ::DateAndTime::Compatibility + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:308 + def +(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:318 + def -(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:343 + def <=>(other); end + + # Duck-types as a Time-like class. See Object#acts_like?. + # + # pkg:gem/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. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:202 + 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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:228 + def ago(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:195 + def as_json(options = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:246 + def at_beginning_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:273 + def at_beginning_of_hour; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:289 + def at_beginning_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:267 + def at_end_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:283 + def at_end_of_hour; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:298 + def at_end_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:254 + def at_midday; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:256 + def at_middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:245 + def at_midnight; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:255 + def at_noon; end + + # Returns a new Time representing the start of the day (0:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:241 + def beginning_of_day; end + + # Returns a new Time representing the start of the hour (x:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:270 + def beginning_of_hour; end + + # Returns a new Time representing the start of the minute (x:xx:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:286 + def beginning_of_minute; end + + # No Time is blank: + # + # Time.now.blank? # => false + # + # @return [false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:152 + 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) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:138 + def change(options); end + + # Layers additional behavior on Time#<=> so that DateTime and ActiveSupport::TimeWithZone instances + # can be chronologically compared with a Time + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:332 + def compare_with_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:342 + def compare_without_coercion(_arg0); end + + # Returns a new Time representing the end of the day, 23:59:59.999999 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:259 + def end_of_day; end + + # Returns a new Time representing the end of the hour, x:59:59.999999 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:276 + def end_of_hour; end + + # Returns a new Time representing the end of the minute, x:xx:59.999999 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:292 + def end_of_minute; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:353 + def eql?(other); end + + # Layers additional behavior on Time#eql? so that ActiveSupport::TimeWithZone instances + # can be eql? to an equivalent Time + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:347 + def eql_with_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:352 + 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" + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:69 + def formatted_offset(colon = T.unsafe(nil), alternate_utc_string = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:238 + def in(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:252 + def midday; end + + # Returns a new Time representing the middle of the day (12:00) + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:249 + def middle_of_day; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:244 + 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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:323 + def minus_with_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:310 + def minus_with_duration(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:327 + def minus_without_coercion(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:317 + def minus_without_duration(_arg0); end + + # Returns a new time the specified number of days in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:361 + def next_day(days = T.unsafe(nil)); end + + # Returns a new time the specified number of months in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:371 + def next_month(months = T.unsafe(nil)); end + + # Returns a new time the specified number of years in the future. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:381 + def next_year(years = T.unsafe(nil)); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:253 + def noon; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:300 + def plus_with_duration(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:307 + def plus_without_duration(_arg0); end + + # Returns a new time the specified number of days ago. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:356 + def prev_day(days = T.unsafe(nil)); end + + # Returns a new time the specified number of months ago. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:366 + def prev_month(months = T.unsafe(nil)); end + + # Returns a new time the specified number of years ago. + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:376 + def prev_year(years = T.unsafe(nil)); end + + # Aliased to +xmlschema+ for compatibility with +DateTime+ + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:74 + def rfc3339(fraction_digits = T.unsafe(nil)); end + + # Returns the fraction of a second as a +Rational+ + # + # Time.new(2012, 8, 29, 0, 0, 0.5).sec_fraction # => (1/2) + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:233 + def since(seconds); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:61 + def to_default_s(*args, **, &block); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:60 + 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(: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}") } + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:53 + def to_fs(format = T.unsafe(nil)); end + + # Either return +self+ or the time in the local system timezone depending + # on the setting of +ActiveSupport.to_time_preserves_timezone+. + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:18 + def ===(other); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:60 + def at(*args, **kwargs); end + + # Layers additional behavior on Time.at so that ActiveSupport::TimeWithZone and DateTime + # instances can be used when called with a single argument + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:45 + def at_with_coercion(*args, **kwargs); end + + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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 + # + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:41 + def zone=(time_zone); end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:10 + def zone_default; end + + # pkg:gem/activesupport#lib/active_support/core_ext/time/zones.rb:10 + def zone_default=(_arg0); end + end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/time/calculations.rb:14 +Time::COMMON_YEAR_DAYS_IN_MONTH = T.let(T.unsafe(nil), Array) + +# pkg:gem/activesupport#lib/active_support/core_ext/time/conversions.rb:8 +Time::DATE_FORMATS = T.let(T.unsafe(nil), Hash) + +# pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:72 +class TrueClass + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:83 + def as_json(options = T.unsafe(nil)); end + + # +true+ is not blank: + # + # true.blank? # => false + # + # @return [false] + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/blank.rb:78 + def blank?; end + + # Returns +self+. + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/to_query.rb:27 + def to_param; end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:224 +class URI::Generic + # pkg:gem/activesupport#lib/active_support/core_ext/object/json.rb:225 + def as_json(options = T.unsafe(nil)); end +end + +# pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:41 +class UnboundMethod + # Unbound methods are not duplicable: + # + # method(:puts).unbind.duplicable? # => false + # method(:puts).unbind.dup # => TypeError: allocator undefined for UnboundMethod + # + # pkg:gem/activesupport#lib/active_support/core_ext/object/duplicable.rb:46 + def duplicable?; end +end diff --git a/sorbet/rbi/gems/addressable@2.8.7.rbi b/sorbet/rbi/gems/addressable@2.8.7.rbi new file mode 100644 index 000000000..564527bf7 --- /dev/null +++ b/sorbet/rbi/gems/addressable@2.8.7.rbi @@ -0,0 +1,1384 @@ +# 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. +# +# pkg:gem/addressable#lib/addressable/version.rb:22 +module Addressable; end + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:21 +module Addressable::IDNA + class << self + # pkg:gem/addressable#lib/addressable/idna/pure.rb:122 + def _deprecated_unicode_normalize_kc(value); end + + # Converts from a Unicode internationalized domain name to an ASCII + # domain name as described in RFC 3490. + # + # pkg:gem/addressable#lib/addressable/idna/pure.rb:67 + def to_ascii(input); end + + # Converts from an ASCII domain name to a Unicode internationalized + # domain name as described in RFC 3490. + # + # pkg:gem/addressable#lib/addressable/idna/pure.rb:93 + def to_unicode(input); end + + # @deprecated Use {String#unicode_normalize(:nfkc)} instead + # + # pkg:gem/addressable#lib/addressable/idna/pure.rb:117 + def unicode_normalize_kc(*args, **, &block); end + + private + + # pkg:gem/addressable#lib/addressable/idna/pure.rb:140 + def lookup_unicode_lowercase(codepoint); end + + # Bias adaptation method + # + # pkg:gem/addressable#lib/addressable/idna/pure.rb:488 + def punycode_adapt(delta, numpoints, firsttime); end + + # pkg:gem/addressable#lib/addressable/idna/pure.rb:456 + def punycode_basic?(codepoint); end + + # pkg:gem/addressable#lib/addressable/idna/pure.rb:334 + 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. + # + # pkg:gem/addressable#lib/addressable/idna/pure.rb:474 + def punycode_decode_digit(codepoint); end + + # pkg:gem/addressable#lib/addressable/idna/pure.rb:461 + def punycode_delimiter?(codepoint); end + + # pkg:gem/addressable#lib/addressable/idna/pure.rb:213 + def punycode_encode(unicode); end + + # pkg:gem/addressable#lib/addressable/idna/pure.rb:466 + def punycode_encode_digit(d); end + + # Unicode aware downcase method. + # + # @api private + # @param [String] input + # The input string. + # @return [String] The downcased result. + # + # pkg:gem/addressable#lib/addressable/idna/pure.rb:132 + def unicode_downcase(input); end + end +end + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:183 +Addressable::IDNA::ACE_MAX_LENGTH = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:40 +Addressable::IDNA::ACE_PREFIX = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:172 +Addressable::IDNA::COMPOSITION_TABLE = T.let(T.unsafe(nil), Hash) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:185 +Addressable::IDNA::PUNYCODE_BASE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:189 +Addressable::IDNA::PUNYCODE_DAMP = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:192 +Addressable::IDNA::PUNYCODE_DELIMITER = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:190 +Addressable::IDNA::PUNYCODE_INITIAL_BIAS = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:191 +Addressable::IDNA::PUNYCODE_INITIAL_N = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:194 +Addressable::IDNA::PUNYCODE_MAXINT = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:196 +Addressable::IDNA::PUNYCODE_PRINT_ASCII = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:188 +Addressable::IDNA::PUNYCODE_SKEW = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:187 +Addressable::IDNA::PUNYCODE_TMAX = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:186 +Addressable::IDNA::PUNYCODE_TMIN = T.let(T.unsafe(nil), Integer) + +# Input is invalid. +# +# pkg:gem/addressable#lib/addressable/idna/pure.rb:207 +class Addressable::IDNA::PunycodeBadInput < ::StandardError; end + +# Output would exceed the space provided. +# +# pkg:gem/addressable#lib/addressable/idna/pure.rb:209 +class Addressable::IDNA::PunycodeBigOutput < ::StandardError; end + +# Input needs wider integers to process. +# +# pkg:gem/addressable#lib/addressable/idna/pure.rb:211 +class Addressable::IDNA::PunycodeOverflow < ::StandardError; end + +# This is a sparse Unicode table. Codepoints without entries are +# assumed to have the value: [0, 0, nil, nil, nil, nil, nil] +# +# pkg:gem/addressable#lib/addressable/idna/pure.rb:163 +Addressable::IDNA::UNICODE_DATA = T.let(T.unsafe(nil), Hash) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:150 +Addressable::IDNA::UNICODE_DATA_CANONICAL = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:148 +Addressable::IDNA::UNICODE_DATA_COMBINING_CLASS = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:151 +Addressable::IDNA::UNICODE_DATA_COMPATIBILITY = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:149 +Addressable::IDNA::UNICODE_DATA_EXCLUSION = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:153 +Addressable::IDNA::UNICODE_DATA_LOWERCASE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:154 +Addressable::IDNA::UNICODE_DATA_TITLECASE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:152 +Addressable::IDNA::UNICODE_DATA_UPPERCASE = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:182 +Addressable::IDNA::UNICODE_MAX_LENGTH = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:36 +Addressable::IDNA::UNICODE_TABLE = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:42 +Addressable::IDNA::UTF8_REGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/idna/pure.rb:53 +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. +# +# pkg:gem/addressable#lib/addressable/uri.rb:31 +class Addressable::URI + # Creates a new uri object from component parts. + # + # @option [String, #to_str] scheme The scheme component. + # @option [String, #to_str] user The user component. + # @option [String, #to_str] password The password component. + # @option [String, #to_str] userinfo + # The userinfo component. If this is supplied, the user and password + # components must be omitted. + # @option [String, #to_str] host The host component. + # @option [String, #to_str] port The port component. + # @option [String, #to_str] authority + # The authority component. If this is supplied, the user, password, + # userinfo, host, and port components must be omitted. + # @option [String, #to_str] path The path component. + # @option [String, #to_str] query The query component. + # @option [String, #to_str] fragment The fragment component. + # + # @return [Addressable::URI] The constructed URI object. + # + # pkg:gem/addressable#lib/addressable/uri.rb:830 + def initialize(options = T.unsafe(nil)); end + + # pkg:gem/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 [Object] uri The URI to compare. + # + # @return [TrueClass, FalseClass] + # true if the URIs are equivalent, false + # otherwise. + # + # pkg:gem/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 [Object] uri The URI to compare. + # + # @return [TrueClass, FalseClass] + # true if the URIs are equivalent, false + # otherwise. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1234 + def authority; end + + # Sets the authority component for this URI. + # + # @param [String, #to_str] new_authority The new authority component. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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 [Proc] block + # A set of operations to perform on a given URI. + # + # pkg:gem/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. + # + # pkg:gem/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" + # + # pkg:gem/addressable#lib/addressable/uri.rb:1225 + def domain; end + + # Clones the URI object. + # + # @return [Addressable::URI] The cloned URI. + # + # pkg:gem/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. + # + # pkg:gem/addressable#lib/addressable/uri.rb:2333 + def empty?; end + + # pkg:gem/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 [Object] uri The URI to compare. + # + # @return [TrueClass, FalseClass] + # true if the URIs are equivalent, false + # otherwise. + # + # pkg:gem/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. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1598 + def extname; end + + # The fragment component for this URI. + # + # @return [String] The fragment component. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1810 + def fragment; end + + # Sets the fragment component for this URI. + # + # @param [String, #to_str] new_fragment The new fragment component. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1835 + def fragment=(new_fragment); end + + # Freeze URI, initializing instance variables. + # + # @return [Addressable::URI] The frozen URI object. + # + # pkg:gem/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. + # + # pkg:gem/addressable#lib/addressable/uri.rb:2263 + def hash; end + + # The host component for this URI. + # + # @return [String] The host component. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1120 + def host; end + + # Sets the host component for this URI. + # + # @param [String, #to_str] new_host The new host component. + # + # pkg:gem/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. + # + # @see Addressable::URI#host + # + # @return [String] The hostname for this URI. + # + # pkg:gem/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'). + # + # @see Addressable::URI#host= + # + # @param [String, #to_str] new_hostname The new hostname for this URI. + # + # pkg:gem/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. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1440 + def inferred_port; end + + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1855 + def ip_based?; end + + # Joins two URIs together. + # + # @param [String, Addressable::URI, #to_str] The URI to join with. + # + # @return [Addressable::URI] The joined URI. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1889 + def join(uri); end + + # Destructive form of join. + # + # @param [String, Addressable::URI, #to_str] The URI to join with. + # + # @return [Addressable::URI] The joined URI. + # + # @see Addressable::URI#join + # + # pkg:gem/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 [Hash, Addressable::URI, #to_hash] The components to merge with. + # + # @return [Addressable::URI] The merged URI. + # + # @see Hash#merge + # + # pkg:gem/addressable#lib/addressable/uri.rb:2007 + def merge(hash); end + + # Destructive form of merge. + # + # @param [Hash, Addressable::URI, #to_hash] The components to merge with. + # + # @return [Addressable::URI] The merged URI. + # + # @see Addressable::URI#merge + # + # pkg:gem/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. + # + # pkg:gem/addressable#lib/addressable/uri.rb:2164 + def normalize; end + + # Destructively normalizes this URI object. + # + # @return [Addressable::URI] The normalized URI. + # + # @see Addressable::URI#normalize + # + # pkg:gem/addressable#lib/addressable/uri.rb:2190 + def normalize!; end + + # The authority component for this URI, normalized. + # + # @return [String] The authority component, normalized. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1252 + def normalized_authority; end + + # The fragment component for this URI, normalized. + # + # @return [String] The fragment component, normalized. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1816 + def normalized_fragment; end + + # The host component for this URI, normalized. + # + # @return [String] The host component, normalized. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1126 + def normalized_host; end + + # The password component for this URI, normalized. + # + # @return [String] The password component, normalized. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1002 + def normalized_password; end + + # The path component for this URI, normalized. + # + # @return [String] The path component, normalized. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1535 + def normalized_path; end + + # The port component for this URI, normalized. + # + # @return [Integer] The port component, normalized. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1392 + def normalized_port; end + + # The query component for this URI, normalized. + # + # @return [String] The query component, normalized. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1613 + def normalized_query(*flags); end + + # The scheme component for this URI, normalized. + # + # @return [String] The scheme component, normalized. + # + # pkg:gem/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. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1485 + def normalized_site; end + + # The user component for this URI, normalized. + # + # @return [String] The user component, normalized. + # + # pkg:gem/addressable#lib/addressable/uri.rb:947 + def normalized_user; end + + # The userinfo component for this URI, normalized. + # + # @return [String] The userinfo component, normalized. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1068 + def normalized_userinfo; end + + # Omits components from a URI. + # + # @param [Symbol] *components The components to be omitted. + # + # @return [Addressable::URI] The URI with components omitted. + # + # @example + # uri = Addressable::URI.parse("http://example.com/path?query") + # #=> # + # uri.omit(:scheme, :authority) + # #=> # + # + # pkg:gem/addressable#lib/addressable/uri.rb:2297 + def omit(*components); end + + # Destructive form of omit. + # + # @param [Symbol] *components The components to be omitted. + # + # @return [Addressable::URI] The URI with components omitted. + # + # @see Addressable::URI#omit + # + # pkg:gem/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. + # + # pkg:gem/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 [String, #to_str] new_origin The new origin component. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1333 + def origin=(new_origin); end + + # The password component for this URI. + # + # @return [String] The password component. + # + # pkg:gem/addressable#lib/addressable/uri.rb:996 + def password; end + + # Sets the password component for this URI. + # + # @param [String, #to_str] new_password The new password component. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1025 + def password=(new_password); end + + # The path component for this URI. + # + # @return [String] The path component. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1528 + def path; end + + # Sets the path component for this URI. + # + # @param [String, #to_str] new_path The new path component. + # + # pkg:gem/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. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1386 + def port; end + + # Sets the port component for this URI. + # + # @param [String, Integer, #to_s] new_port The new port component. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1408 + def port=(new_port); end + + # The query component for this URI. + # + # @return [String] The query component. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1607 + def query; end + + # Sets the query component for this URI. + # + # @param [String, #to_str] new_query The new query component. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1641 + def query=(new_query); end + + # Converts the query component to a Hash value. + # + # @param [Class] return_type 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. + # + # @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 + # + # pkg:gem/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. + # + # @param [Hash, #to_hash, Array] new_query_values The new query values. + # + # @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" + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1774 + def request_uri; end + + # Sets the HTTP request URI for this URI. + # + # @param [String, #to_str] new_request_uri The new HTTP request URI. + # + # pkg:gem/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 [String, Addressable::URI, #to_str] uri The URI to route from. + # + # @return [Addressable::URI] + # The normalized relative URI that is equivalent to the original URI. + # + # pkg:gem/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 [String, Addressable::URI, #to_str] uri The URI to route to. + # + # @return [Addressable::URI] + # The normalized relative URI that is equivalent to the supplied URI. + # + # pkg:gem/addressable#lib/addressable/uri.rb:2150 + def route_to(uri); end + + # The scheme component for this URI. + # + # @return [String] The scheme component. + # + # pkg:gem/addressable#lib/addressable/uri.rb:890 + def scheme; end + + # Sets the scheme component for this URI. + # + # @param [String, #to_str] new_scheme The new scheme component. + # + # pkg:gem/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. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1467 + def site; end + + # Sets the site value for this URI. + # + # @param [String, #to_str] new_site The new site value. + # + # pkg:gem/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" + # + # pkg:gem/addressable#lib/addressable/uri.rb:1207 + def tld; end + + # Sets the top-level domain for this URI. + # + # @param [String, #to_str] new_tld The new top-level domain. + # + # pkg:gem/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. + # + # pkg:gem/addressable#lib/addressable/uri.rb:2367 + def to_hash; end + + # Converts the URI to a String. + # + # @return [String] The URI's String representation. + # + # pkg:gem/addressable#lib/addressable/uri.rb:2341 + def to_s; end + + # URI's are glorified Strings. Allow implicit conversion. + # + # pkg:gem/addressable#lib/addressable/uri.rb:2361 + def to_str; end + + # The user component for this URI. + # + # @return [String] The user component. + # + # pkg:gem/addressable#lib/addressable/uri.rb:941 + def user; end + + # Sets the user component for this URI. + # + # @param [String, #to_str] new_user The new user component. + # + # pkg:gem/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. + # + # pkg:gem/addressable#lib/addressable/uri.rb:1052 + def userinfo; end + + # Sets the userinfo component for this URI. + # + # @param [String, #to_str] new_userinfo The new userinfo component. + # + # pkg:gem/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 + # + # pkg:gem/addressable#lib/addressable/uri.rb:2561 + def force_utf8_encoding_if_needed(str); end + + # Resets composite values for the entire URI + # + # @api private + # + # pkg:gem/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 [Addressable::URI] uri The URI to replace self with. + # + # @return [Addressable::URI] self. + # + # pkg:gem/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 [String] path The path to split. + # + # @return [Array] An array of parts of path. + # + # pkg:gem/addressable#lib/addressable/uri.rb:2542 + def split_path(path); end + + # Ensures that the URI is valid. + # + # pkg:gem/addressable#lib/addressable/uri.rb:2476 + def validate; end + + private + + # Resets instance variables + # + # @api private + # + # pkg:gem/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. + # + # @param [String, Addressable::URI, #to_str] path + # 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. + # + # @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/" + # + # pkg:gem/addressable#lib/addressable/uri.rb:292 + def convert_path(path); end + + # Percent encodes any special characters in the URI. + # + # @param [String, Addressable::URI, #to_str] uri + # The URI to encode. + # + # @param [Class] return_type + # 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. + # + # @return [String, Addressable::URI] + # The encoded URI. + # The return type is determined by the return_type + # parameter. + # + # pkg:gem/addressable#lib/addressable/uri.rb:616 + def encode(uri, return_type = T.unsafe(nil)); end + + # Percent encodes a URI component. + # + # @param [String, #to_str] component The URI component to encode. + # + # @param [String, Regexp] character_class + # 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 [Regexp] upcase_encoded + # 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. + # + # @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" + # + # pkg:gem/addressable#lib/addressable/uri.rb:403 + def encode_component(component, character_class = T.unsafe(nil), upcase_encoded = T.unsafe(nil)); end + + # pkg:gem/addressable#lib/addressable/uri.rb:651 + def escape(uri, return_type = T.unsafe(nil)); end + + # pkg:gem/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 [#to_hash, #to_ary] form_values + # The form values to encode. + # + # @param [TrueClass, FalseClass] sort + # Sort the key/value pairs prior to encoding. + # Defaults to false. + # + # @return [String] + # The encoded value. + # + # pkg:gem/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 [String, #to_str] encoded_value + # The form values to decode. + # + # @return [Array] + # The decoded values. + # This is not a Hash because of the possibility for + # duplicate keys. + # + # pkg:gem/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 [String, Addressable::URI, #to_str] uri + # The URI string to parse. + # No parsing is performed if the object is already an + # Addressable::URI. + # @param [Hash] hints + # A Hash of hints to the heuristic parser. + # Defaults to {:scheme => "http"}. + # + # @return [Addressable::URI] The parsed URI. + # + # pkg:gem/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: + # //:@:/ + # + # pkg:gem/addressable#lib/addressable/uri.rb:1369 + def ip_based_schemes; end + + # Joins several URIs together. + # + # @param [String, Addressable::URI, #to_str] *uris + # The URIs to join. + # + # @return [Addressable::URI] The joined URI. + # + # @example + # base = "http://example.com/" + # uri = Addressable::URI.parse("relative/path") + # Addressable::URI.join(base, uri) + # #=> # + # + # pkg:gem/addressable#lib/addressable/uri.rb:343 + def join(*uris); end + + # Normalizes the encoding of a URI component. + # + # @param [String, #to_str] component The URI component to encode. + # + # @param [String, Regexp] character_class + # 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 [String] leave_encoded + # 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. + # + # @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" + # + # pkg:gem/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 [String] path The path to normalize. + # + # @return [String] The normalized path. + # + # pkg:gem/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 [String, Addressable::URI, #to_str] uri + # The URI to encode. + # + # @param [Class] return_type + # 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. + # + # @return [String, Addressable::URI] + # The encoded URI. + # The return type is determined by the return_type + # parameter. + # + # pkg:gem/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 [String, Addressable::URI, #to_str] uri + # The URI string to parse. + # No parsing is performed if the object is already an + # Addressable::URI. + # + # @return [Addressable::URI] The parsed URI. + # + # pkg:gem/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. + # + # pkg:gem/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 [String, Addressable::URI, #to_str] uri + # The URI or component to unencode. + # + # @param [Class] return_type + # 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 [String] leave_encoded + # A string of characters to leave encoded. If a percent encoded character + # in this list is encountered then it will remain percent encoded. + # + # @return [String, Addressable::URI] + # The unencoded component or URI. + # The return type is determined by the return_type + # parameter. + # + # pkg:gem/addressable#lib/addressable/uri.rb:472 + def unencode(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end + + # pkg:gem/addressable#lib/addressable/uri.rb:502 + def unencode_component(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end + + # pkg:gem/addressable#lib/addressable/uri.rb:501 + def unescape(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end + + # pkg:gem/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 +# +# pkg:gem/addressable#lib/addressable/uri.rb:46 +module Addressable::URI::CharacterClasses; end + +# pkg:gem/addressable#lib/addressable/uri.rb:47 +Addressable::URI::CharacterClasses::ALPHA = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/uri.rb:57 +Addressable::URI::CharacterClasses::AUTHORITY = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/uri.rb:48 +Addressable::URI::CharacterClasses::DIGIT = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/uri.rb:60 +Addressable::URI::CharacterClasses::FRAGMENT = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/uri.rb:49 +Addressable::URI::CharacterClasses::GEN_DELIMS = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/uri.rb:56 +Addressable::URI::CharacterClasses::HOST = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/uri.rb:58 +Addressable::URI::CharacterClasses::PATH = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/uri.rb:54 +Addressable::URI::CharacterClasses::PCHAR = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/uri.rb:59 +Addressable::URI::CharacterClasses::QUERY = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/uri.rb:51 +Addressable::URI::CharacterClasses::RESERVED = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/uri.rb:53 +Addressable::URI::CharacterClasses::RESERVED_AND_UNRESERVED = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/uri.rb:55 +Addressable::URI::CharacterClasses::SCHEME = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/uri.rb:50 +Addressable::URI::CharacterClasses::SUB_DELIMS = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/uri.rb:52 +Addressable::URI::CharacterClasses::UNRESERVED = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/uri.rb:72 +module Addressable::URI::CharacterClassesRegexps; end + +# pkg:gem/addressable#lib/addressable/uri.rb:73 +Addressable::URI::CharacterClassesRegexps::AUTHORITY = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/uri.rb:74 +Addressable::URI::CharacterClassesRegexps::FRAGMENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/uri.rb:75 +Addressable::URI::CharacterClassesRegexps::HOST = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/uri.rb:76 +Addressable::URI::CharacterClassesRegexps::PATH = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/uri.rb:77 +Addressable::URI::CharacterClassesRegexps::QUERY = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/uri.rb:78 +Addressable::URI::CharacterClassesRegexps::RESERVED = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/uri.rb:79 +Addressable::URI::CharacterClassesRegexps::RESERVED_AND_UNRESERVED = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/uri.rb:80 +Addressable::URI::CharacterClassesRegexps::SCHEME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/uri.rb:81 +Addressable::URI::CharacterClassesRegexps::UNRESERVED = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/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. +# +# pkg:gem/addressable#lib/addressable/uri.rb:34 +class Addressable::URI::InvalidURIError < ::StandardError; end + +# pkg:gem/addressable#lib/addressable/uri.rb:2598 +module Addressable::URI::NONE; end + +# pkg:gem/addressable#lib/addressable/uri.rb:1530 +Addressable::URI::NORMPATH = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/uri.rb:63 +module Addressable::URI::NormalizeCharacterClasses; end + +# pkg:gem/addressable#lib/addressable/uri.rb:68 +Addressable::URI::NormalizeCharacterClasses::FRAGMENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/uri.rb:64 +Addressable::URI::NormalizeCharacterClasses::HOST = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/uri.rb:66 +Addressable::URI::NormalizeCharacterClasses::PCHAR = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/uri.rb:69 +Addressable::URI::NormalizeCharacterClasses::QUERY = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/uri.rb:67 +Addressable::URI::NormalizeCharacterClasses::SCHEME = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/uri.rb:65 +Addressable::URI::NormalizeCharacterClasses::UNRESERVED = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/uri.rb:2427 +Addressable::URI::PARENT = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/uri.rb:89 +Addressable::URI::PORT_MAPPING = T.let(T.unsafe(nil), Hash) + +# pkg:gem/addressable#lib/addressable/uri.rb:2429 +Addressable::URI::RULE_2A = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/uri.rb:2430 +Addressable::URI::RULE_2B_2C = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/uri.rb:2431 +Addressable::URI::RULE_2D = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/uri.rb:2432 +Addressable::URI::RULE_PREFIXED_PARENT = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/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` +# +# pkg:gem/addressable#lib/addressable/uri.rb:360 +Addressable::URI::SEQUENCE_ENCODING_TABLE = T.let(T.unsafe(nil), Array) + +# pkg:gem/addressable#lib/addressable/uri.rb:364 +Addressable::URI::SEQUENCE_UPCASED_PERCENT_ENCODING_TABLE = T.let(T.unsafe(nil), Array) + +# pkg:gem/addressable#lib/addressable/uri.rb:84 +Addressable::URI::SLASH = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/uri.rb:87 +Addressable::URI::URIREGEX = T.let(T.unsafe(nil), Regexp) + +# pkg:gem/addressable#lib/addressable/version.rb:23 +module Addressable::VERSION; end + +# pkg:gem/addressable#lib/addressable/version.rb:24 +Addressable::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/version.rb:25 +Addressable::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# pkg:gem/addressable#lib/addressable/version.rb:28 +Addressable::VERSION::STRING = T.let(T.unsafe(nil), String) + +# pkg:gem/addressable#lib/addressable/version.rb:26 +Addressable::VERSION::TINY = T.let(T.unsafe(nil), Integer) diff --git a/sorbet/rbi/gems/argon2@2.3.0.rbi b/sorbet/rbi/gems/argon2@2.3.0.rbi new file mode 100644 index 000000000..007dccae3 --- /dev/null +++ b/sorbet/rbi/gems/argon2@2.3.0.rbi @@ -0,0 +1,231 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `argon2` gem. +# Please instead update this file by running `bin/tapioca gem argon2`. + + +# Defines an array of errors that matches the enum list of errors from +# argon2.h. This allows return values to propagate errors through the FFI. +# Standard Gem version constant. +# +# pkg:gem/argon2#lib/argon2/constants.rb:3 +module Argon2; end + +# pkg:gem/argon2#lib/argon2/errors.rb:7 +class Argon2::ArgonHashFail < ::StandardError; end + +# Constants utilised in several parts of the Argon2 module +# SALT_LEN is a standard recommendation from the Argon2 spec. +# +# pkg:gem/argon2#lib/argon2/constants.rb:7 +module Argon2::Constants; end + +# Binary, unencoded output +# +# pkg:gem/argon2#lib/argon2/constants.rb:10 +Argon2::Constants::ENCODE_LEN = T.let(T.unsafe(nil), Integer) + +# pkg:gem/argon2#lib/argon2/constants.rb:9 +Argon2::Constants::OUT_LEN = T.let(T.unsafe(nil), Integer) + +# pkg:gem/argon2#lib/argon2/constants.rb:8 +Argon2::Constants::SALT_LEN = T.let(T.unsafe(nil), Integer) + +# pkg:gem/argon2#lib/argon2/errors.rb:8 +Argon2::ERRORS = T.let(T.unsafe(nil), Array) + +# Generates a random, binary string for use as a salt. +# The engine class shields users from the FFI interface. +# It is generally not advised to directly use this class. +# +# pkg:gem/argon2#lib/argon2/ffi_engine.rb:48 +class Argon2::Engine + class << self + # pkg:gem/argon2#lib/argon2/ffi_engine.rb:98 + def argon2_verify(pwd, hash, secret); end + + # pkg:gem/argon2#lib/argon2/ffi_engine.rb:49 + def hash_argon2i(password, salt, t_cost, m_cost, out_len = T.unsafe(nil)); end + + # pkg:gem/argon2#lib/argon2/ffi_engine.rb:65 + def hash_argon2id(password, salt, t_cost, m_cost, p_cost, out_len = T.unsafe(nil)); end + + # pkg:gem/argon2#lib/argon2/ffi_engine.rb:81 + def hash_argon2id_encode(password, salt, t_cost, m_cost, p_cost, secret); end + + # pkg:gem/argon2#lib/argon2/engine.rb:8 + def saltgen; end + end +end + +# Direct external bindings. Call these methods via the Engine class to ensure points are dealt with +# +# pkg:gem/argon2#lib/argon2/ffi_engine.rb:8 +module Argon2::Ext + extend ::FFI::Library + + # pkg:gem/argon2#lib/argon2/ffi_engine.rb:35 + def argon2_wrap(*_arg0); end + + # pkg:gem/argon2#lib/argon2/ffi_engine.rb:17 + def argon2i_hash_raw(*_arg0); end + + # pkg:gem/argon2#lib/argon2/ffi_engine.rb:26 + def argon2id_hash_raw(*_arg0); end + + # pkg:gem/argon2#lib/argon2/ffi_engine.rb:42 + def wrap_argon2_verify(*_arg0); end + + class << self + # pkg:gem/argon2#lib/argon2/ffi_engine.rb:35 + def argon2_wrap(*_arg0); end + + # pkg:gem/argon2#lib/argon2/ffi_engine.rb:17 + def argon2i_hash_raw(*_arg0); end + + # pkg:gem/argon2#lib/argon2/ffi_engine.rb:26 + def argon2id_hash_raw(*_arg0); end + + # pkg:gem/argon2#lib/argon2/ffi_engine.rb:42 + def wrap_argon2_verify(*_arg0); end + end +end + +# Get the values from an Argon2 compatible string. +# +# pkg:gem/argon2#lib/argon2/hash_format.rb:7 +class Argon2::HashFormat + # FIXME: Reduce complexity/AbcSize + # + # pkg:gem/argon2#lib/argon2/hash_format.rb:12 + def initialize(digest); end + + # pkg:gem/argon2#lib/argon2/hash_format.rb:8 + def checksum; end + + # pkg:gem/argon2#lib/argon2/hash_format.rb:8 + def m_cost; end + + # pkg:gem/argon2#lib/argon2/hash_format.rb:8 + def p_cost; end + + # pkg:gem/argon2#lib/argon2/hash_format.rb:8 + def salt; end + + # pkg:gem/argon2#lib/argon2/hash_format.rb:8 + def t_cost; end + + # pkg:gem/argon2#lib/argon2/hash_format.rb:8 + def variant; end + + # pkg:gem/argon2#lib/argon2/hash_format.rb:8 + def version; end + + class << self + # Checks whether a given digest is a valid Argon2 hash. + # + # Supports 1 and argon2id formats. + # + # pkg:gem/argon2#lib/argon2/hash_format.rb:45 + def valid_hash?(digest); end + end +end + +# Front-end API for the Argon2 module. +# +# pkg:gem/argon2#lib/argon2.rb:13 +class Argon2::Password + # pkg:gem/argon2#lib/argon2.rb:25 + def initialize(options = T.unsafe(nil)); end + + # pkg:gem/argon2#lib/argon2.rb:34 + def create(pass); end + + protected + + # pkg:gem/argon2#lib/argon2.rb:63 + def init_costs(options = T.unsafe(nil)); end + + class << self + # Helper class, just creates defaults and calls hash() + # + # pkg:gem/argon2#lib/argon2.rb:46 + def create(pass, options = T.unsafe(nil)); end + + # pkg:gem/argon2#lib/argon2.rb:51 + def valid_hash?(hash); end + + # pkg:gem/argon2#lib/argon2.rb:55 + def verify_password(pass, hash, secret = T.unsafe(nil)); end + end +end + +# pkg:gem/argon2#lib/argon2.rb:16 +Argon2::Password::DEFAULT_M_COST = T.let(T.unsafe(nil), Integer) + +# pkg:gem/argon2#lib/argon2.rb:17 +Argon2::Password::DEFAULT_P_COST = T.let(T.unsafe(nil), Integer) + +# Expose constants for the options supported and default used for passwords. +# +# pkg:gem/argon2#lib/argon2.rb:15 +Argon2::Password::DEFAULT_T_COST = T.let(T.unsafe(nil), Integer) + +# pkg:gem/argon2#lib/argon2.rb:21 +Argon2::Password::MAX_M_COST = T.let(T.unsafe(nil), Integer) + +# pkg:gem/argon2#lib/argon2.rb:23 +Argon2::Password::MAX_P_COST = T.let(T.unsafe(nil), Integer) + +# pkg:gem/argon2#lib/argon2.rb:19 +Argon2::Password::MAX_T_COST = T.let(T.unsafe(nil), Integer) + +# pkg:gem/argon2#lib/argon2.rb:20 +Argon2::Password::MIN_M_COST = T.let(T.unsafe(nil), Integer) + +# pkg:gem/argon2#lib/argon2.rb:22 +Argon2::Password::MIN_P_COST = T.let(T.unsafe(nil), Integer) + +# pkg:gem/argon2#lib/argon2.rb:18 +Argon2::Password::MIN_T_COST = T.let(T.unsafe(nil), Integer) + +# Contains named profiles of different common cost parameter sets +# +# pkg:gem/argon2#lib/argon2/profiles.rb:5 +class Argon2::Profiles + class << self + # pkg:gem/argon2#lib/argon2/profiles.rb:6 + def [](name); end + + # pkg:gem/argon2#lib/argon2/profiles.rb:13 + def to_a; end + + # pkg:gem/argon2#lib/argon2/profiles.rb:17 + def to_h; end + end +end + +# The default values ruby-argon2 had before using RFC 9106 recommendations +# +# pkg:gem/argon2#lib/argon2/profiles.rb:37 +Argon2::Profiles::PRE_RFC_9106 = T.let(T.unsafe(nil), Hash) + +# https://datatracker.ietf.org/doc/html/rfc9106#name-argon2-algorithm +# FIRST RECOMMENDED option per RFC 9106. +# +# pkg:gem/argon2#lib/argon2/profiles.rb:23 +Argon2::Profiles::RFC_9106_HIGH_MEMORY = T.let(T.unsafe(nil), Hash) + +# SECOND RECOMMENDED option per RFC 9106. +# +# pkg:gem/argon2#lib/argon2/profiles.rb:30 +Argon2::Profiles::RFC_9106_LOW_MEMORY = T.let(T.unsafe(nil), Hash) + +# Only use for fast testing. Insecure otherwise! +# +# pkg:gem/argon2#lib/argon2/profiles.rb:44 +Argon2::Profiles::UNSAFE_CHEAPEST = T.let(T.unsafe(nil), Hash) + +# pkg:gem/argon2#lib/argon2/version.rb:6 +Argon2::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/ast@2.4.2.rbi b/sorbet/rbi/gems/ast@2.4.2.rbi new file mode 100644 index 000000000..7ed62f7f2 --- /dev/null +++ b/sorbet/rbi/gems/ast@2.4.2.rbi @@ -0,0 +1,550 @@ +# 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. +# +# pkg:gem/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. +# +# pkg:gem/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}. + # + # pkg:gem/ast#lib/ast/node.rb:72 + def initialize(type, children = T.unsafe(nil), properties = T.unsafe(nil)); end + + # pkg:gem/ast#lib/ast/node.rb:172 + def +(array); end + + # pkg:gem/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] + # + # pkg:gem/ast#lib/ast/node.rb:153 + def ==(other); end + + # Appends `element` to `children` and returns the resulting node. + # + # @return [AST::Node] + # + # pkg:gem/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] + # + # pkg:gem/ast#lib/ast/node.rb:56 + def children; end + + # pkg:gem/ast#lib/ast/node.rb:118 + def clone; end + + # Concatenates `array` with `children` and returns the resulting node. + # + # @return [AST::Node] + # + # pkg:gem/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] + # + # pkg:gem/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 + # + # pkg:gem/ast#lib/ast/node.rb:115 + def dup; end + + # Test if other object is equal to + # @param [Object] other + # @return [Boolean] + # + # pkg:gem/ast#lib/ast/node.rb:85 + def eql?(other); end + + # Returns the precomputed hash value for this node + # @return [Fixnum] + # + # pkg:gem/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 [Integer] indent Base indentation level. + # @return [String] + # + # pkg:gem/ast#lib/ast/node.rb:211 + def inspect(indent = T.unsafe(nil)); end + + # pkg:gem/ast#lib/ast/node.rb:57 + def to_a; end + + # @return [AST::Node] self + # + # pkg:gem/ast#lib/ast/node.rb:229 + def to_ast; end + + # pkg:gem/ast#lib/ast/node.rb:204 + def to_s(indent = T.unsafe(nil)); end + + # Converts `self` to a pretty-printed s-expression. + # + # @param [Integer] indent Base indentation level. + # @return [String] + # + # pkg:gem/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] + # + # pkg:gem/ast#lib/ast/node.rb:237 + def to_sexp_array; end + + # Returns the type of this node. + # @return [Symbol] + # + # pkg:gem/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 [Symbol, nil] type + # @param [Array, nil] children + # @param [Hash, nil] properties + # @return [AST::Node] + # + # pkg:gem/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] + # + # pkg:gem/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] + # + # pkg:gem/ast#lib/ast/node.rb:264 + def fancy_type; end + + private + + # pkg:gem/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. +# +# pkg:gem/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. +# +# pkg:gem/ast#lib/ast/processor/mixin.rb:240 +module AST::Processor::Mixin + # Default handler. Does nothing. + # + # @param [AST::Node] node + # @return [AST::Node, nil] + # + # pkg:gem/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 [AST::Node, nil] node + # @return [AST::Node, nil] + # + # pkg:gem/ast#lib/ast/processor/mixin.rb:251 + def process(node); end + + # {#process}es each node from `nodes` and returns an array of + # results. + # + # @param [Array] nodes + # @return [Array] + # + # pkg:gem/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::AST do +# include 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. +# +# pkg:gem/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. + # + # pkg:gem/ast#lib/ast/sexp.rb:26 + def s(type, *children); end +end diff --git a/sorbet/rbi/gems/autoprefixer-rails@10.4.16.0.rbi b/sorbet/rbi/gems/autoprefixer-rails@10.4.16.0.rbi new file mode 100644 index 000000000..5ef668a41 --- /dev/null +++ b/sorbet/rbi/gems/autoprefixer-rails@10.4.16.0.rbi @@ -0,0 +1,177 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `autoprefixer-rails` gem. +# Please instead update this file by running `bin/tapioca gem autoprefixer-rails`. + + +# pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/railtie.rb:10 +module AutoprefixedRails; end + +# pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/railtie.rb:11 +class AutoprefixedRails::Railtie < ::Rails::Railtie + # Read browsers requirements from application or engine config + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/railtie.rb:28 + def config; end + + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/railtie.rb:49 + def roots; end +end + +# Ruby integration with Autoprefixer JS library, which parse CSS and adds +# only actual prefixed +# +# pkg:gem/autoprefixer-rails#lib/autoprefixer-rails.rb:5 +module AutoprefixerRails + class << self + # Add Autoprefixer for Sprockets environment in `assets`. + # You can specify `browsers` actual in your project. + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails.rb:21 + def install(assets, params = T.unsafe(nil)); end + + # Add prefixes to `css`. See `Processor#process` for options. + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails.rb:9 + def process(css, opts = T.unsafe(nil)); end + + # Cache processor instances + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails.rb:32 + def processor(params = T.unsafe(nil)); end + + # Disable installed Autoprefixer + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails.rb:27 + def uninstall(assets); end + end +end + +# pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/processor.rb:8 +AutoprefixerRails::IS_SECTION = T.let(T.unsafe(nil), Regexp) + +# Ruby to JS wrapper for Autoprefixer processor instance +# +# pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/processor.rb:11 +class AutoprefixerRails::Processor + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/processor.rb:14 + def initialize(params = T.unsafe(nil)); end + + # Return, which browsers and prefixes will be used + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/processor.rb:52 + def info; end + + # Parse Browserslist config + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/processor.rb:57 + def parse_config(config); end + + # Process `css` and return result. + # + # Options can be: + # * `from` with input CSS file name. Will be used in error messages. + # * `to` with output CSS file name. + # * `map` with true to generate new source map or with previous map. + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/processor.rb:24 + def process(css, opts = T.unsafe(nil)); end + + private + + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/processor.rb:159 + def build_js; end + + # Convert ruby_options to jsOptions + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/processor.rb:99 + def convert_options(opts); end + + # Try to find Browserslist config + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/processor.rb:114 + def find_config(file); end + + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/processor.rb:77 + def params_with_browsers(from = T.unsafe(nil)); end + + # Lazy load for JS library + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/processor.rb:131 + def runtime; end +end + +# pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/processor.rb:12 +AutoprefixerRails::Processor::SUPPORTED_RUNTIMES = T.let(T.unsafe(nil), Array) + +# Container of prefixed CSS and source map with changes +# +# pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/result.rb:5 +class AutoprefixerRails::Result + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/result.rb:15 + def initialize(css, map, warnings); end + + # Prefixed CSS after Autoprefixer + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/result.rb:7 + def css; end + + # Source map of changes + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/result.rb:10 + def map; end + + # Stringify prefixed CSS + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/result.rb:22 + def to_s; end + + # Warnings from Autoprefixer + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/result.rb:13 + def warnings; end +end + +# Register autoprefixer postprocessor in Sprockets and fix common issues +# +# pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/sprockets.rb:7 +class AutoprefixerRails::Sprockets + # Sprockets 2 API new and render + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/sprockets.rb:54 + def initialize(filename); end + + # Sprockets 2 API new and render + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/sprockets.rb:60 + def render(*); end + + class << self + # Sprockets 3 and 4 API + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/sprockets.rb:13 + def call(input); end + + # Register postprocessor in Sprockets depend on issues with other gems + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/sprockets.rb:32 + def install(env); end + + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/sprockets.rb:8 + def register_processor(processor); end + + # Add prefixes to `css` + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/sprockets.rb:20 + def run(filename, css); end + + # Register postprocessor in Sprockets depend on issues with other gems + # + # pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/sprockets.rb:43 + def uninstall(env); end + end +end + +# pkg:gem/autoprefixer-rails#lib/autoprefixer-rails/version.rb:4 +AutoprefixerRails::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/base64@0.2.0.rbi b/sorbet/rbi/gems/base64@0.2.0.rbi new file mode 100644 index 000000000..81e4e6811 --- /dev/null +++ b/sorbet/rbi/gems/base64@0.2.0.rbi @@ -0,0 +1,509 @@ +# 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 +str+, +# 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" +# +# pkg:gem/base64#lib/base64.rb:184 +module Base64 + private + + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +str+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # Base64.decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +str+ 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 +str+ (even if incorrect) is ignored: + # + # Base64.decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc==") # => "01234567" + # + # pkg:gem/base64#lib/base64.rb:241 + def decode64(str); end + + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. + # + # 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" + # + # pkg:gem/base64#lib/base64.rb:219 + def encode64(bin); end + + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +str+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +str+ 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 +str+, if present, must be correct: + # + # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError + # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError + # + # pkg:gem/base64#lib/base64.rb:297 + def strict_decode64(str); end + + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. + # + # 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" + # + # pkg:gem/base64#lib/base64.rb:273 + def strict_encode64(bin); end + + # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +str+: + # + # +str+ 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 +str+, 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. + # + # pkg:gem/base64#lib/base64.rb:351 + def urlsafe_decode64(str); end + + # Returns the RFC-4648-compliant \Base64-encoding of +bin+. + # + # 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==" + # + # pkg:gem/base64#lib/base64.rb:328 + def urlsafe_encode64(bin, padding: T.unsafe(nil)); end + + class << self + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +str+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" + # Base64.decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +str+ 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 +str+ (even if incorrect) is ignored: + # + # Base64.decode64("MDEyMzQ1Njc") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.decode64("MDEyMzQ1Njc==") # => "01234567" + # + # pkg:gem/base64#lib/base64.rb:241 + def decode64(str); end + + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. + # + # 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" + # + # pkg:gem/base64#lib/base64.rb:219 + def encode64(bin); end + + # Returns a string containing the decoding of an RFC-2045-compliant + # \Base64-encoded string +str+: + # + # s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK" + # Base64.strict_decode64(s) # => "This is line 1\nThis is line 2\n" + # + # Non-\Base64 characters in +str+ 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 +str+, if present, must be correct: + # + # Base64.strict_decode64("MDEyMzQ1Njc") # Raises ArgumentError + # Base64.strict_decode64("MDEyMzQ1Njc=") # => "01234567" + # Base64.strict_decode64("MDEyMzQ1Njc==") # Raises ArgumentError + # + # pkg:gem/base64#lib/base64.rb:297 + def strict_decode64(str); end + + # Returns a string containing the RFC-2045-compliant \Base64-encoding of +bin+. + # + # 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" + # + # pkg:gem/base64#lib/base64.rb:273 + def strict_encode64(bin); end + + # Returns the decoding of an RFC-4648-compliant \Base64-encoded string +str+: + # + # +str+ 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 +str+, 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. + # + # pkg:gem/base64#lib/base64.rb:351 + def urlsafe_decode64(str); end + + # Returns the RFC-4648-compliant \Base64-encoding of +bin+. + # + # 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==" + # + # pkg:gem/base64#lib/base64.rb:328 + def urlsafe_encode64(bin, padding: T.unsafe(nil)); end + end +end + +# pkg:gem/base64#lib/base64.rb:186 +Base64::VERSION = T.let(T.unsafe(nil), String) 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 000000000..98ba92828 --- /dev/null +++ b/sorbet/rbi/gems/benchmark@0.5.0.rbi @@ -0,0 +1,495 @@ +# 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) +# +# pkg:gem/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) + # + # pkg:gem/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) + # + # pkg:gem/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. + # + # pkg:gem/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) + # + # pkg:gem/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 + # + # pkg:gem/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 + # + # pkg:gem/benchmark#lib/benchmark.rb:322 + def realtime; end + + class << self + # pkg:gem/benchmark#lib/benchmark.rb:341 + def benchmark(caption = T.unsafe(nil), label_width = T.unsafe(nil), format = T.unsafe(nil), *labels); end + + # pkg:gem/benchmark#lib/benchmark.rb:341 + def bm(label_width = T.unsafe(nil), *labels, &blk); end + + # pkg:gem/benchmark#lib/benchmark.rb:341 + def bmbm(width = T.unsafe(nil)); end + + # pkg:gem/benchmark#lib/benchmark.rb:341 + def measure(label = T.unsafe(nil)); end + + # pkg:gem/benchmark#lib/benchmark.rb:341 + def ms(&block); end + + # pkg:gem/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. +# +# pkg:gem/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. + # + # pkg:gem/benchmark#lib/benchmark.rb:355 + def initialize(width); end + + # Registers the given label and block pair in the job list. + # + # pkg:gem/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. + # + # pkg:gem/benchmark#lib/benchmark.rb:375 + def list; end + + # pkg:gem/benchmark#lib/benchmark.rb:372 + def report(label = T.unsafe(nil), &blk); end + + # Length of the widest label in the #list. + # + # pkg:gem/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. +# +# pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/benchmark#lib/benchmark.rb:402 + def item(label = T.unsafe(nil), *format, &blk); end + + # An array of Benchmark::Tms objects representing each item. + # + # pkg:gem/benchmark#lib/benchmark.rb:412 + def list; end + + # pkg:gem/benchmark#lib/benchmark.rb:409 + def report(label = T.unsafe(nil), *format, &blk); end + + # An array of Benchmark::Tms objects representing each item. + # + # pkg:gem/benchmark#lib/benchmark.rb:412 + def width; end +end + +# A data object, representing the times associated with a benchmark +# measurement. +# +# pkg:gem/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. + # + # pkg:gem/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+. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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. + # + # pkg:gem/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+). + # + # pkg:gem/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+). + # + # pkg:gem/benchmark#lib/benchmark.rb:475 + def add!(&blk); end + + # System CPU time of children + # + # pkg:gem/benchmark#lib/benchmark.rb:439 + def cstime; end + + # User CPU time of children + # + # pkg:gem/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. + # + # pkg:gem/benchmark#lib/benchmark.rb:530 + def format(format = T.unsafe(nil), *args); end + + # Label + # + # pkg:gem/benchmark#lib/benchmark.rb:448 + def label; end + + # Elapsed real time + # + # pkg:gem/benchmark#lib/benchmark.rb:442 + def real; end + + # System CPU time + # + # pkg:gem/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. + # + # pkg:gem/benchmark#lib/benchmark.rb:555 + def to_a; end + + # Returns a hash containing the same data as `to_a`. + # + # pkg:gem/benchmark#lib/benchmark.rb:562 + def to_h; end + + # Same as #format. + # + # pkg:gem/benchmark#lib/benchmark.rb:545 + def to_s; end + + # Total time, that is +utime+ + +stime+ + +cutime+ + +cstime+ + # + # pkg:gem/benchmark#lib/benchmark.rb:445 + def total; end + + # User CPU time + # + # pkg:gem/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 +, -, + # *, / + # + # pkg:gem/benchmark#lib/benchmark.rb:583 + def memberwise(op, x); end +end + +# pkg:gem/benchmark#lib/benchmark.rb:125 +Benchmark::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/bigdecimal@3.1.8.rbi b/sorbet/rbi/gems/bigdecimal@3.1.8.rbi new file mode 100644 index 000000000..28cd9090c --- /dev/null +++ b/sorbet/rbi/gems/bigdecimal@3.1.8.rbi @@ -0,0 +1,233 @@ +# 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`. + + +# pkg:gem/bigdecimal#lib/bigdecimal/util.rb:78 +class BigDecimal < ::Numeric + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def %(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def *(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def **(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def +(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def +@; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def -(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def -@; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def /(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def <(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def <=(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def <=>(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def ==(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def ===(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def >(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def >=(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def _dump(*_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def abs; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def add(_arg0, _arg1); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def ceil(*_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def clone; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def coerce(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def div(*_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def divmod(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def dup; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def eql?(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def exponent; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def finite?; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def fix; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def floor(*_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def frac; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def hash; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def infinite?; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def inspect; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def modulo(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def mult(_arg0, _arg1); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def n_significant_digits; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def nan?; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def nonzero?; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def power(*_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def precision; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def precision_scale; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def precs; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def quo(*_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def remainder(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def round(*_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def scale; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def sign; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def split; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def sqrt(_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + 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 + # + # pkg:gem/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" + # + # pkg:gem/bigdecimal#lib/bigdecimal/util.rb:90 + def to_digits; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def to_f; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def to_i; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def to_int; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def to_r; end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def to_s(format = T.unsafe(nil)); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def truncate(*_arg0); end + + # pkg:gem/bigdecimal#lib/bigdecimal.rb:4 + def zero?; end +end + +BigDecimal::VERSION = T.let(T.unsafe(nil), String) + +# pkg:gem/bigdecimal#lib/bigdecimal/util.rb:138 +class Complex < ::Numeric + # call-seq: + # cmp.to_d -> bigdecimal + # cmp.to_d(precision) -> bigdecimal + # + # Returns the value as a BigDecimal. + # + # The +precision+ parameter is required for a rational complex number. + # This parameter is used to determine the number of significant digits + # for the result. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # Complex(0.1234567, 0).to_d(4) # => 0.1235e0 + # Complex(Rational(22, 7), 0).to_d(3) # => 0.314e1 + # + # See also Kernel.BigDecimal. + # + # pkg:gem/bigdecimal#lib/bigdecimal/util.rb:157 + def to_d(*args); end +end diff --git a/sorbet/rbi/gems/bootstrap@4.6.2.rbi b/sorbet/rbi/gems/bootstrap@4.6.2.rbi new file mode 100644 index 000000000..f16da2659 --- /dev/null +++ b/sorbet/rbi/gems/bootstrap@4.6.2.rbi @@ -0,0 +1,64 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `bootstrap` gem. +# Please instead update this file by running `bin/tapioca gem bootstrap`. + + +# pkg:gem/bootstrap#lib/bootstrap/version.rb:3 +module Bootstrap + class << self + # pkg:gem/bootstrap#lib/bootstrap.rb:41 + def assets_path; end + + # Paths + # + # pkg:gem/bootstrap#lib/bootstrap.rb:29 + def gem_path; end + + # pkg:gem/bootstrap#lib/bootstrap.rb:54 + def hanami?; end + + # pkg:gem/bootstrap#lib/bootstrap.rb:37 + def javascripts_path; end + + # Inspired by Kaminari + # + # pkg:gem/bootstrap#lib/bootstrap.rb:9 + def load!; end + + # pkg:gem/bootstrap#lib/bootstrap.rb:50 + def rails?; end + + # Environment detection helpers + # + # pkg:gem/bootstrap#lib/bootstrap.rb:46 + def sprockets?; end + + # pkg:gem/bootstrap#lib/bootstrap.rb:33 + def stylesheets_path; end + + private + + # pkg:gem/bootstrap#lib/bootstrap.rb:69 + def register_hanami; end + + # pkg:gem/bootstrap#lib/bootstrap.rb:60 + def register_rails_engine; end + + # pkg:gem/bootstrap#lib/bootstrap.rb:64 + def register_sprockets; end + end +end + +# pkg:gem/bootstrap#lib/bootstrap/version.rb:5 +Bootstrap::BOOTSTRAP_SHA = T.let(T.unsafe(nil), String) + +# pkg:gem/bootstrap#lib/bootstrap/engine.rb:7 +module Bootstrap::Rails; end + +# pkg:gem/bootstrap#lib/bootstrap/engine.rb:8 +class Bootstrap::Rails::Engine < ::Rails::Engine; end + +# pkg:gem/bootstrap#lib/bootstrap/version.rb:4 +Bootstrap::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/brakeman@6.1.2.rbi b/sorbet/rbi/gems/brakeman@6.1.2.rbi new file mode 100644 index 000000000..48be0da8b --- /dev/null +++ b/sorbet/rbi/gems/brakeman@6.1.2.rbi @@ -0,0 +1,219 @@ +# 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`. + + +# pkg:gem/brakeman#lib/brakeman/version.rb:1 +module Brakeman + class << self + # pkg:gem/brakeman#lib/brakeman.rb:571 + def add_external_checks(options); end + + # pkg:gem/brakeman#lib/brakeman.rb:577 + 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 + # + # pkg:gem/brakeman#lib/brakeman.rb:482 + def compare(options); end + + # pkg:gem/brakeman#lib/brakeman.rb:172 + def config_file(custom_location, app_path); end + + # pkg:gem/brakeman#lib/brakeman.rb:477 + def debug(message); end + + # pkg:gem/brakeman#lib/brakeman.rb:587 + def debug=(val); end + + # Default set of options + # + # pkg:gem/brakeman#lib/brakeman.rb:179 + def default_options; end + + # Output configuration to YAML + # + # pkg:gem/brakeman#lib/brakeman.rb:337 + def dump_config(options); end + + # pkg:gem/brakeman#lib/brakeman.rb:363 + def ensure_latest; end + + # pkg:gem/brakeman#lib/brakeman.rb:543 + def filter_warnings(tracker, options); end + + # Determine output formats based on options[:output_formats] + # or options[:output_files] + # + # pkg:gem/brakeman#lib/brakeman.rb:209 + 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). + # + # pkg:gem/brakeman#lib/brakeman.rb:533 + def ignore_file_entries_with_empty_notes(file); end + + # Output list of checks (for `-k` option) + # + # pkg:gem/brakeman#lib/brakeman.rb:315 + def list_checks(options); end + + # pkg:gem/brakeman#lib/brakeman.rb:505 + def load_brakeman_dependency(name, allow_fail = T.unsafe(nil)); end + + # Load options from YAML file + # + # pkg:gem/brakeman#lib/brakeman.rb:124 + def load_options(line_options); end + + # pkg:gem/brakeman#lib/brakeman.rb:473 + def notify(message); end + + # pkg:gem/brakeman#lib/brakeman.rb:591 + 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. + # + # pkg:gem/brakeman#lib/brakeman.rb:462 + 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 + # * :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. + # + # pkg:gem/brakeman#lib/brakeman.rb:76 + def run(options); end + + # Run a scan. Generally called from Brakeman.run instead of directly. + # + # pkg:gem/brakeman#lib/brakeman.rb:372 + def scan(options); end + + # Sets up options for run, checks given application path + # + # pkg:gem/brakeman#lib/brakeman.rb:90 + def set_options(options); end + + private + + # pkg:gem/brakeman#lib/brakeman.rb:262 + def get_formats_from_output_files(output_files); end + + # pkg:gem/brakeman#lib/brakeman.rb:228 + def get_formats_from_output_format(output_format); end + + # pkg:gem/brakeman#lib/brakeman.rb:298 + def get_github_url(options); end + + # pkg:gem/brakeman#lib/brakeman.rb:416 + def write_report_to_files(tracker, output_files); end + + # pkg:gem/brakeman#lib/brakeman.rb:434 + def write_report_to_formats(tracker, output_formats); end + end +end + +# pkg:gem/brakeman#lib/brakeman.rb:160 +Brakeman::CONFIG_FILES = T.let(T.unsafe(nil), Array) + +# pkg:gem/brakeman#lib/brakeman.rb:595 +class Brakeman::DependencyError < ::RuntimeError; end + +# Exit code returned when an ignored warning has no note and +# --ensure-ignore-notes is set +# +# pkg:gem/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 +# +# pkg:gem/brakeman#lib/brakeman.rb:21 +Brakeman::Errors_Found_Exit_Code = T.let(T.unsafe(nil), Integer) + +# pkg:gem/brakeman#lib/brakeman.rb:598 +class Brakeman::MissingChecksError < ::RuntimeError; end + +# Exit code returned when user requests non-existent checks +# +# pkg:gem/brakeman#lib/brakeman.rb:17 +Brakeman::Missing_Checks_Exit_Code = T.let(T.unsafe(nil), Integer) + +# pkg:gem/brakeman#lib/brakeman.rb:597 +class Brakeman::NoApplication < ::RuntimeError; end + +# pkg:gem/brakeman#lib/brakeman.rb:596 +class Brakeman::NoBrakemanError < ::RuntimeError; end + +# Exit code returned when no Rails application is detected +# +# pkg:gem/brakeman#lib/brakeman.rb:11 +Brakeman::No_App_Found_Exit_Code = T.let(T.unsafe(nil), Integer) + +# Exit code returned when brakeman was outdated +# +# pkg:gem/brakeman#lib/brakeman.rb:14 +Brakeman::Not_Latest_Version_Exit_Code = T.let(T.unsafe(nil), Integer) + +# pkg:gem/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 +# +# pkg:gem/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 000000000..b83a45241 --- /dev/null +++ b/sorbet/rbi/gems/builder@3.3.0.rbi @@ -0,0 +1,493 @@ +# 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`. + + +# If the Builder::XChar module is not currently defined, fail on any +# name clashes in standard library classes. +# +# !/usr/bin/env ruby +# +# pkg:gem/builder#lib/builder/xmlbase.rb:4 +module Builder + class << self + # pkg:gem/builder#lib/builder/xchar.rb:13 + def check_for_name_collision(klass, method_name, defined_constant = T.unsafe(nil)); end + end +end + +# Generic error for builder +# +# pkg:gem/builder#lib/builder/xmlbase.rb:7 +class Builder::IllegalBlockError < ::RuntimeError; end + +# XML Character converter, from Sam Ruby: +# (see http://intertwingly.net/stories/2005/09/28/xchar.rb). +# +# pkg:gem/builder#lib/builder/xchar.rb:33 +module Builder::XChar + class << self + # encode a string per XML rules + # + # pkg:gem/builder#lib/builder/xchar.rb:152 + def encode(string); end + + # convert a string to valid UTF-8, compensating for a number of + # common errors. + # + # pkg:gem/builder#lib/builder/xchar.rb:126 + def unicode(string); end + end +end + +# See +# http://intertwingly.net/stories/2004/04/14/i18n.html#CleaningWindows +# for details. +# +# pkg:gem/builder#lib/builder/xchar.rb:38 +Builder::XChar::CP1252 = T.let(T.unsafe(nil), Hash) + +# pkg:gem/builder#lib/builder/xchar.rb:100 +Builder::XChar::CP1252_DIFFERENCES = T.let(T.unsafe(nil), String) + +# pkg:gem/builder#lib/builder/xchar.rb:120 +Builder::XChar::ENCODING_BINARY = T.let(T.unsafe(nil), Encoding) + +# pkg:gem/builder#lib/builder/xchar.rb:122 +Builder::XChar::ENCODING_ISO1 = T.let(T.unsafe(nil), Encoding) + +# pkg:gem/builder#lib/builder/xchar.rb:121 +Builder::XChar::ENCODING_UTF8 = T.let(T.unsafe(nil), Encoding) + +# pkg:gem/builder#lib/builder/xchar.rb:109 +Builder::XChar::INVALID_XML_CHAR = T.let(T.unsafe(nil), Regexp) + +# See http://www.w3.org/TR/REC-xml/#dt-chardata for details. +# +# pkg:gem/builder#lib/builder/xchar.rb:69 +Builder::XChar::PREDEFINED = T.let(T.unsafe(nil), Hash) + +# http://www.fileformat.info/info/unicode/char/fffd/index.htm +# +# pkg:gem/builder#lib/builder/xchar.rb:84 +Builder::XChar::REPLACEMENT_CHAR = T.let(T.unsafe(nil), String) + +# pkg:gem/builder#lib/builder/xchar.rb:100 +Builder::XChar::UNICODE_EQUIVALENT = T.let(T.unsafe(nil), String) + +# See http://www.w3.org/TR/REC-xml/#charsets for details. +# +# pkg:gem/builder#lib/builder/xchar.rb:76 +Builder::XChar::VALID = T.let(T.unsafe(nil), Array) + +# pkg:gem/builder#lib/builder/xchar.rb:105 +Builder::XChar::XML_PREDEFINED = T.let(T.unsafe(nil), Regexp) + +# XmlBase is a base class for building XML builders. See +# Builder::XmlMarkup and Builder::XmlEvents for examples. +# +# pkg:gem/builder#lib/builder/xmlbase.rb:11 +class Builder::XmlBase < ::BasicObject + # Create an XML markup builder. + # + # out :: Object receiving the markup. +out+ must respond to + # <<. + # indent :: Number of spaces used for indentation (0 implies no + # indentation and no line breaks). + # initial :: Level of initial indentation. + # encoding :: When encoding and $KCODE are set to 'utf-8' + # characters aren't converted to character entities in + # the output stream. + # + # pkg:gem/builder#lib/builder/xmlbase.rb:27 + def initialize(indent = T.unsafe(nil), initial = T.unsafe(nil), encoding = T.unsafe(nil)); end + + # Append text to the output target without escaping any markup. + # May be used within the markup brackets as: + # + # builder.p { |x| x << "
    HI" } #=>


    HI

    + # + # This is useful when using non-builder enabled software that + # generates strings. Just insert the string directly into the + # builder without changing the inserted markup. + # + # It is also useful for stacking builder objects. Builders only + # use << to append to the target, so by supporting this + # method/operation builders can use other builders as their + # targets. + # + # pkg:gem/builder#lib/builder/xmlbase.rb:116 + def <<(text); end + + # pkg:gem/builder#lib/builder/xmlbase.rb:33 + def explicit_nil_handling?; end + + # Create XML markup based on the name of the method. This method + # is never invoked directly, but is called for each markup method + # in the markup block that isn't cached. + # + # pkg:gem/builder#lib/builder/xmlbase.rb:90 + def method_missing(sym, *args, &block); end + + # For some reason, nil? is sent to the XmlMarkup object. If nil? + # is not defined and method_missing is invoked, some strange kind + # of recursion happens. Since nil? won't ever be an XML tag, it + # is pretty safe to define it here. (Note: this is an example of + # cargo cult programming, + # cf. http://fishbowl.pastiche.org/2004/10/13/cargo_cult_programming). + # + # pkg:gem/builder#lib/builder/xmlbase.rb:126 + def nil?; end + + # Create a tag named +sym+. Other than the first argument which + # is the tag name, the arguments are the same as the tags + # implemented via method_missing. + # + # pkg:gem/builder#lib/builder/xmlbase.rb:40 + def tag!(sym, *args, &block); end + + # Append text to the output target. Escape any markup. May be + # used within the markup brackets as: + # + # builder.p { |b| b.br; b.text! "HI" } #=>


    HI

    + # + # pkg:gem/builder#lib/builder/xmlbase.rb:99 + def text!(text); end + + private + + # pkg:gem/builder#lib/builder/xmlbase.rb:134 + def _escape(text); end + + # pkg:gem/builder#lib/builder/xmlbase.rb:157 + def _escape_attribute(text); end + + # pkg:gem/builder#lib/builder/xmlbase.rb:167 + def _indent; end + + # pkg:gem/builder#lib/builder/xmlbase.rb:172 + def _nested_structures(block); end + + # pkg:gem/builder#lib/builder/xmlbase.rb:162 + def _newline; end + + # If XmlBase.cache_method_calls = true, we dynamicly create the method + # missed as an instance method on the XMLBase object. Because XML + # documents are usually very repetative in nature, the next node will + # be handled by the new method instead of method_missing. As + # method_missing is very slow, this speeds up document generation + # significantly. + # + # pkg:gem/builder#lib/builder/xmlbase.rb:185 + def cache_method_call(sym); end + + class << self + # pkg:gem/builder#lib/builder/xmlbase.rb:14 + def cache_method_calls; end + + # pkg:gem/builder#lib/builder/xmlbase.rb:14 + def cache_method_calls=(_arg0); end + end +end + +# Create a series of SAX-like XML events (e.g. start_tag, end_tag) +# from the markup code. XmlEvent objects are used in a way similar +# to XmlMarkup objects, except that a series of events are generated +# and passed to a handler rather than generating character-based +# markup. +# +# Usage: +# xe = Builder::XmlEvents.new(hander) +# xe.title("HI") # Sends start_tag/end_tag/text messages to the handler. +# +# Indentation may also be selected by providing value for the +# indentation size and initial indentation level. +# +# xe = Builder::XmlEvents.new(handler, indent_size, initial_indent_level) +# +# == XML Event Handler +# +# The handler object must expect the following events. +# +# [start_tag(tag, attrs)] +# Announces that a new tag has been found. +tag+ is the name of +# the tag and +attrs+ is a hash of attributes for the tag. +# +# [end_tag(tag)] +# Announces that an end tag for +tag+ has been found. +# +# [text(text)] +# Announces that a string of characters (+text+) has been found. +# A series of characters may be broken up into more than one +# +text+ call, so the client cannot assume that a single +# callback contains all the text data. +# +# pkg:gem/builder#lib/builder/xmlevents.rb:49 +class Builder::XmlEvents < ::Builder::XmlMarkup + # pkg:gem/builder#lib/builder/xmlevents.rb:59 + def _end_tag(sym); end + + # pkg:gem/builder#lib/builder/xmlevents.rb:54 + def _start_tag(sym, attrs, end_too = T.unsafe(nil)); end + + # pkg:gem/builder#lib/builder/xmlevents.rb:50 + def text!(text); end +end + +# Create XML markup easily. All (well, almost all) methods sent to +# an XmlMarkup object will be translated to the equivalent XML +# markup. Any method with a block will be treated as an XML markup +# tag with nested markup in the block. +# +# Examples will demonstrate this easier than words. In the +# following, +xm+ is an +XmlMarkup+ object. +# +# xm.em("emphasized") # => emphasized +# xm.em { xm.b("emp & bold") } # => emph & bold +# xm.a("A Link", "href"=>"http://onestepback.org") +# # => A Link +# xm.div { xm.br } # =>

    +# xm.target("name"=>"compile", "option"=>"fast") +# # => +# # NOTE: order of attributes is not specified. +# +# xm.instruct! # +# xm.html { # +# xm.head { # +# xm.title("History") # History +# } # +# xm.body { # +# xm.comment! "HI" # +# xm.h1("Header") #

    Header

    +# xm.p("paragraph") #

    paragraph

    +# } # +# } # +# +# == Notes: +# +# * The order that attributes are inserted in markup tags is +# undefined. +# +# * Sometimes you wish to insert text without enclosing tags. Use +# the text! method to accomplish this. +# +# Example: +# +# xm.div { #
    +# xm.text! "line"; xm.br # line
    +# xm.text! "another line"; xmbr # another line
    +# } #
    +# +# * The special XML characters <, >, and & are converted to <, +# > and & automatically. Use the << operation to +# insert text without modification. +# +# * Sometimes tags use special characters not allowed in ruby +# identifiers. Use the tag! method to handle these +# cases. +# +# Example: +# +# xml.tag!("SOAP:Envelope") { ... } +# +# will produce ... +# +# ... " +# +# tag! will also take text and attribute arguments (after +# the tag name) like normal markup methods. (But see the next +# bullet item for a better way to handle XML namespaces). +# +# * Direct support for XML namespaces is now available. If the +# first argument to a tag call is a symbol, it will be joined to +# the tag to produce a namespace:tag combination. It is easier to +# show this than describe it. +# +# xml.SOAP :Envelope do ... end +# +# Just put a space before the colon in a namespace to produce the +# right form for builder (e.g. "SOAP:Envelope" => +# "xml.SOAP :Envelope") +# +# * XmlMarkup builds the markup in any object (called a _target_) +# that accepts the << method. If no target is given, +# then XmlMarkup defaults to a string target. +# +# Examples: +# +# xm = Builder::XmlMarkup.new +# result = xm.title("yada") +# # result is a string containing the markup. +# +# buffer = "" +# xm = Builder::XmlMarkup.new(buffer) +# # The markup is appended to buffer (using <<) +# +# xm = Builder::XmlMarkup.new(STDOUT) +# # The markup is written to STDOUT (using <<) +# +# xm = Builder::XmlMarkup.new +# x2 = Builder::XmlMarkup.new(:target=>xm) +# # Markup written to +x2+ will be send to +xm+. +# +# * Indentation is enabled by providing the number of spaces to +# indent for each level as a second argument to XmlBuilder.new. +# Initial indentation may be specified using a third parameter. +# +# Example: +# +# xm = Builder::XmlMarkup.new(:indent=>2) +# # xm will produce nicely formatted and indented XML. +# +# xm = Builder::XmlMarkup.new(:indent=>2, :margin=>4) +# # xm will produce nicely formatted and indented XML with 2 +# # spaces per indent and an over all indentation level of 4. +# +# builder = Builder::XmlMarkup.new(:target=>$stdout, :indent=>2) +# builder.name { |b| b.first("Jim"); b.last("Weirich") } +# # prints: +# # +# # Jim +# # Weirich +# # +# +# * The instance_eval implementation which forces self to refer to +# the message receiver as self is now obsolete. We now use normal +# block calls to execute the markup block. This means that all +# markup methods must now be explicitly send to the xml builder. +# For instance, instead of +# +# xml.div { strong("text") } +# +# you need to write: +# +# xml.div { xml.strong("text") } +# +# Although more verbose, the subtle change in semantics within the +# block was found to be prone to error. To make this change a +# little less cumbersome, the markup block now gets the markup +# object sent as an argument, allowing you to use a shorter alias +# within the block. +# +# For example: +# +# xml_builder = Builder::XmlMarkup.new +# xml_builder.div { |xml| +# xml.strong("text") +# } +# +# pkg:gem/builder#lib/builder/xmlmarkup.rb:161 +class Builder::XmlMarkup < ::Builder::XmlBase + # Create an XML markup builder. Parameters are specified by an + # option hash. + # + # :target => target_object:: + # Object receiving the markup. +target_object+ must respond to + # the <<(a_string) operator and return + # itself. The default target is a plain string target. + # + # :indent => indentation:: + # Number of spaces used for indentation. The default is no + # indentation and no line breaks. + # + # :margin => initial_indentation_level:: + # Amount of initial indentation (specified in levels, not + # spaces). + # + # :quote => :single:: + # Use single quotes for attributes rather than double quotes. + # + # :escape_attrs => OBSOLETE:: + # The :escape_attrs option is no longer supported by builder + # (and will be quietly ignored). String attribute values are + # now automatically escaped. If you need unescaped attribute + # values (perhaps you are using entities in the attribute + # values), then give the value as a Symbol. This allows much + # finer control over escaping attribute values. + # + # pkg:gem/builder#lib/builder/xmlmarkup.rb:190 + def initialize(options = T.unsafe(nil)); end + + # Insert a CDATA section into the XML markup. + # + # For example: + # + # xml.cdata!("text to be included in cdata") + # #=> + # + # pkg:gem/builder#lib/builder/xmlmarkup.rb:270 + def cdata!(text); end + + # pkg:gem/builder#lib/builder/xmlmarkup.rb:275 + def cdata_value!(open, text); end + + # pkg:gem/builder#lib/builder/xmlmarkup.rb:204 + def comment!(comment_text); end + + # Insert an XML declaration into the XML markup. + # + # For example: + # + # xml.declare! :ELEMENT, :blah, "yada" + # # => + # + # pkg:gem/builder#lib/builder/xmlmarkup.rb:215 + def declare!(inst, *args, &block); end + + # Insert a processing instruction into the XML markup. E.g. + # + # For example: + # + # xml.instruct! + # #=> + # xml.instruct! :aaa, :bbb=>"ccc" + # #=> + # + # Note: If the encoding is setup to "UTF-8" and the value of + # $KCODE is "UTF8", then builder will emit UTF-8 encoded strings + # rather than the entity encoding normally used. + # + # pkg:gem/builder#lib/builder/xmlmarkup.rb:248 + def instruct!(directive_tag = T.unsafe(nil), attrs = T.unsafe(nil)); end + + # Return the target of the builder. + # + # pkg:gem/builder#lib/builder/xmlmarkup.rb:200 + def target!; end + + private + + # pkg:gem/builder#lib/builder/xmlmarkup.rb:326 + def _attr_value(value); end + + # Insert an ending tag. + # + # pkg:gem/builder#lib/builder/xmlmarkup.rb:310 + def _end_tag(sym); end + + # pkg:gem/builder#lib/builder/xmlmarkup.rb:335 + def _ensure_no_block(got_block); end + + # Insert the attributes (given in the hash). + # + # pkg:gem/builder#lib/builder/xmlmarkup.rb:315 + def _insert_attributes(attrs, order = T.unsafe(nil)); end + + # Insert special instruction. + # + # pkg:gem/builder#lib/builder/xmlmarkup.rb:291 + def _special(open, close, data = T.unsafe(nil), attrs = T.unsafe(nil), order = T.unsafe(nil)); end + + # Start an XML tag. If end_too is true, then the start + # tag is also the end tag (e.g.
    + # + # pkg:gem/builder#lib/builder/xmlmarkup.rb:302 + def _start_tag(sym, attrs, end_too = T.unsafe(nil)); end + + # Insert text directly in to the builder's target. + # + # pkg:gem/builder#lib/builder/xmlmarkup.rb:286 + def _text(text); end +end diff --git a/sorbet/rbi/gems/bundler-audit@0.9.1.rbi b/sorbet/rbi/gems/bundler-audit@0.9.1.rbi new file mode 100644 index 000000000..bac0f27d1 --- /dev/null +++ b/sorbet/rbi/gems/bundler-audit@0.9.1.rbi @@ -0,0 +1,394 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `bundler-audit` gem. +# Please instead update this file by running `bin/tapioca gem bundler-audit`. + + +# pkg:gem/bundler-audit#lib/bundler/audit/advisory.rb:22 +module Bundler::Audit; end + +# Represents an advisory loaded from the {Database}. +# +# pkg:gem/bundler-audit#lib/bundler/audit/advisory.rb:38 +class Bundler::Audit::Advisory < ::Struct + # Compares two advisories. + # + # @param [Advisory] other + # + # @return [Boolean] + # + # pkg:gem/bundler-audit#lib/bundler/audit/advisory.rb:210 + def ==(other); end + + # Determines how critical the vulnerability is. + # + # @return [:none, :low, :medium, :high, :critical, nil] + # The criticality of the vulnerability based on the CVSS score. + # + # pkg:gem/bundler-audit#lib/bundler/audit/advisory.rb:138 + def criticality; end + + # The CVE identifier. + # + # @return [String, nil] + # + # pkg:gem/bundler-audit#lib/bundler/audit/advisory.rb:93 + def cve_id; end + + # The GHSA (GitHub Security Advisory) identifier + # + # @return [String, nil] + # + # @since 0.7.0 + # + # pkg:gem/bundler-audit#lib/bundler/audit/advisory.rb:113 + def ghsa_id; end + + # Return a compacted list of all ids + # + # @return [Array] + # + # @since 0.7.0 + # + # pkg:gem/bundler-audit#lib/bundler/audit/advisory.rb:124 + def identifiers; end + + # The OSVDB identifier. + # + # @return [String, nil] + # + # pkg:gem/bundler-audit#lib/bundler/audit/advisory.rb:102 + def osvdb_id; end + + # Checks whether the version is patched against the advisory. + # + # @param [Gem::Version] version + # The version to compare against {#patched_versions}. + # + # @return [Boolean] + # Specifies whether the version is patched against the advisory. + # + # @since 0.2.0 + # + # pkg:gem/bundler-audit#lib/bundler/audit/advisory.rb:184 + def patched?(version); end + + # Converts the advisory to a Hash. + # + # @return [Hash{Symbol => Object}] + # + # pkg:gem/bundler-audit#lib/bundler/audit/advisory.rb:219 + def to_h; end + + # pkg:gem/bundler-audit#lib/bundler/audit/advisory.rb:225 + def to_s; end + + # Checks whether the version is not affected by the advisory. + # + # @param [Gem::Version] version + # The version to compare against {#unaffected_versions}. + # + # @return [Boolean] + # Specifies whether the version is not affected by the advisory. + # + # @since 0.2.0 + # + # pkg:gem/bundler-audit#lib/bundler/audit/advisory.rb:167 + def unaffected?(version); end + + # Checks whether the version is vulnerable to the advisory. + # + # @param [Gem::Version] version + # The version to compare against {#patched_versions}. + # + # @return [Boolean] + # Specifies whether the version is vulnerable to the advisory or not. + # + # pkg:gem/bundler-audit#lib/bundler/audit/advisory.rb:199 + def vulnerable?(version); end + + class << self + # Loads the advisory from a YAML file. + # + # @param [String] path + # The path to the advisory YAML file. + # + # @return [Advisory] + # + # @api semipublic + # + # pkg:gem/bundler-audit#lib/bundler/audit/advisory.rb:50 + def load(path); end + end +end + +# Represents the directory of advisories, grouped by gem name +# and CVE number. +# +# pkg:gem/bundler-audit#lib/bundler/audit/database.rb:29 +class Bundler::Audit::Database + # Initializes the Advisory Database. + # + # @param [String] path + # The path to the advisory database. + # + # @raise [ArgumentError] + # The path was not a directory. + # + # pkg:gem/bundler-audit#lib/bundler/audit/database.rb:62 + def initialize(path = T.unsafe(nil)); end + + # Enumerates over every advisory in the database. + # + # @yield [advisory] + # If a block is given, it will be passed each advisory. + # + # @yieldparam [Advisory] advisory + # An advisory from the database. + # + # @return [Enumerator] + # If no block is given, an Enumerator will be returned. + # + # pkg:gem/bundler-audit#lib/bundler/audit/database.rb:262 + def advisories(&block); end + + # Enumerates over advisories for the given gem. + # + # @param [String] name + # The gem name to lookup. + # + # @yield [advisory] + # If a block is given, each advisory for the given gem will be yielded. + # + # @yieldparam [Advisory] advisory + # An advisory for the given gem. + # + # @return [Enumerator] + # If no block is given, an Enumerator will be returned. + # + # pkg:gem/bundler-audit#lib/bundler/audit/database.rb:285 + def advisories_for(name); end + + # Verifies whether the gem is effected by any advisories. + # + # @param [Gem::Specification] gem + # The gem to verify. + # + # @yield [advisory] + # If a block is given, it will be passed advisories that effect + # the gem. + # + # @yieldparam [Advisory] advisory + # An advisory that effects the specific version of the gem. + # + # @return [Enumerator] + # If no block is given, an Enumerator will be returned. + # + # pkg:gem/bundler-audit#lib/bundler/audit/database.rb:309 + def check_gem(gem); end + + # The last commit ID of the repository. + # + # @return [String, nil] + # The commit hash or `nil` if the database is not a git repository. + # + # @since 0.9.0 + # + # pkg:gem/bundler-audit#lib/bundler/audit/database.rb:225 + def commit_id; end + + # Determines if the database is a git repository. + # + # @return [Boolean] + # + # @since 0.8.0 + # + # pkg:gem/bundler-audit#lib/bundler/audit/database.rb:181 + def git?; end + + # Inspects the database. + # + # @return [String] + # The inspected database. + # + # pkg:gem/bundler-audit#lib/bundler/audit/database.rb:345 + def inspect; end + + # Determines the time when the database was last updated. + # + # @return [Time] + # + # @since 0.8.0 + # + # pkg:gem/bundler-audit#lib/bundler/audit/database.rb:240 + def last_updated_at; end + + # The path to the advisory database. + # + # @return [String] + # + # pkg:gem/bundler-audit#lib/bundler/audit/database.rb:51 + def path; end + + # The number of advisories within the database. + # + # @return [Integer] + # The number of advisories. + # + # pkg:gem/bundler-audit#lib/bundler/audit/database.rb:325 + def size; end + + # Converts the database to a String. + # + # @return [String] + # The path to the database. + # + # pkg:gem/bundler-audit#lib/bundler/audit/database.rb:335 + def to_s; end + + # Updates the ruby-advisory-db. + # + # @param [Hash] options + # Additional options. + # + # @option options [Boolean] :quiet + # Specify whether `git` should be `--quiet`. + # + # @return [true, nil] + # `true` indicates that the update was successful. + # `nil` indicates the database is not a git repository, thus not + # capable of being updated. + # + # @since 0.8.0 + # + # pkg:gem/bundler-audit#lib/bundler/audit/database.rb:201 + def update!(options = T.unsafe(nil)); end + + protected + + # Enumerates over every advisory path in the database. + # + # @yield [path] + # The given block will be passed each advisory path. + # + # @yieldparam [String] path + # A path to an advisory `.yml` file. + # + # pkg:gem/bundler-audit#lib/bundler/audit/database.rb:360 + def each_advisory_path(&block); end + + # Enumerates over the advisories for the given gem. + # + # @param [String] name + # The gem of the gem. + # + # @yield [path] + # The given block will be passed each advisory path. + # + # @yieldparam [String] path + # A path to an advisory `.yml` file. + # + # pkg:gem/bundler-audit#lib/bundler/audit/database.rb:376 + def each_advisory_path_for(name, &block); end + + class << self + # Downloads the ruby-advisory-db. + # + # @param [Hash] options + # Additional options. + # + # @option options [String] :path (DEFAULT_PATH) + # The destination path for the new ruby-advisory-db. + # + # @option options [Boolean] :quiet + # Specify whether `git` should be `--quiet`. + # + # @return [Dataase] + # The newly downloaded database. + # + # @raise [DownloadFailed] + # Indicates that the download failed. + # + # @note + # Requires network access. + # + # @since 0.8.0 + # + # pkg:gem/bundler-audit#lib/bundler/audit/database.rb:117 + def download(options = T.unsafe(nil)); end + + # Tests whether the database exists. + # + # @param [String] path + # The given path of the database to check. + # + # @return [Boolean] + # + # @since 0.8.0 + # + # pkg:gem/bundler-audit#lib/bundler/audit/database.rb:90 + def exists?(path = T.unsafe(nil)); end + + # The default path for the database. + # + # @return [String] + # The path to the database directory. + # + # pkg:gem/bundler-audit#lib/bundler/audit/database.rb:76 + def path; end + + # Updates the ruby-advisory-db. + # + # @param [Hash] options + # Additional options. + # + # @option options [Boolean] :quiet + # Specify whether `git` should be `--quiet`. + # + # @return [Boolean, nil] + # Specifies whether the update was successful. + # A `nil` indicates no update was performed. + # + # @raise [ArgumentError] + # Invalid options were given. + # + # @note + # Requires network access. + # + # @since 0.3.0 + # + # @deprecated Use {#update!} instead. + # + # pkg:gem/bundler-audit#lib/bundler/audit/database.rb:158 + def update!(options = T.unsafe(nil)); end + end +end + +# Default path to the ruby-advisory-db. +# +# @since 0.8.0 +# +# pkg:gem/bundler-audit#lib/bundler/audit/database.rb:46 +Bundler::Audit::Database::DEFAULT_PATH = T.let(T.unsafe(nil), String) + +# pkg:gem/bundler-audit#lib/bundler/audit/database.rb:31 +class Bundler::Audit::Database::DownloadFailed < ::RuntimeError; end + +# Git URL of the ruby-advisory-db. +# +# pkg:gem/bundler-audit#lib/bundler/audit/database.rb:38 +Bundler::Audit::Database::URL = T.let(T.unsafe(nil), String) + +# Path to the user's copy of the ruby-advisory-db. +# +# pkg:gem/bundler-audit#lib/bundler/audit/database.rb:41 +Bundler::Audit::Database::USER_PATH = T.let(T.unsafe(nil), String) + +# pkg:gem/bundler-audit#lib/bundler/audit/database.rb:34 +class Bundler::Audit::Database::UpdateFailed < ::RuntimeError; end + +# bundler-audit version +# +# pkg:gem/bundler-audit#lib/bundler/audit/version.rb:21 +Bundler::Audit::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/byebug@11.1.3.rbi b/sorbet/rbi/gems/byebug@11.1.3.rbi new file mode 100644 index 000000000..70ded9b1e --- /dev/null +++ b/sorbet/rbi/gems/byebug@11.1.3.rbi @@ -0,0 +1,3620 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `byebug` gem. +# Please instead update this file by running `bin/tapioca gem byebug`. + + +# Main Container for all of Byebug's code +# +# +# Main debugger's container module. Everything is defined under this module +# +# +# Namespace for all of byebug's code +# +# +# Remote debugging functionality. +# +# +# Reopen main module to define the library version +# +# pkg:gem/byebug#lib/byebug/helpers/reflection.rb:3 +module Byebug + include ::Byebug::Helpers::ReflectionHelper + extend ::Byebug::Helpers::ReflectionHelper + extend ::Byebug + + # Debugger's display expressions + # + # pkg:gem/byebug#lib/byebug/core.rb:31 + def displays; end + + # Debugger's display expressions + # + # pkg:gem/byebug#lib/byebug/core.rb:31 + def displays=(_arg0); end + + # Configuration file used for startup commands. Default value is .byebugrc + # + # pkg:gem/byebug#lib/byebug/core.rb:25 + def init_file; end + + # Configuration file used for startup commands. Default value is .byebugrc + # + # pkg:gem/byebug#lib/byebug/core.rb:25 + def init_file=(_arg0); end + + # Running mode of the debugger. Can be either: + # + # * :attached => Attached to a running program through the `byebug` method. + # * :standalone => Started through `byebug` script. + # * :off => Ignoring any `byebug` method calls. + # + # pkg:gem/byebug#lib/byebug/core.rb:41 + def mode; end + + # Running mode of the debugger. Can be either: + # + # * :attached => Attached to a running program through the `byebug` method. + # * :standalone => Started through `byebug` script. + # * :off => Ignoring any `byebug` method calls. + # + # pkg:gem/byebug#lib/byebug/core.rb:41 + def mode=(_arg0); end + + # Runs normal byebug initialization scripts. + # + # Reads and executes the commands from init file (if any) in the current + # working directory. This is only done if the current directory is different + # from your home directory. Thus, you can have more than one init file, one + # generic in your home directory, and another, specific to the program you + # are debugging, in the directory where you invoke byebug. + # + # pkg:gem/byebug#lib/byebug/core.rb:52 + def run_init_script; end + + private + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def add_catchpoint(_arg0); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def breakpoints; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def catchpoints; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def contexts; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def current_context; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def debug_load(*_arg0); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def lock; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def post_mortem=(_arg0); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def post_mortem?; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def raised_exception; end + + # List of folders to load rc files from + # + # @note Files will be loaded in the order specified here. + # + # pkg:gem/byebug#lib/byebug/core.rb:102 + def rc_dirs; end + + # Runs a initialization script file + # + # pkg:gem/byebug#lib/byebug/core.rb:91 + def run_rc_file(rc_file); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def start; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def started?; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def stop; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def stoppable?; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def thread_context(_arg0); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def tracing=(_arg0); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def tracing?; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def unlock; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def verbose=(_arg0); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def verbose?; end + + class << self + # The actual port that the control server is started at + # + # pkg:gem/byebug#lib/byebug/remote.rb:25 + def actual_control_port; end + + # The actual port that the server is started at + # + # pkg:gem/byebug#lib/byebug/remote.rb:20 + def actual_port; end + + def add_catchpoint(_arg0); end + + # Starts byebug, and stops at the first line of user's code. + # + # pkg:gem/byebug#lib/byebug/attacher.rb:10 + def attach; end + + def breakpoints; end + def catchpoints; end + def contexts; end + def current_context; end + def debug_load(*_arg0); end + + # Saves information about the unhandled exception and gives a byebug + # prompt back to the user before program termination. + # + # pkg:gem/byebug#lib/byebug/core.rb:76 + def handle_post_mortem; end + + # Interrupts the current thread + # + # pkg:gem/byebug#lib/byebug/remote.rb:32 + def interrupt; end + + # pkg:gem/byebug#lib/byebug/core.rb:61 + def load_settings; end + + def lock; end + + # pkg:gem/byebug#lib/byebug/remote.rb:59 + def parse_host_and_port(host_port_spec); end + + def post_mortem=(_arg0); end + def post_mortem?; end + def raised_exception; end + + # pkg:gem/byebug#lib/byebug/attacher.rb:21 + def spawn(host = T.unsafe(nil), port = T.unsafe(nil)); end + + def start; end + + # Connects to the remote byebug + # + # pkg:gem/byebug#lib/byebug/remote.rb:55 + def start_client(host = T.unsafe(nil), port = T.unsafe(nil)); end + + # Starts the remote server control thread + # + # pkg:gem/byebug#lib/byebug/remote.rb:48 + def start_control(host = T.unsafe(nil), port = T.unsafe(nil)); end + + # Starts the remote server main thread + # + # pkg:gem/byebug#lib/byebug/remote.rb:39 + def start_server(host = T.unsafe(nil), port = T.unsafe(nil)); end + + def started?; end + def stop; end + def stoppable?; end + def thread_context(_arg0); end + def tracing=(_arg0); end + def tracing?; end + def unlock; end + def verbose=(_arg0); end + def verbose?; end + + # If in remote mode, wait for the remote connection + # + # pkg:gem/byebug#lib/byebug/remote.rb:17 + def wait_connection; end + + # If in remote mode, wait for the remote connection + # + # pkg:gem/byebug#lib/byebug/remote.rb:17 + def wait_connection=(_arg0); end + + private + + # pkg:gem/byebug#lib/byebug/remote.rb:66 + def client; end + + # pkg:gem/byebug#lib/byebug/remote.rb:76 + def control; end + + # pkg:gem/byebug#lib/byebug/remote.rb:70 + def server; end + end +end + +# Setting for automatically invoking IRB on every stop. +# +# pkg:gem/byebug#lib/byebug/settings/autoirb.rb:10 +class Byebug::AutoirbSetting < ::Byebug::Setting + # pkg:gem/byebug#lib/byebug/settings/autoirb.rb:13 + def initialize; end + + # pkg:gem/byebug#lib/byebug/settings/autoirb.rb:17 + def banner; end + + # pkg:gem/byebug#lib/byebug/settings/autoirb.rb:25 + def value; end + + # pkg:gem/byebug#lib/byebug/settings/autoirb.rb:21 + def value=(val); end +end + +# pkg:gem/byebug#lib/byebug/settings/autoirb.rb:11 +Byebug::AutoirbSetting::DEFAULT = T.let(T.unsafe(nil), Integer) + +# Setting for automatically listing source code on every stop. +# +# pkg:gem/byebug#lib/byebug/settings/autolist.rb:10 +class Byebug::AutolistSetting < ::Byebug::Setting + # pkg:gem/byebug#lib/byebug/settings/autolist.rb:13 + def initialize; end + + # pkg:gem/byebug#lib/byebug/settings/autolist.rb:17 + def banner; end + + # pkg:gem/byebug#lib/byebug/settings/autolist.rb:25 + def value; end + + # pkg:gem/byebug#lib/byebug/settings/autolist.rb:21 + def value=(val); end +end + +# pkg:gem/byebug#lib/byebug/settings/autolist.rb:11 +Byebug::AutolistSetting::DEFAULT = T.let(T.unsafe(nil), Integer) + +# Setting for automatically invoking Pry on every stop. +# +# pkg:gem/byebug#lib/byebug/settings/autopry.rb:10 +class Byebug::AutoprySetting < ::Byebug::Setting + # pkg:gem/byebug#lib/byebug/settings/autopry.rb:13 + def initialize; end + + # pkg:gem/byebug#lib/byebug/settings/autopry.rb:17 + def banner; end + + # pkg:gem/byebug#lib/byebug/settings/autopry.rb:25 + def value; end + + # pkg:gem/byebug#lib/byebug/settings/autopry.rb:21 + def value=(val); end +end + +# pkg:gem/byebug#lib/byebug/settings/autopry.rb:11 +Byebug::AutoprySetting::DEFAULT = T.let(T.unsafe(nil), Integer) + +# Setting for automatically saving previously entered commands to history +# when exiting the debugger. +# +# pkg:gem/byebug#lib/byebug/settings/autosave.rb:10 +class Byebug::AutosaveSetting < ::Byebug::Setting + # pkg:gem/byebug#lib/byebug/settings/autosave.rb:13 + def banner; end +end + +# pkg:gem/byebug#lib/byebug/settings/autosave.rb:11 +Byebug::AutosaveSetting::DEFAULT = T.let(T.unsafe(nil), TrueClass) + +# Command to display short paths in file names. +# +# For example, when displaying source code information. +# +# pkg:gem/byebug#lib/byebug/settings/basename.rb:11 +class Byebug::BasenameSetting < ::Byebug::Setting + # pkg:gem/byebug#lib/byebug/settings/basename.rb:12 + def banner; end +end + +# Implements breakpoint functionality +# +# pkg:gem/byebug#lib/byebug/commands/break.rb:13 +class Byebug::BreakCommand < ::Byebug::Command + include ::Byebug::Helpers::EvalHelper + include ::Byebug::Helpers::FileHelper + include ::Byebug::Helpers::ParseHelper + + # pkg:gem/byebug#lib/byebug/commands/break.rb:40 + def execute; end + + private + + # pkg:gem/byebug#lib/byebug/commands/break.rb:83 + def add_line_breakpoint(file, line); end + + # pkg:gem/byebug#lib/byebug/commands/break.rb:54 + def line_breakpoint(location); end + + # pkg:gem/byebug#lib/byebug/commands/break.rb:65 + def method_breakpoint(location); end + + # pkg:gem/byebug#lib/byebug/commands/break.rb:74 + def target_object(str); end + + # pkg:gem/byebug#lib/byebug/commands/break.rb:104 + def valid_breakpoints_for(path, line); end + + class << self + # pkg:gem/byebug#lib/byebug/commands/break.rb:24 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/break.rb:20 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/break.rb:36 + def short_description; end + end +end + +# Implements breakpoints +# +# pkg:gem/byebug#lib/byebug/breakpoint.rb:7 +class Byebug::Breakpoint + # pkg:gem/byebug#lib/byebug/core.rb:4 + def initialize(_arg0, _arg1, _arg2); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def enabled=(_arg0); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def enabled?; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def expr; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def expr=(_arg0); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def hit_condition; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def hit_condition=(_arg0); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def hit_count; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def hit_value; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def hit_value=(_arg0); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def id; end + + # Prints all information associated to the breakpoint + # + # pkg:gem/byebug#lib/byebug/breakpoint.rb:105 + def inspect; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def pos; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def source; end + + class << self + # Adds a new breakpoint + # + # @param [String] file + # @param [Fixnum] line + # @param [String] expr + # + # pkg:gem/byebug#lib/byebug/breakpoint.rb:29 + def add(file, line, expr = T.unsafe(nil)); end + + # First breakpoint, in order of creation + # + # pkg:gem/byebug#lib/byebug/breakpoint.rb:11 + def first; end + + # Last breakpoint, in order of creation + # + # pkg:gem/byebug#lib/byebug/breakpoint.rb:18 + def last; end + + # True if there's no breakpoints + # + # pkg:gem/byebug#lib/byebug/breakpoint.rb:98 + def none?; end + + # Returns true if a breakpoint could be set in line number +lineno+ in file + # name +filename. + # + # pkg:gem/byebug#lib/byebug/breakpoint.rb:91 + def potential_line?(filename, lineno); end + + # Returns an array of line numbers in file named +filename+ where + # breakpoints could be set. The list will contain an entry for each + # distinct line event call so it is possible (and possibly useful) for a + # line number appear more than once. + # + # @param filename [String] File name to inspect for possible breakpoints + # + # pkg:gem/byebug#lib/byebug/breakpoint.rb:52 + def potential_lines(filename); end + + # Removes a breakpoint + # + # @param id [integer] breakpoint number + # + # pkg:gem/byebug#lib/byebug/breakpoint.rb:40 + def remove(id); end + + private + + # pkg:gem/byebug#lib/byebug/breakpoint.rb:63 + def potential_lines_with_trace_points(iseq, lines); end + + # pkg:gem/byebug#lib/byebug/breakpoint.rb:74 + def potential_lines_without_trace_points(iseq, lines); end + end +end + +# Setting to customize the verbosity level for stack frames. +# +# pkg:gem/byebug#lib/byebug/settings/callstyle.rb:9 +class Byebug::CallstyleSetting < ::Byebug::Setting + # pkg:gem/byebug#lib/byebug/settings/callstyle.rb:12 + def banner; end + + # pkg:gem/byebug#lib/byebug/settings/callstyle.rb:16 + def to_s; end +end + +# pkg:gem/byebug#lib/byebug/settings/callstyle.rb:10 +Byebug::CallstyleSetting::DEFAULT = T.let(T.unsafe(nil), String) + +# Implements exception catching. +# +# Enables the user to catch unhandled assertion when they happen. +# +# pkg:gem/byebug#lib/byebug/commands/catch.rb:12 +class Byebug::CatchCommand < ::Byebug::Command + include ::Byebug::Helpers::EvalHelper + + # pkg:gem/byebug#lib/byebug/commands/catch.rb:38 + def execute; end + + private + + # pkg:gem/byebug#lib/byebug/commands/catch.rb:57 + def add(exception); end + + # pkg:gem/byebug#lib/byebug/commands/catch.rb:64 + def clear; end + + # pkg:gem/byebug#lib/byebug/commands/catch.rb:68 + def info; end + + # pkg:gem/byebug#lib/byebug/commands/catch.rb:50 + def remove(exception); end + + class << self + # pkg:gem/byebug#lib/byebug/commands/catch.rb:21 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/catch.rb:17 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/catch.rb:34 + def short_description; end + end +end + +# Parent class of all byebug commands. +# +# Subclass it and name the subclass ending with the word Command to implement +# your own custom command. +# +# @example Define a custom command +# +# class MyCustomCommand < Command +# def self.regexp +# /custom_regexp/ +# end +# +# def self.description +# "Custom long desc" +# end +# +# def.short_description +# "Custom short desc" +# end +# +# def execute +# # My command's implementation +# end +# end +# +# pkg:gem/byebug#lib/byebug/command.rb:33 +class Byebug::Command + extend ::Forwardable + extend ::Byebug::Helpers::StringHelper + + # pkg:gem/byebug#lib/byebug/command.rb:38 + def initialize(processor, input = T.unsafe(nil)); end + + # pkg:gem/byebug#lib/byebug/command.rb:51 + def arguments; end + + # pkg:gem/byebug#lib/byebug/command.rb:61 + def confirm(*args, **, &block); end + + # pkg:gem/byebug#lib/byebug/command.rb:43 + def context; end + + # pkg:gem/byebug#lib/byebug/command.rb:61 + def errmsg(*args, **, &block); end + + # pkg:gem/byebug#lib/byebug/command.rb:47 + def frame; end + + # pkg:gem/byebug#lib/byebug/command.rb:55 + def help(*args, **, &block); end + + # pkg:gem/byebug#lib/byebug/command.rb:55 + def match(*args, **, &block); end + + # pkg:gem/byebug#lib/byebug/command.rb:57 + def pr(*args, **, &block); end + + # pkg:gem/byebug#lib/byebug/command.rb:58 + def prc(*args, **, &block); end + + # pkg:gem/byebug#lib/byebug/command.rb:61 + def print(*args, **, &block); end + + # pkg:gem/byebug#lib/byebug/command.rb:36 + def processor; end + + # pkg:gem/byebug#lib/byebug/command.rb:59 + def prv(*args, **, &block); end + + # pkg:gem/byebug#lib/byebug/command.rb:61 + def puts(*args, **, &block); end + + class << self + # Special methods to allow command filtering in processors + # + # pkg:gem/byebug#lib/byebug/command.rb:69 + def allow_in_control; end + + # Special methods to allow command filtering in processors + # + # pkg:gem/byebug#lib/byebug/command.rb:69 + def allow_in_control=(_arg0); end + + # Special methods to allow command filtering in processors + # + # pkg:gem/byebug#lib/byebug/command.rb:69 + def allow_in_post_mortem; end + + # Special methods to allow command filtering in processors + # + # pkg:gem/byebug#lib/byebug/command.rb:69 + def allow_in_post_mortem=(_arg0); end + + # pkg:gem/byebug#lib/byebug/command.rb:73 + def always_run; end + + # pkg:gem/byebug#lib/byebug/command.rb:71 + def always_run=(_arg0); end + + # pkg:gem/byebug#lib/byebug/command.rb:88 + def columnize(width); end + + # Default help text for a command. + # + # pkg:gem/byebug#lib/byebug/command.rb:99 + def help; end + + # Command's regexp match against an input + # + # pkg:gem/byebug#lib/byebug/command.rb:106 + def match(input); end + + # Name of the command, as executed by the user. + # + # pkg:gem/byebug#lib/byebug/command.rb:80 + def to_s; end + end +end + +# Holds an array of subcommands for a command +# +# pkg:gem/byebug#lib/byebug/command_list.rb:9 +class Byebug::CommandList + include ::Enumerable + + # pkg:gem/byebug#lib/byebug/command_list.rb:12 + def initialize(commands); end + + # pkg:gem/byebug#lib/byebug/command_list.rb:20 + def each; end + + # pkg:gem/byebug#lib/byebug/command_list.rb:16 + def match(input); end + + # pkg:gem/byebug#lib/byebug/command_list.rb:24 + def to_s; end + + private + + # pkg:gem/byebug#lib/byebug/command_list.rb:30 + def width; end +end + +# Custom exception exception to signal "command not found" errors +# +# pkg:gem/byebug#lib/byebug/errors.rb:7 +class Byebug::CommandNotFound < ::NoMethodError + # pkg:gem/byebug#lib/byebug/errors.rb:8 + def initialize(input, parent = T.unsafe(nil)); end + + private + + # pkg:gem/byebug#lib/byebug/errors.rb:25 + def build_cmd(*args); end + + # pkg:gem/byebug#lib/byebug/errors.rb:21 + def help; end + + # pkg:gem/byebug#lib/byebug/errors.rb:17 + def name; end +end + +# Processes commands in regular mode. +# +# You can override this class to create your own command processor that, for +# example, whitelists only certain commands to be executed. +# +# @see PostMortemProcessor for a example +# +# pkg:gem/byebug#lib/byebug/processors/command_processor.rb:17 +class Byebug::CommandProcessor + include ::Byebug::Helpers::EvalHelper + extend ::Forwardable + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:23 + def initialize(context, interface = T.unsafe(nil)); end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:64 + def at_breakpoint(brkpt); end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:70 + def at_catchpoint(exception); end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:80 + def at_end; end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:54 + def at_line; end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:74 + def at_return(return_value); end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:58 + def at_tracing; end + + # Available commands + # + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:50 + def command_list; end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:45 + def commands(*args, **, &block); end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:43 + def confirm(*args, **, &block); end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:21 + def context; end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:43 + def errmsg(*args, **, &block); end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:37 + def frame(*args, **, &block); end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:21 + def interface; end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:39 + def pr(*args, **, &block); end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:40 + def prc(*args, **, &block); end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:20 + def prev_line; end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:20 + def prev_line=(_arg0); end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:31 + def printer; end + + # Let the execution continue + # + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:87 + def proceed!; end + + # Handle byebug commands. + # + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:94 + def process_commands; end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:41 + def prv(*args, **, &block); end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:43 + def puts(*args, **, &block); end + + protected + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:119 + def after_repl; end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:111 + def before_repl; end + + # Prompt shown before reading a command. + # + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:107 + def prompt; end + + # Main byebug's REPL + # + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:126 + def repl; end + + private + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:139 + def auto_cmds_for(run_level); end + + # Run permanent commands. + # + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:146 + def run_auto_cmds(run_level); end + + # Executes the received input + # + # Instantiates a command matching the input and runs it. If a matching + # command is not found, it evaluates the unknown input. + # + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:158 + def run_cmd(input); end + + # pkg:gem/byebug#lib/byebug/processors/command_processor.rb:167 + def safely; end +end + +# Implements conditions on breakpoints. +# +# Adds the ability to stop on breakpoints only under certain conditions. +# +# pkg:gem/byebug#lib/byebug/commands/condition.rb:12 +class Byebug::ConditionCommand < ::Byebug::Command + include ::Byebug::Helpers::ParseHelper + + # pkg:gem/byebug#lib/byebug/commands/condition.rb:38 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/condition.rb:21 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/condition.rb:17 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/condition.rb:34 + def short_description; end + end +end + +# Mantains context information for the debugger and it's the main +# communication point between the library and the C-extension through the +# at_breakpoint, at_catchpoint, at_tracing, at_line and at_return callbacks +# +# pkg:gem/byebug#lib/byebug/context.rb:14 +class Byebug::Context + include ::Byebug::Helpers::FileHelper + extend ::Byebug::Helpers::PathHelper + extend ::Forwardable + + # Breakpoint handler + # + # pkg:gem/byebug#lib/byebug/context.rb:113 + def at_breakpoint(breakpoint); end + + # Catchpoint handler + # + # pkg:gem/byebug#lib/byebug/context.rb:120 + def at_catchpoint(exception); end + + # End of class definition handler + # + # pkg:gem/byebug#lib/byebug/context.rb:136 + def at_end; end + + # Line handler + # + # pkg:gem/byebug#lib/byebug/context.rb:94 + def at_line; end + + # Return handler + # + # pkg:gem/byebug#lib/byebug/context.rb:127 + def at_return(return_value); end + + # Tracing handler + # + # pkg:gem/byebug#lib/byebug/context.rb:104 + def at_tracing; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def backtrace; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def dead?; end + + # pkg:gem/byebug#lib/byebug/context.rb:58 + def file(*args, **, &block); end + + # Reader for the current frame + # + # pkg:gem/byebug#lib/byebug/context.rb:46 + def frame; end + + # Writer for the current frame + # + # pkg:gem/byebug#lib/byebug/context.rb:53 + def frame=(pos); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def frame_binding(*_arg0); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def frame_class(*_arg0); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def frame_file(*_arg0); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def frame_line(*_arg0); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def frame_method(*_arg0); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def frame_self(*_arg0); end + + # Current file, line and source code information + # + # pkg:gem/byebug#lib/byebug/context.rb:70 + def full_location; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def ignored?; end + + # pkg:gem/byebug#lib/byebug/context.rb:87 + def interrupt; end + + # pkg:gem/byebug#lib/byebug/context.rb:58 + def line(*args, **, &block); end + + # Current file & line information + # + # pkg:gem/byebug#lib/byebug/context.rb:63 + def location; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def resume; end + + # Context's stack size + # + # pkg:gem/byebug#lib/byebug/context.rb:79 + def stack_size; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def step_into(*_arg0); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def step_out(*_arg0); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def step_over(*_arg0); end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def stop_reason; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def suspend; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def suspended?; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def switch; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def thnum; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def thread; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def tracing; end + + # pkg:gem/byebug#lib/byebug/core.rb:4 + def tracing=(_arg0); end + + private + + # Tells whether a file is ignored by the debugger. + # + # @param path [String] filename to be checked. + # + # pkg:gem/byebug#lib/byebug/context.rb:153 + def ignored_file?(path); end + + # pkg:gem/byebug#lib/byebug/context.rb:144 + def processor; end + + class << self + # List of files byebug will ignore while debugging + # + # pkg:gem/byebug#lib/byebug/context.rb:25 + def ignored_files; end + + # List of files byebug will ignore while debugging + # + # pkg:gem/byebug#lib/byebug/context.rb:20 + def ignored_files=(_arg0); end + + # pkg:gem/byebug#lib/byebug/context.rb:32 + def interface; end + + # pkg:gem/byebug#lib/byebug/context.rb:30 + def interface=(_arg0); end + + # pkg:gem/byebug#lib/byebug/context.rb:38 + def processor; end + + # pkg:gem/byebug#lib/byebug/context.rb:36 + def processor=(_arg0); end + end +end + +# Implements the continue command. +# +# Allows the user to continue execution until the next stopping point, a +# specific line number or until program termination. +# +# pkg:gem/byebug#lib/byebug/commands/continue.rb:13 +class Byebug::ContinueCommand < ::Byebug::Command + include ::Byebug::Helpers::ParseHelper + + # pkg:gem/byebug#lib/byebug/commands/continue.rb:37 + def execute; end + + private + + # pkg:gem/byebug#lib/byebug/commands/continue.rb:64 + def modifier; end + + # pkg:gem/byebug#lib/byebug/commands/continue.rb:60 + def unconditionally?; end + + # pkg:gem/byebug#lib/byebug/commands/continue.rb:56 + def until_line?; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/continue.rb:20 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/continue.rb:16 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/continue.rb:33 + def short_description; end + end +end + +# Processes commands when there's not program running +# +# pkg:gem/byebug#lib/byebug/processors/control_processor.rb:9 +class Byebug::ControlProcessor < ::Byebug::CommandProcessor + # Available commands + # + # pkg:gem/byebug#lib/byebug/processors/control_processor.rb:13 + def commands; end + + # Prompt shown before reading a command. + # + # pkg:gem/byebug#lib/byebug/processors/control_processor.rb:20 + def prompt; end +end + +# Spawns a subdebugger and evaluates the given expression +# +# pkg:gem/byebug#lib/byebug/commands/debug.rb:10 +class Byebug::DebugCommand < ::Byebug::Command + include ::Byebug::Helpers::EvalHelper + + # pkg:gem/byebug#lib/byebug/commands/debug.rb:32 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/debug.rb:17 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/debug.rb:13 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/debug.rb:28 + def short_description; end + end +end + +class Byebug::DebugThread < ::Thread + class << self + def inherited; end + end +end + +# Implements breakpoint deletion. +# +# pkg:gem/byebug#lib/byebug/commands/delete.rb:10 +class Byebug::DeleteCommand < ::Byebug::Command + include ::Byebug::Helpers::ParseHelper + + # pkg:gem/byebug#lib/byebug/commands/delete.rb:35 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/delete.rb:20 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/delete.rb:16 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/delete.rb:31 + def short_description; end + end +end + +# Disabling custom display expressions or breakpoints. +# +# +# Reopens the +disable+ command to define the +breakpoints+ subcommand +# +# +# Reopens the +disable+ command to define the +display+ subcommand +# +# pkg:gem/byebug#lib/byebug/commands/disable/breakpoints.rb:9 +class Byebug::DisableCommand < ::Byebug::Command + include ::Byebug::Subcommands + extend ::Byebug::Helpers::ReflectionHelper + extend ::Byebug::Subcommands::ClassMethods + + class << self + # pkg:gem/byebug#lib/byebug/commands/disable.rb:21 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/disable.rb:17 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/disable.rb:29 + def short_description; end + end +end + +# Disables all or specific breakpoints +# +# pkg:gem/byebug#lib/byebug/commands/disable/breakpoints.rb:13 +class Byebug::DisableCommand::BreakpointsCommand < ::Byebug::Command + include ::Byebug::Helpers::ParseHelper + include ::Byebug::Helpers::ToggleHelper + + # pkg:gem/byebug#lib/byebug/commands/disable/breakpoints.rb:37 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/disable/breakpoints.rb:22 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/disable/breakpoints.rb:18 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/disable/breakpoints.rb:33 + def short_description; end + end +end + +# Enables all or specific displays +# +# pkg:gem/byebug#lib/byebug/commands/disable/display.rb:13 +class Byebug::DisableCommand::DisplayCommand < ::Byebug::Command + include ::Byebug::Helpers::ParseHelper + include ::Byebug::Helpers::ToggleHelper + + # pkg:gem/byebug#lib/byebug/commands/disable/display.rb:38 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/disable/display.rb:22 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/disable/display.rb:18 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/disable/display.rb:34 + def short_description; end + end +end + +# Custom expressions to be displayed every time the debugger stops. +# +# pkg:gem/byebug#lib/byebug/commands/display.rb:10 +class Byebug::DisplayCommand < ::Byebug::Command + include ::Byebug::Helpers::EvalHelper + + # pkg:gem/byebug#lib/byebug/commands/display.rb:35 + def execute; end + + private + + # pkg:gem/byebug#lib/byebug/commands/display.rb:44 + def display_expression(exp); end + + # pkg:gem/byebug#lib/byebug/commands/display.rb:60 + def eval_expr(expression); end + + # pkg:gem/byebug#lib/byebug/commands/display.rb:50 + def print_display_expressions; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/display.rb:20 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/display.rb:16 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/display.rb:31 + def short_description; end + end +end + +# Move the current frame down in the backtrace. +# +# pkg:gem/byebug#lib/byebug/commands/down.rb:12 +class Byebug::DownCommand < ::Byebug::Command + include ::Byebug::Helpers::FrameHelper + include ::Byebug::Helpers::ParseHelper + + # pkg:gem/byebug#lib/byebug/commands/down.rb:36 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/down.rb:22 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/down.rb:18 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/down.rb:32 + def short_description; end + end +end + +# Edit a file from byebug's prompt. +# +# pkg:gem/byebug#lib/byebug/commands/edit.rb:9 +class Byebug::EditCommand < ::Byebug::Command + # pkg:gem/byebug#lib/byebug/commands/edit.rb:33 + def execute; end + + private + + # pkg:gem/byebug#lib/byebug/commands/edit.rb:65 + def edit_error(type, file); end + + # pkg:gem/byebug#lib/byebug/commands/edit.rb:61 + def editor; end + + # pkg:gem/byebug#lib/byebug/commands/edit.rb:45 + def location(matched); end + + class << self + # pkg:gem/byebug#lib/byebug/commands/edit.rb:17 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/edit.rb:13 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/edit.rb:29 + def short_description; end + end +end + +# Enabling custom display expressions or breakpoints. +# +# +# Reopens the +enable+ command to define the +breakpoints+ subcommand +# +# +# Reopens the +enable+ command to define the +display+ subcommand +# +# pkg:gem/byebug#lib/byebug/commands/enable/breakpoints.rb:9 +class Byebug::EnableCommand < ::Byebug::Command + include ::Byebug::Subcommands + extend ::Byebug::Helpers::ReflectionHelper + extend ::Byebug::Subcommands::ClassMethods + + class << self + # pkg:gem/byebug#lib/byebug/commands/enable.rb:21 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/enable.rb:17 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/enable.rb:29 + def short_description; end + end +end + +# Enables all or specific breakpoints +# +# pkg:gem/byebug#lib/byebug/commands/enable/breakpoints.rb:13 +class Byebug::EnableCommand::BreakpointsCommand < ::Byebug::Command + include ::Byebug::Helpers::ParseHelper + include ::Byebug::Helpers::ToggleHelper + + # pkg:gem/byebug#lib/byebug/commands/enable/breakpoints.rb:37 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/enable/breakpoints.rb:22 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/enable/breakpoints.rb:18 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/enable/breakpoints.rb:33 + def short_description; end + end +end + +# Enables all or specific displays +# +# pkg:gem/byebug#lib/byebug/commands/enable/display.rb:13 +class Byebug::EnableCommand::DisplayCommand < ::Byebug::Command + include ::Byebug::Helpers::ParseHelper + include ::Byebug::Helpers::ToggleHelper + + # pkg:gem/byebug#lib/byebug/commands/enable/display.rb:38 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/enable/display.rb:22 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/enable/display.rb:18 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/enable/display.rb:34 + def short_description; end + end +end + +# Implements the finish functionality. +# +# Allows the user to continue execution until certain frames are finished. +# +# pkg:gem/byebug#lib/byebug/commands/finish.rb:12 +class Byebug::FinishCommand < ::Byebug::Command + include ::Byebug::Helpers::ParseHelper + + # pkg:gem/byebug#lib/byebug/commands/finish.rb:37 + def execute; end + + private + + # pkg:gem/byebug#lib/byebug/commands/finish.rb:53 + def max_frames; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/finish.rb:21 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/finish.rb:17 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/finish.rb:33 + def short_description; end + end +end + +# Represents a frame in the stack trace +# +# pkg:gem/byebug#lib/byebug/frame.rb:9 +class Byebug::Frame + include ::Byebug::Helpers::FileHelper + + # pkg:gem/byebug#lib/byebug/frame.rb:14 + def initialize(context, pos); end + + # pkg:gem/byebug#lib/byebug/frame.rb:31 + def _binding; end + + # pkg:gem/byebug#lib/byebug/frame.rb:35 + def _class; end + + # pkg:gem/byebug#lib/byebug/frame.rb:39 + def _method; end + + # pkg:gem/byebug#lib/byebug/frame.rb:27 + def _self; end + + # Gets current method arguments for the frame. + # + # pkg:gem/byebug#lib/byebug/frame.rb:62 + def args; end + + # Checks whether the frame is a c-frame + # + # pkg:gem/byebug#lib/byebug/frame.rb:141 + def c_frame?; end + + # pkg:gem/byebug#lib/byebug/frame.rb:43 + def current?; end + + # Builds a string containing all available args in the frame number, in a + # verbose or non verbose way according to the value of the +callstyle+ + # setting + # + # pkg:gem/byebug#lib/byebug/frame.rb:89 + def deco_args; end + + # pkg:gem/byebug#lib/byebug/frame.rb:76 + def deco_block; end + + # Builds a formatted string containing information about current method call + # + # pkg:gem/byebug#lib/byebug/frame.rb:106 + def deco_call; end + + # Returns the current class in the frame or an empty string if the current + # +callstyle+ setting is 'short' + # + # pkg:gem/byebug#lib/byebug/frame.rb:72 + def deco_class; end + + # Formatted filename in frame + # + # pkg:gem/byebug#lib/byebug/frame.rb:113 + def deco_file; end + + # pkg:gem/byebug#lib/byebug/frame.rb:80 + def deco_method; end + + # Properly formatted frame number of frame + # + # pkg:gem/byebug#lib/byebug/frame.rb:120 + def deco_pos; end + + # pkg:gem/byebug#lib/byebug/frame.rb:19 + def file; end + + # pkg:gem/byebug#lib/byebug/frame.rb:23 + def line; end + + # Gets local variables for the frame. + # + # pkg:gem/byebug#lib/byebug/frame.rb:50 + def locals; end + + # Formatted mark for the frame. + # + # --> marks the current frame + # ͱ-- marks c-frames + # marks regular frames + # + # pkg:gem/byebug#lib/byebug/frame.rb:131 + def mark; end + + # pkg:gem/byebug#lib/byebug/frame.rb:12 + def pos; end + + # pkg:gem/byebug#lib/byebug/frame.rb:145 + def to_hash; end + + private + + # pkg:gem/byebug#lib/byebug/frame.rb:158 + def c_args; end + + # pkg:gem/byebug#lib/byebug/frame.rb:178 + def prefix_and_default(arg_type); end + + # pkg:gem/byebug#lib/byebug/frame.rb:164 + def ruby_args; end + + # pkg:gem/byebug#lib/byebug/frame.rb:174 + def use_short_style?(arg); end +end + +# Move to specific frames in the backtrace. +# +# pkg:gem/byebug#lib/byebug/commands/frame.rb:12 +class Byebug::FrameCommand < ::Byebug::Command + include ::Byebug::Helpers::FrameHelper + include ::Byebug::Helpers::ParseHelper + + # pkg:gem/byebug#lib/byebug/commands/frame.rb:46 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/frame.rb:22 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/frame.rb:18 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/frame.rb:42 + def short_description; end + end +end + +# Setting to display full paths in backtraces. +# +# pkg:gem/byebug#lib/byebug/settings/fullpath.rb:9 +class Byebug::FullpathSetting < ::Byebug::Setting + # pkg:gem/byebug#lib/byebug/settings/fullpath.rb:12 + def banner; end +end + +# pkg:gem/byebug#lib/byebug/settings/fullpath.rb:10 +Byebug::FullpathSetting::DEFAULT = T.let(T.unsafe(nil), TrueClass) + +# Ask for help from byebug's prompt. +# +# pkg:gem/byebug#lib/byebug/commands/help.rb:10 +class Byebug::HelpCommand < ::Byebug::Command + # pkg:gem/byebug#lib/byebug/commands/help.rb:34 + def execute; end + + private + + # pkg:gem/byebug#lib/byebug/commands/help.rb:54 + def command; end + + # pkg:gem/byebug#lib/byebug/commands/help.rb:48 + def help_for(input, cmd); end + + # pkg:gem/byebug#lib/byebug/commands/help.rb:44 + def help_for_all; end + + # pkg:gem/byebug#lib/byebug/commands/help.rb:58 + def subcommand; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/help.rb:18 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/help.rb:14 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/help.rb:30 + def short_description; end + end +end + +# pkg:gem/byebug#lib/byebug/helpers/reflection.rb:4 +module Byebug::Helpers; end + +# Utilities for interaction with executables +# +# pkg:gem/byebug#lib/byebug/helpers/bin.rb:8 +module Byebug::Helpers::BinHelper + # pkg:gem/byebug#lib/byebug/helpers/bin.rb:38 + def executable_file_extensions; end + + # pkg:gem/byebug#lib/byebug/helpers/bin.rb:24 + def find_executable(path, cmd); end + + # pkg:gem/byebug#lib/byebug/helpers/bin.rb:42 + def real_executable?(file); end + + # pkg:gem/byebug#lib/byebug/helpers/bin.rb:34 + def search_paths; end + + # Cross-platform way of finding an executable in the $PATH. + # Adapted from: https://gist.github.com/steakknife/88b6c3837a5e90a08296 + # + # pkg:gem/byebug#lib/byebug/helpers/bin.rb:13 + def which(cmd); end +end + +# Utilities to assist evaluation of code strings +# +# pkg:gem/byebug#lib/byebug/helpers/eval.rb:8 +module Byebug::Helpers::EvalHelper + # Evaluates a string containing Ruby code in a specific binding, + # handling the errors at an error level. + # + # pkg:gem/byebug#lib/byebug/helpers/eval.rb:46 + def error_eval(str, binding = T.unsafe(nil)); end + + # Evaluates an +expression+ that might use or defer execution to threads + # other than the current one. + # + # @note This is necessary because when in byebug's prompt, every thread is + # "frozen" so that nothing gets run. So we need to unlock threads prior + # to evaluation or we will run into a deadlock. + # + # @param expression [String] Expression to evaluate + # + # pkg:gem/byebug#lib/byebug/helpers/eval.rb:30 + def multiple_thread_eval(expression); end + + # Evaluates an +expression+ in a separate thread. + # + # @param expression [String] Expression to evaluate + # + # pkg:gem/byebug#lib/byebug/helpers/eval.rb:14 + def separate_thread_eval(expression); end + + # Evaluates a string containing Ruby code in a specific binding, + # returning nil in an error happens. + # + # pkg:gem/byebug#lib/byebug/helpers/eval.rb:38 + def silent_eval(str, binding = T.unsafe(nil)); end + + # Evaluates a string containing Ruby code in a specific binding, + # handling the errors at a warning level. + # + # pkg:gem/byebug#lib/byebug/helpers/eval.rb:54 + def warning_eval(str, binding = T.unsafe(nil)); end + + private + + # Run block temporarily ignoring all TracePoint events. + # + # Used to evaluate stuff within Byebug's prompt. Otherwise, any code + # creating new threads won't be properly evaluated because new threads + # will get blocked by byebug's main thread. + # + # pkg:gem/byebug#lib/byebug/helpers/eval.rb:91 + def allowing_other_threads; end + + # pkg:gem/byebug#lib/byebug/helpers/eval.rb:72 + def error_msg(exception); end + + # Runs the given block in a new thread, waits for it to finish and + # returns the new thread's result. + # + # pkg:gem/byebug#lib/byebug/helpers/eval.rb:105 + def in_new_thread; end + + # pkg:gem/byebug#lib/byebug/helpers/eval.rb:66 + def msg(exception); end + + # pkg:gem/byebug#lib/byebug/helpers/eval.rb:60 + def safe_eval(str, binding); end + + # pkg:gem/byebug#lib/byebug/helpers/eval.rb:113 + def safe_inspect(var); end + + # pkg:gem/byebug#lib/byebug/helpers/eval.rb:119 + def safe_to_s(var); end + + # pkg:gem/byebug#lib/byebug/helpers/eval.rb:80 + def warning_msg(exception); end +end + +# Utilities for interaction with files +# +# pkg:gem/byebug#lib/byebug/helpers/file.rb:8 +module Byebug::Helpers::FileHelper + # Reads line number +lineno+ from file named +filename+ + # + # pkg:gem/byebug#lib/byebug/helpers/file.rb:19 + def get_line(filename, lineno); end + + # Reads lines of source file +filename+ into an array + # + # pkg:gem/byebug#lib/byebug/helpers/file.rb:12 + def get_lines(filename); end + + # Returns the number of lines in file +filename+ in a portable, + # one-line-at-a-time way. + # + # pkg:gem/byebug#lib/byebug/helpers/file.rb:30 + def n_lines(filename); end + + # Regularize file name. + # + # pkg:gem/byebug#lib/byebug/helpers/file.rb:37 + def normalize(filename); end + + # A short version of a long path + # + # pkg:gem/byebug#lib/byebug/helpers/file.rb:48 + def shortpath(fullpath); end + + # True for special files like -e, false otherwise + # + # pkg:gem/byebug#lib/byebug/helpers/file.rb:58 + def virtual_file?(name); end +end + +# Utilities to assist frame navigation +# +# pkg:gem/byebug#lib/byebug/helpers/frame.rb:8 +module Byebug::Helpers::FrameHelper + # pkg:gem/byebug#lib/byebug/helpers/frame.rb:16 + def jump_frames(steps); end + + # pkg:gem/byebug#lib/byebug/helpers/frame.rb:9 + def switch_to_frame(frame); end + + private + + # pkg:gem/byebug#lib/byebug/helpers/frame.rb:22 + def adjust_frame(new_frame); end + + # @param step [Integer] A positive or negative integer + # + # @return [Integer] +1 if step is positive / -1 if negative + # + # pkg:gem/byebug#lib/byebug/helpers/frame.rb:60 + def direction(step); end + + # pkg:gem/byebug#lib/byebug/helpers/frame.rb:51 + def frame_err(msg); end + + # Convert a possibly negative index to a positive index from the start + # of the callstack. -1 is the last position in the stack and so on. + # + # @param i [Integer] Integer to be converted in a proper positive index. + # + # pkg:gem/byebug#lib/byebug/helpers/frame.rb:70 + def index_from_start(index); end + + # pkg:gem/byebug#lib/byebug/helpers/frame.rb:30 + def navigate_to_frame(jump_no); end + + # pkg:gem/byebug#lib/byebug/helpers/frame.rb:47 + def out_of_bounds?(pos); end +end + +# Utilities to assist command parsing +# +# pkg:gem/byebug#lib/byebug/helpers/parse.rb:8 +module Byebug::Helpers::ParseHelper + # Parses +str+ of command +cmd+ as an integer between +min+ and +max+. + # + # If either +min+ or +max+ is nil, that value has no bound. + # + # @todo Remove the `cmd` parameter. It has nothing to do with the method's + # purpose. + # + # pkg:gem/byebug#lib/byebug/helpers/parse.rb:17 + def get_int(str, cmd, min = T.unsafe(nil), max = T.unsafe(nil)); end + + # @return +str+ as an integer or 1 if +str+ is empty. + # + # pkg:gem/byebug#lib/byebug/helpers/parse.rb:51 + def parse_steps(str, cmd); end + + # @return true if code is syntactically correct for Ruby, false otherwise + # + # pkg:gem/byebug#lib/byebug/helpers/parse.rb:35 + def syntax_valid?(code); end + + private + + # Temporarily disable output to $stderr + # + # pkg:gem/byebug#lib/byebug/helpers/parse.rb:65 + def without_stderr; end +end + +# Utilities for managing gem paths +# +# pkg:gem/byebug#lib/byebug/helpers/path.rb:8 +module Byebug::Helpers::PathHelper + # pkg:gem/byebug#lib/byebug/helpers/path.rb:29 + def all_files; end + + # pkg:gem/byebug#lib/byebug/helpers/path.rb:9 + def bin_file; end + + # pkg:gem/byebug#lib/byebug/helpers/path.rb:25 + def gem_files; end + + # pkg:gem/byebug#lib/byebug/helpers/path.rb:17 + def lib_files; end + + # pkg:gem/byebug#lib/byebug/helpers/path.rb:13 + def root_path; end + + # pkg:gem/byebug#lib/byebug/helpers/path.rb:21 + def test_files; end + + private + + # pkg:gem/byebug#lib/byebug/helpers/path.rb:35 + def glob_for(dir); end +end + +# Reflection utilitie +# +# pkg:gem/byebug#lib/byebug/helpers/reflection.rb:8 +module Byebug::Helpers::ReflectionHelper + # List of "command" classes in the including module + # + # pkg:gem/byebug#lib/byebug/helpers/reflection.rb:12 + def commands; end +end + +# Utilities for interaction with strings +# +# pkg:gem/byebug#lib/byebug/helpers/string.rb:8 +module Byebug::Helpers::StringHelper + # Converts +str+ from an_underscored-or-dasherized_string to + # ACamelizedString. + # + # pkg:gem/byebug#lib/byebug/helpers/string.rb:13 + def camelize(str); end + + # Removes a number of leading whitespace for each input line. + # + # pkg:gem/byebug#lib/byebug/helpers/string.rb:28 + def deindent(str, leading_spaces: T.unsafe(nil)); end + + # Improves indentation and spacing in +str+ for readability in Byebug's + # command prompt. + # + # pkg:gem/byebug#lib/byebug/helpers/string.rb:21 + def prettify(str); end +end + +# Utilities for thread subcommands +# +# pkg:gem/byebug#lib/byebug/helpers/thread.rb:8 +module Byebug::Helpers::ThreadHelper + # pkg:gem/byebug#lib/byebug/helpers/thread.rb:30 + def context_from_thread(thnum); end + + # pkg:gem/byebug#lib/byebug/helpers/thread.rb:26 + def current_thread?(ctx); end + + # pkg:gem/byebug#lib/byebug/helpers/thread.rb:9 + def display_context(ctx); end + + # pkg:gem/byebug#lib/byebug/helpers/thread.rb:13 + def thread_arguments(ctx); end + + private + + # pkg:gem/byebug#lib/byebug/helpers/thread.rb:62 + def debug_flag(ctx); end + + # @todo Check whether it is Byebug.current_context or context + # + # pkg:gem/byebug#lib/byebug/helpers/thread.rb:47 + def location(ctx); end + + # pkg:gem/byebug#lib/byebug/helpers/thread.rb:56 + def status_flag(ctx); end +end + +# Utilities to assist breakpoint/display enabling/disabling. +# +# pkg:gem/byebug#lib/byebug/helpers/toggle.rb:10 +module Byebug::Helpers::ToggleHelper + include ::Byebug::Helpers::ParseHelper + + # pkg:gem/byebug#lib/byebug/helpers/toggle.rb:13 + def enable_disable_breakpoints(is_enable, args); end + + # pkg:gem/byebug#lib/byebug/helpers/toggle.rb:26 + def enable_disable_display(is_enable, args); end + + private + + # pkg:gem/byebug#lib/byebug/helpers/toggle.rb:57 + def n_displays; end + + # pkg:gem/byebug#lib/byebug/helpers/toggle.rb:41 + def select_breakpoints(is_enable, args); end +end + +# Utilities for variable subcommands +# +# pkg:gem/byebug#lib/byebug/helpers/var.rb:10 +module Byebug::Helpers::VarHelper + include ::Byebug::Helpers::EvalHelper + + # pkg:gem/byebug#lib/byebug/helpers/var.rb:42 + def var_args; end + + # pkg:gem/byebug#lib/byebug/helpers/var.rb:21 + def var_global; end + + # pkg:gem/byebug#lib/byebug/helpers/var.rb:29 + def var_instance(str); end + + # pkg:gem/byebug#lib/byebug/helpers/var.rb:13 + def var_list(ary, binding = T.unsafe(nil)); end + + # pkg:gem/byebug#lib/byebug/helpers/var.rb:35 + def var_local; end +end + +# Setting to customize the file where byebug's history is saved. +# +# pkg:gem/byebug#lib/byebug/settings/histfile.rb:9 +class Byebug::HistfileSetting < ::Byebug::Setting + # pkg:gem/byebug#lib/byebug/settings/histfile.rb:12 + def banner; end + + # pkg:gem/byebug#lib/byebug/settings/histfile.rb:16 + def to_s; end +end + +# pkg:gem/byebug#lib/byebug/settings/histfile.rb:10 +Byebug::HistfileSetting::DEFAULT = T.let(T.unsafe(nil), String) + +# Handles byebug's history of commands. +# +# pkg:gem/byebug#lib/byebug/history.rb:19 +class Byebug::History + # pkg:gem/byebug#lib/byebug/history.rb:22 + def initialize; end + + # Array holding the list of commands in history + # + # pkg:gem/byebug#lib/byebug/history.rb:29 + def buffer; end + + # Discards history. + # + # pkg:gem/byebug#lib/byebug/history.rb:58 + def clear; end + + # Max number of commands to be displayed when no size has been specified. + # + # Never more than Setting[:histsize]. + # + # pkg:gem/byebug#lib/byebug/history.rb:105 + def default_max_size; end + + # Whether a specific command should not be stored in history. + # + # For now, empty lines and consecutive duplicates. + # + # pkg:gem/byebug#lib/byebug/history.rb:123 + def ignore?(buf); end + + # Array of ids of the last +number+ commands. + # + # pkg:gem/byebug#lib/byebug/history.rb:96 + def last_ids(number); end + + # Removes a command from Readline's history. + # + # pkg:gem/byebug#lib/byebug/history.rb:75 + def pop; end + + # Adds a new command to Readline's history. + # + # pkg:gem/byebug#lib/byebug/history.rb:65 + def push(cmd); end + + # Restores history from disk. + # + # pkg:gem/byebug#lib/byebug/history.rb:36 + def restore; end + + # Saves history to disk. + # + # pkg:gem/byebug#lib/byebug/history.rb:45 + def save; end + + # pkg:gem/byebug#lib/byebug/history.rb:20 + def size; end + + # pkg:gem/byebug#lib/byebug/history.rb:20 + def size=(_arg0); end + + # Max number of commands to be displayed when a size has been specified. + # + # The only bound here is not showing more items than available. + # + # pkg:gem/byebug#lib/byebug/history.rb:114 + def specific_max_size(number); end + + # Prints the requested numbers of history entries. + # + # pkg:gem/byebug#lib/byebug/history.rb:83 + def to_s(n_cmds); end +end + +# Show history of byebug commands. +# +# pkg:gem/byebug#lib/byebug/commands/history.rb:10 +class Byebug::HistoryCommand < ::Byebug::Command + include ::Byebug::Helpers::ParseHelper + + # pkg:gem/byebug#lib/byebug/commands/history.rb:31 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/history.rb:19 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/history.rb:15 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/history.rb:27 + def short_description; end + end +end + +# Setting to customize the number of byebug commands to be saved in history. +# +# pkg:gem/byebug#lib/byebug/settings/histsize.rb:9 +class Byebug::HistsizeSetting < ::Byebug::Setting + # pkg:gem/byebug#lib/byebug/settings/histsize.rb:12 + def banner; end + + # pkg:gem/byebug#lib/byebug/settings/histsize.rb:16 + def to_s; end +end + +# pkg:gem/byebug#lib/byebug/settings/histsize.rb:10 +Byebug::HistsizeSetting::DEFAULT = T.let(T.unsafe(nil), Integer) + +# Shows info about different aspects of the debugger. +# +# +# Reopens the +info+ command to define the +breakpoints+ subcommand +# +# +# Reopens the +info+ command to define the +display+ subcommand +# +# +# Reopens the +info+ command to define the +file+ subcommand +# +# +# Reopens the +info+ command to define the +line+ subcommand +# +# +# Reopens the +info+ command to define the +args+ subcommand +# +# pkg:gem/byebug#lib/byebug/commands/info/breakpoints.rb:7 +class Byebug::InfoCommand < ::Byebug::Command + include ::Byebug::Subcommands + extend ::Byebug::Helpers::ReflectionHelper + extend ::Byebug::Subcommands::ClassMethods + + class << self + # pkg:gem/byebug#lib/byebug/commands/info.rb:25 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/info.rb:21 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/info.rb:33 + def short_description; end + end +end + +# Information about current breakpoints +# +# pkg:gem/byebug#lib/byebug/commands/info/breakpoints.rb:11 +class Byebug::InfoCommand::BreakpointsCommand < ::Byebug::Command + # pkg:gem/byebug#lib/byebug/commands/info/breakpoints.rb:30 + def execute; end + + private + + # pkg:gem/byebug#lib/byebug/commands/info/breakpoints.rb:47 + def info_breakpoint(brkpt); end + + class << self + # pkg:gem/byebug#lib/byebug/commands/info/breakpoints.rb:18 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/info/breakpoints.rb:14 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/info/breakpoints.rb:26 + def short_description; end + end +end + +# Information about display expressions +# +# pkg:gem/byebug#lib/byebug/commands/info/display.rb:11 +class Byebug::InfoCommand::DisplayCommand < ::Byebug::Command + # pkg:gem/byebug#lib/byebug/commands/info/display.rb:30 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/info/display.rb:18 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/info/display.rb:14 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/info/display.rb:26 + def short_description; end + end +end + +# Information about a particular source file +# +# pkg:gem/byebug#lib/byebug/commands/info/file.rb:13 +class Byebug::InfoCommand::FileCommand < ::Byebug::Command + include ::Byebug::Helpers::FileHelper + include ::Byebug::Helpers::StringHelper + + # pkg:gem/byebug#lib/byebug/commands/info/file.rb:38 + def execute; end + + private + + # pkg:gem/byebug#lib/byebug/commands/info/file.rb:55 + def info_file_basic(file); end + + # pkg:gem/byebug#lib/byebug/commands/info/file.rb:63 + def info_file_breakpoints(file); end + + # pkg:gem/byebug#lib/byebug/commands/info/file.rb:70 + def info_file_mtime(file); end + + # pkg:gem/byebug#lib/byebug/commands/info/file.rb:74 + def info_file_sha1(file); end + + class << self + # pkg:gem/byebug#lib/byebug/commands/info/file.rb:23 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/info/file.rb:19 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/info/file.rb:34 + def short_description; end + end +end + +# Information about current location +# +# pkg:gem/byebug#lib/byebug/commands/info/line.rb:11 +class Byebug::InfoCommand::LineCommand < ::Byebug::Command + # pkg:gem/byebug#lib/byebug/commands/info/line.rb:30 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/info/line.rb:18 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/info/line.rb:14 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/info/line.rb:26 + def short_description; end + end +end + +# Information about arguments of the current method/block +# +# pkg:gem/byebug#lib/byebug/commands/info/program.rb:11 +class Byebug::InfoCommand::ProgramCommand < ::Byebug::Command + # pkg:gem/byebug#lib/byebug/commands/info/program.rb:30 + def execute; end + + private + + # pkg:gem/byebug#lib/byebug/commands/info/program.rb:37 + def format_stop_reason(stop_reason); end + + class << self + # pkg:gem/byebug#lib/byebug/commands/info/program.rb:18 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/info/program.rb:14 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/info/program.rb:26 + def short_description; end + end +end + +# Main Interface class +# +# Contains common functionality to all implemented interfaces. +# +# pkg:gem/byebug#lib/byebug/interface.rb:16 +class Byebug::Interface + include ::Byebug::Helpers::FileHelper + + # pkg:gem/byebug#lib/byebug/interface.rb:22 + def initialize; end + + # Restores history according to +autosave+ setting. + # + # pkg:gem/byebug#lib/byebug/interface.rb:118 + def autorestore; end + + # Saves or clears history according to +autosave+ setting. + # + # pkg:gem/byebug#lib/byebug/interface.rb:111 + def autosave; end + + # pkg:gem/byebug#lib/byebug/interface.rb:105 + def close; end + + # pkg:gem/byebug#lib/byebug/interface.rb:19 + def command_queue; end + + # pkg:gem/byebug#lib/byebug/interface.rb:19 + def command_queue=(_arg0); end + + # Confirms user introduced an affirmative response to the input stream. + # + # pkg:gem/byebug#lib/byebug/interface.rb:101 + def confirm(prompt); end + + # Prints an error message to the error stream. + # + # pkg:gem/byebug#lib/byebug/interface.rb:80 + def errmsg(message); end + + # pkg:gem/byebug#lib/byebug/interface.rb:20 + def error; end + + # pkg:gem/byebug#lib/byebug/interface.rb:19 + def history; end + + # pkg:gem/byebug#lib/byebug/interface.rb:19 + def history=(_arg0); end + + # pkg:gem/byebug#lib/byebug/interface.rb:20 + def input; end + + # pkg:gem/byebug#lib/byebug/interface.rb:28 + def last_if_empty(input); end + + # pkg:gem/byebug#lib/byebug/interface.rb:20 + def output; end + + # Reads a new line from the interface's input stream. + # + # @return [String] New string read or the previous string if the string + # read now was empty. + # + # pkg:gem/byebug#lib/byebug/interface.rb:70 + def prepare_input(prompt); end + + # Prints an output message to the output stream without a final "\n". + # + # pkg:gem/byebug#lib/byebug/interface.rb:94 + def print(message); end + + # Prints an output message to the output stream. + # + # pkg:gem/byebug#lib/byebug/interface.rb:87 + def puts(message); end + + # Pops a command from the input stream. + # + # pkg:gem/byebug#lib/byebug/interface.rb:35 + def read_command(prompt); end + + # Pushes lines in +filename+ to the command queue. + # + # pkg:gem/byebug#lib/byebug/interface.rb:44 + def read_file(filename); end + + # Reads a new line from the interface's input stream, parses it into + # commands and saves it to history. + # + # @return [String] Representing something to be run by the debugger. + # + # pkg:gem/byebug#lib/byebug/interface.rb:54 + def read_input(prompt, save_hist = T.unsafe(nil)); end + + private + + # Splits a command line of the form "cmd1 ; cmd2 ; ... ; cmdN" into an + # array of commands: [cmd1, cmd2, ..., cmdN] + # + # pkg:gem/byebug#lib/byebug/interface.rb:128 + def split_commands(cmd_line); end +end + +# Interrupting execution of current thread. +# +# pkg:gem/byebug#lib/byebug/commands/interrupt.rb:9 +class Byebug::InterruptCommand < ::Byebug::Command + # pkg:gem/byebug#lib/byebug/commands/interrupt.rb:28 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/interrupt.rb:16 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/interrupt.rb:12 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/interrupt.rb:24 + def short_description; end + end +end + +# Enter IRB from byebug's prompt +# +# pkg:gem/byebug#lib/byebug/commands/irb.rb:11 +class Byebug::IrbCommand < ::Byebug::Command + # pkg:gem/byebug#lib/byebug/commands/irb.rb:30 + def execute; end + + private + + # pkg:gem/byebug#lib/byebug/commands/irb.rb:40 + def with_clean_argv; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/irb.rb:18 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/irb.rb:14 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/irb.rb:26 + def short_description; end + end +end + +# Send custom signals to the debugged program. +# +# pkg:gem/byebug#lib/byebug/commands/kill.rb:9 +class Byebug::KillCommand < ::Byebug::Command + # pkg:gem/byebug#lib/byebug/commands/kill.rb:30 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/kill.rb:16 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/kill.rb:12 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/kill.rb:26 + def short_description; end + end +end + +# Setting to enable/disable linetracing. +# +# pkg:gem/byebug#lib/byebug/settings/linetrace.rb:9 +class Byebug::LinetraceSetting < ::Byebug::Setting + # pkg:gem/byebug#lib/byebug/settings/linetrace.rb:10 + def banner; end + + # pkg:gem/byebug#lib/byebug/settings/linetrace.rb:18 + def value; end + + # pkg:gem/byebug#lib/byebug/settings/linetrace.rb:14 + def value=(val); end +end + +# List parts of the source code. +# +# pkg:gem/byebug#lib/byebug/commands/list.rb:12 +class Byebug::ListCommand < ::Byebug::Command + include ::Byebug::Helpers::FileHelper + include ::Byebug::Helpers::ParseHelper + + # pkg:gem/byebug#lib/byebug/commands/list.rb:150 + def amend_final(*args, **, &block); end + + # pkg:gem/byebug#lib/byebug/commands/list.rb:40 + def execute; end + + # pkg:gem/byebug#lib/byebug/commands/list.rb:150 + def max_line(*args, **, &block); end + + # pkg:gem/byebug#lib/byebug/commands/list.rb:150 + def size(*args, **, &block); end + + private + + # Set line range to be printed by list + # + # @return first line number to list + # @return last line number to list + # + # pkg:gem/byebug#lib/byebug/commands/list.rb:79 + def auto_range(direction); end + + # Show a range of lines in the current file. + # + # @param min [Integer] Lower bound + # @param max [Integer] Upper bound + # + # pkg:gem/byebug#lib/byebug/commands/list.rb:115 + def display_lines(min, max); end + + # @param range [String] A string with an integer range format + # + # @return [String] The lower bound of the given range + # + # pkg:gem/byebug#lib/byebug/commands/list.rb:126 + def lower_bound(range); end + + # pkg:gem/byebug#lib/byebug/commands/list.rb:105 + def move(line, size, direction = T.unsafe(nil)); end + + # pkg:gem/byebug#lib/byebug/commands/list.rb:89 + def parse_range(input); end + + # Line range to be printed by `list`. + # + # If is set, range is parsed from it. + # + # Otherwise it's automatically chosen. + # + # pkg:gem/byebug#lib/byebug/commands/list.rb:60 + def range(input); end + + # pkg:gem/byebug#lib/byebug/commands/list.rb:152 + def source_file_formatter; end + + # @param str [String] A string with an integer range format + # + # @return [Array] The upper & lower bounds of the given range + # + # pkg:gem/byebug#lib/byebug/commands/list.rb:144 + def split_range(str); end + + # @param range [String] A string with an integer range format + # + # @return [String] The upper bound of the given range + # + # pkg:gem/byebug#lib/byebug/commands/list.rb:135 + def upper_bound(range); end + + # pkg:gem/byebug#lib/byebug/commands/list.rb:69 + def valid_range?(first, last); end + + class << self + # pkg:gem/byebug#lib/byebug/commands/list.rb:22 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/list.rb:18 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/list.rb:36 + def short_description; end + end +end + +# Setting to customize the number of source code lines to be displayed every +# time the "list" command is invoked. +# +# pkg:gem/byebug#lib/byebug/settings/listsize.rb:10 +class Byebug::ListsizeSetting < ::Byebug::Setting + # pkg:gem/byebug#lib/byebug/settings/listsize.rb:13 + def banner; end + + # pkg:gem/byebug#lib/byebug/settings/listsize.rb:17 + def to_s; end +end + +# pkg:gem/byebug#lib/byebug/settings/listsize.rb:11 +Byebug::ListsizeSetting::DEFAULT = T.let(T.unsafe(nil), Integer) + +# Interface class for standard byebug use. +# +# pkg:gem/byebug#lib/byebug/interfaces/local_interface.rb:7 +class Byebug::LocalInterface < ::Byebug::Interface + # pkg:gem/byebug#lib/byebug/interfaces/local_interface.rb:10 + def initialize; end + + # Reads a single line of input using Readline. If Ctrl-D is pressed, it + # returns "continue", meaning that program's execution will go on. + # + # @param prompt Prompt to be displayed. + # + # pkg:gem/byebug#lib/byebug/interfaces/local_interface.rb:23 + def readline(prompt); end + + # Yields the block handling Ctrl-C the following way: if pressed while + # waiting for input, the line is reset to only the prompt and we ask for + # input again. + # + # @note Any external 'INT' traps are overriden during this method. + # + # pkg:gem/byebug#lib/byebug/interfaces/local_interface.rb:34 + def with_repl_like_sigint; end + + # Disable any Readline completion procs. + # + # Other gems, for example, IRB could've installed completion procs that are + # dependent on them being loaded. Disable those while byebug is the REPL + # making use of Readline. + # + # pkg:gem/byebug#lib/byebug/interfaces/local_interface.rb:51 + def without_readline_completion; end +end + +# pkg:gem/byebug#lib/byebug/interfaces/local_interface.rb:8 +Byebug::LocalInterface::EOF_ALIAS = T.let(T.unsafe(nil), String) + +# Show methods of specific classes/modules/objects. +# +# pkg:gem/byebug#lib/byebug/commands/method.rb:10 +class Byebug::MethodCommand < ::Byebug::Command + include ::Byebug::Helpers::EvalHelper + + # pkg:gem/byebug#lib/byebug/commands/method.rb:37 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/method.rb:19 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/method.rb:15 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/method.rb:33 + def short_description; end + end +end + +# Implements the next functionality. +# +# Allows the user the continue execution until the next instruction in the +# current frame. +# +# pkg:gem/byebug#lib/byebug/commands/next.rb:13 +class Byebug::NextCommand < ::Byebug::Command + include ::Byebug::Helpers::ParseHelper + + # pkg:gem/byebug#lib/byebug/commands/next.rb:32 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/next.rb:20 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/next.rb:16 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/next.rb:28 + def short_description; end + end +end + +# Port number used for remote debugging +# +# pkg:gem/byebug#lib/byebug/remote.rb:13 +Byebug::PORT = T.let(T.unsafe(nil), Integer) + +# Processes commands in post_mortem mode +# +# pkg:gem/byebug#lib/byebug/processors/post_mortem_processor.rb:9 +class Byebug::PostMortemProcessor < ::Byebug::CommandProcessor + # pkg:gem/byebug#lib/byebug/processors/post_mortem_processor.rb:10 + def commands; end + + # pkg:gem/byebug#lib/byebug/processors/post_mortem_processor.rb:14 + def prompt; end +end + +# Setting to enable/disable post_mortem mode, i.e., a debugger prompt after +# program termination by unhandled exception. +# +# pkg:gem/byebug#lib/byebug/settings/post_mortem.rb:10 +class Byebug::PostMortemSetting < ::Byebug::Setting + # pkg:gem/byebug#lib/byebug/settings/post_mortem.rb:11 + def initialize; end + + # pkg:gem/byebug#lib/byebug/settings/post_mortem.rb:15 + def banner; end + + # pkg:gem/byebug#lib/byebug/settings/post_mortem.rb:23 + def value; end + + # pkg:gem/byebug#lib/byebug/settings/post_mortem.rb:19 + def value=(val); end +end + +# pkg:gem/byebug#lib/byebug/printers/base.rb:6 +module Byebug::Printers; end + +# Base printer +# +# pkg:gem/byebug#lib/byebug/printers/base.rb:10 +class Byebug::Printers::Base + # pkg:gem/byebug#lib/byebug/printers/base.rb:16 + def type; end + + private + + # pkg:gem/byebug#lib/byebug/printers/base.rb:55 + def array_of_args(collection, &_block); end + + # pkg:gem/byebug#lib/byebug/printers/base.rb:49 + def contents; end + + # pkg:gem/byebug#lib/byebug/printers/base.rb:63 + def contents_files; end + + # pkg:gem/byebug#lib/byebug/printers/base.rb:22 + def locate(path); end + + # pkg:gem/byebug#lib/byebug/printers/base.rb:45 + def parts(path); end + + # pkg:gem/byebug#lib/byebug/printers/base.rb:35 + def translate(string, args = T.unsafe(nil)); end +end + +# pkg:gem/byebug#lib/byebug/printers/base.rb:12 +class Byebug::Printers::Base::MissedArgument < ::StandardError; end + +# pkg:gem/byebug#lib/byebug/printers/base.rb:11 +class Byebug::Printers::Base::MissedPath < ::StandardError; end + +# pkg:gem/byebug#lib/byebug/printers/base.rb:14 +Byebug::Printers::Base::SEPARATOR = T.let(T.unsafe(nil), String) + +# Plain text printer +# +# pkg:gem/byebug#lib/byebug/printers/plain.rb:10 +class Byebug::Printers::Plain < ::Byebug::Printers::Base + # pkg:gem/byebug#lib/byebug/printers/plain.rb:11 + def print(path, args = T.unsafe(nil)); end + + # pkg:gem/byebug#lib/byebug/printers/plain.rb:17 + def print_collection(path, collection, &block); end + + # pkg:gem/byebug#lib/byebug/printers/plain.rb:25 + def print_variables(variables, *_unused); end + + private + + # pkg:gem/byebug#lib/byebug/printers/plain.rb:39 + def contents_files; end +end + +# Enter Pry from byebug's prompt +# +# pkg:gem/byebug#lib/byebug/commands/pry.rb:10 +class Byebug::PryCommand < ::Byebug::Command + # pkg:gem/byebug#lib/byebug/commands/pry.rb:29 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/pry.rb:17 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/pry.rb:13 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/pry.rb:25 + def short_description; end + end +end + +# Exit from byebug. +# +# pkg:gem/byebug#lib/byebug/commands/quit.rb:9 +class Byebug::QuitCommand < ::Byebug::Command + # pkg:gem/byebug#lib/byebug/commands/quit.rb:33 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/quit.rb:17 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/quit.rb:13 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/quit.rb:29 + def short_description; end + end +end + +# pkg:gem/byebug#lib/byebug/remote/server.rb:6 +module Byebug::Remote; end + +# Client for remote debugging +# +# pkg:gem/byebug#lib/byebug/remote/client.rb:10 +class Byebug::Remote::Client + # pkg:gem/byebug#lib/byebug/remote/client.rb:13 + def initialize(interface); end + + # pkg:gem/byebug#lib/byebug/remote/client.rb:11 + def interface; end + + # pkg:gem/byebug#lib/byebug/remote/client.rb:11 + def socket; end + + # Connects to the remote byebug + # + # pkg:gem/byebug#lib/byebug/remote/client.rb:21 + def start(host = T.unsafe(nil), port = T.unsafe(nil)); end + + # pkg:gem/byebug#lib/byebug/remote/client.rb:44 + def started?; end + + private + + # pkg:gem/byebug#lib/byebug/remote/client.rb:50 + def connect_at(host, port); end +end + +# Server for remote debugging +# +# pkg:gem/byebug#lib/byebug/remote/server.rb:10 +class Byebug::Remote::Server + # pkg:gem/byebug#lib/byebug/remote/server.rb:13 + def initialize(wait_connection:, &block); end + + # pkg:gem/byebug#lib/byebug/remote/server.rb:11 + def actual_port; end + + # Start the remote debugging server + # + # pkg:gem/byebug#lib/byebug/remote/server.rb:22 + def start(host, port); end + + # pkg:gem/byebug#lib/byebug/remote/server.rb:11 + def wait_connection; end +end + +# Interface class for remote use of byebug. +# +# pkg:gem/byebug#lib/byebug/interfaces/remote_interface.rb:9 +class Byebug::RemoteInterface < ::Byebug::Interface + # pkg:gem/byebug#lib/byebug/interfaces/remote_interface.rb:10 + def initialize(socket); end + + # pkg:gem/byebug#lib/byebug/interfaces/remote_interface.rb:41 + def close; end + + # pkg:gem/byebug#lib/byebug/interfaces/remote_interface.rb:23 + def confirm(prompt); end + + # pkg:gem/byebug#lib/byebug/interfaces/remote_interface.rb:29 + def print(message); end + + # pkg:gem/byebug#lib/byebug/interfaces/remote_interface.rb:35 + def puts(message); end + + # pkg:gem/byebug#lib/byebug/interfaces/remote_interface.rb:17 + def read_command(prompt); end + + # pkg:gem/byebug#lib/byebug/interfaces/remote_interface.rb:45 + def readline(prompt); end +end + +# Restart debugged program from within byebug. +# +# pkg:gem/byebug#lib/byebug/commands/restart.rb:14 +class Byebug::RestartCommand < ::Byebug::Command + include ::Byebug::Helpers::BinHelper + include ::Byebug::Helpers::PathHelper + + # pkg:gem/byebug#lib/byebug/commands/restart.rb:40 + def execute; end + + private + + # pkg:gem/byebug#lib/byebug/commands/restart.rb:54 + def prepend_byebug_bin(cmd); end + + # pkg:gem/byebug#lib/byebug/commands/restart.rb:59 + def prepend_ruby_bin(cmd); end + + class << self + # pkg:gem/byebug#lib/byebug/commands/restart.rb:25 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/restart.rb:21 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/restart.rb:36 + def short_description; end + end +end + +# Save current settings to use them in another debug session. +# +# pkg:gem/byebug#lib/byebug/commands/save.rb:9 +class Byebug::SaveCommand < ::Byebug::Command + # pkg:gem/byebug#lib/byebug/commands/save.rb:36 + def execute; end + + private + + # pkg:gem/byebug#lib/byebug/commands/save.rb:50 + def save_breakpoints(file); end + + # pkg:gem/byebug#lib/byebug/commands/save.rb:56 + def save_catchpoints(file); end + + # pkg:gem/byebug#lib/byebug/commands/save.rb:62 + def save_displays(file); end + + # pkg:gem/byebug#lib/byebug/commands/save.rb:66 + def save_settings(file); end + + class << self + # pkg:gem/byebug#lib/byebug/commands/save.rb:17 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/save.rb:13 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/save.rb:32 + def short_description; end + end +end + +# Setting to customize the file where byebug's history is saved. +# +# pkg:gem/byebug#lib/byebug/settings/savefile.rb:9 +class Byebug::SavefileSetting < ::Byebug::Setting + # pkg:gem/byebug#lib/byebug/settings/savefile.rb:12 + def banner; end + + # pkg:gem/byebug#lib/byebug/settings/savefile.rb:16 + def to_s; end +end + +# pkg:gem/byebug#lib/byebug/settings/savefile.rb:10 +Byebug::SavefileSetting::DEFAULT = T.let(T.unsafe(nil), String) + +# Interface class for command execution from script files. +# +# pkg:gem/byebug#lib/byebug/interfaces/script_interface.rb:7 +class Byebug::ScriptInterface < ::Byebug::Interface + # pkg:gem/byebug#lib/byebug/interfaces/script_interface.rb:8 + def initialize(file, verbose = T.unsafe(nil)); end + + # pkg:gem/byebug#lib/byebug/interfaces/script_interface.rb:20 + def close; end + + # pkg:gem/byebug#lib/byebug/interfaces/script_interface.rb:16 + def read_command(prompt); end + + # pkg:gem/byebug#lib/byebug/interfaces/script_interface.rb:24 + def readline(*); end +end + +# Processes commands from a file +# +# pkg:gem/byebug#lib/byebug/processors/script_processor.rb:9 +class Byebug::ScriptProcessor < ::Byebug::CommandProcessor + # pkg:gem/byebug#lib/byebug/processors/script_processor.rb:28 + def after_repl; end + + # Available commands + # + # pkg:gem/byebug#lib/byebug/processors/script_processor.rb:13 + def commands; end + + # Prompt shown before reading a command. + # + # pkg:gem/byebug#lib/byebug/processors/script_processor.rb:37 + def prompt; end + + # pkg:gem/byebug#lib/byebug/processors/script_processor.rb:17 + def repl; end + + private + + # pkg:gem/byebug#lib/byebug/processors/script_processor.rb:43 + def without_exceptions; end +end + +# Change byebug settings. +# +# pkg:gem/byebug#lib/byebug/commands/set.rb:10 +class Byebug::SetCommand < ::Byebug::Command + include ::Byebug::Helpers::ParseHelper + + # pkg:gem/byebug#lib/byebug/commands/set.rb:42 + def execute; end + + private + + # pkg:gem/byebug#lib/byebug/commands/set.rb:66 + def get_onoff(arg, default); end + + class << self + # pkg:gem/byebug#lib/byebug/commands/set.rb:20 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/set.rb:38 + def help; end + + # pkg:gem/byebug#lib/byebug/commands/set.rb:16 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/set.rb:34 + def short_description; end + end +end + +# Parent class for all byebug settings. +# +# pkg:gem/byebug#lib/byebug/setting.rb:9 +class Byebug::Setting + # pkg:gem/byebug#lib/byebug/setting.rb:14 + def initialize; end + + # pkg:gem/byebug#lib/byebug/setting.rb:18 + def boolean?; end + + # pkg:gem/byebug#lib/byebug/setting.rb:28 + def help; end + + # pkg:gem/byebug#lib/byebug/setting.rb:22 + def integer?; end + + # pkg:gem/byebug#lib/byebug/setting.rb:37 + def to_s; end + + # pkg:gem/byebug#lib/byebug/setting.rb:32 + def to_sym; end + + # pkg:gem/byebug#lib/byebug/setting.rb:10 + def value; end + + # pkg:gem/byebug#lib/byebug/setting.rb:10 + def value=(_arg0); end + + class << self + # pkg:gem/byebug#lib/byebug/setting.rb:46 + def [](name); end + + # pkg:gem/byebug#lib/byebug/setting.rb:50 + def []=(name, value); end + + # pkg:gem/byebug#lib/byebug/setting.rb:54 + def find(shortcut); end + + # @todo DRY this up. Very similar code exists in the CommandList class + # + # pkg:gem/byebug#lib/byebug/setting.rb:65 + def help_all; end + + # pkg:gem/byebug#lib/byebug/setting.rb:42 + def settings; end + end +end + +# pkg:gem/byebug#lib/byebug/setting.rb:12 +Byebug::Setting::DEFAULT = T.let(T.unsafe(nil), FalseClass) + +# Show byebug settings. +# +# pkg:gem/byebug#lib/byebug/commands/show.rb:9 +class Byebug::ShowCommand < ::Byebug::Command + # pkg:gem/byebug#lib/byebug/commands/show.rb:35 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/show.rb:17 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/show.rb:31 + def help; end + + # pkg:gem/byebug#lib/byebug/commands/show.rb:13 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/show.rb:27 + def short_description; end + end +end + +# Allows the user to continue execution until the next breakpoint, as +# long as it is different from the current one +# +# pkg:gem/byebug#lib/byebug/commands/skip.rb:11 +class Byebug::SkipCommand < ::Byebug::Command + include ::Byebug::Helpers::ParseHelper + + # pkg:gem/byebug#lib/byebug/commands/skip.rb:70 + def auto_run; end + + # pkg:gem/byebug#lib/byebug/commands/skip.rb:77 + def execute; end + + # pkg:gem/byebug#lib/byebug/commands/skip.rb:53 + def initialize_attributes; end + + # pkg:gem/byebug#lib/byebug/commands/skip.rb:60 + def keep_execution; end + + # pkg:gem/byebug#lib/byebug/commands/skip.rb:64 + def reset_attributes; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/skip.rb:41 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/skip.rb:18 + def file_line; end + + # pkg:gem/byebug#lib/byebug/commands/skip.rb:15 + def file_line=(_arg0); end + + # pkg:gem/byebug#lib/byebug/commands/skip.rb:22 + def file_path; end + + # pkg:gem/byebug#lib/byebug/commands/skip.rb:15 + def file_path=(_arg0); end + + # pkg:gem/byebug#lib/byebug/commands/skip.rb:16 + def previous_autolist; end + + # pkg:gem/byebug#lib/byebug/commands/skip.rb:37 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/skip.rb:31 + def restore_autolist; end + + # pkg:gem/byebug#lib/byebug/commands/skip.rb:26 + def setup_autolist(value); end + + # pkg:gem/byebug#lib/byebug/commands/skip.rb:49 + def short_description; end + end +end + +# Execute a file containing byebug commands. +# +# It can be used to restore a previously saved debugging session. +# +# pkg:gem/byebug#lib/byebug/commands/source.rb:11 +class Byebug::SourceCommand < ::Byebug::Command + # pkg:gem/byebug#lib/byebug/commands/source.rb:31 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/source.rb:19 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/source.rb:15 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/source.rb:27 + def short_description; end + end +end + +# Formats specific line ranges in a source file +# +# pkg:gem/byebug#lib/byebug/source_file_formatter.rb:10 +class Byebug::SourceFileFormatter + include ::Byebug::Helpers::FileHelper + + # pkg:gem/byebug#lib/byebug/source_file_formatter.rb:15 + def initialize(file, annotator); end + + # pkg:gem/byebug#lib/byebug/source_file_formatter.rb:67 + def amend(line, ceiling); end + + # pkg:gem/byebug#lib/byebug/source_file_formatter.rb:51 + def amend_final(line); end + + # pkg:gem/byebug#lib/byebug/source_file_formatter.rb:47 + def amend_initial(line); end + + # pkg:gem/byebug#lib/byebug/source_file_formatter.rb:13 + def annotator; end + + # pkg:gem/byebug#lib/byebug/source_file_formatter.rb:13 + def file; end + + # pkg:gem/byebug#lib/byebug/source_file_formatter.rb:20 + def lines(min, max); end + + # pkg:gem/byebug#lib/byebug/source_file_formatter.rb:33 + def lines_around(center); end + + # pkg:gem/byebug#lib/byebug/source_file_formatter.rb:55 + def max_initial_line; end + + # pkg:gem/byebug#lib/byebug/source_file_formatter.rb:59 + def max_line; end + + # pkg:gem/byebug#lib/byebug/source_file_formatter.rb:37 + def range_around(center); end + + # pkg:gem/byebug#lib/byebug/source_file_formatter.rb:41 + def range_from(min); end + + # pkg:gem/byebug#lib/byebug/source_file_formatter.rb:63 + def size; end +end + +# Setting to enable/disable the display of backtraces when evaluations raise +# errors. +# +# pkg:gem/byebug#lib/byebug/settings/stack_on_error.rb:10 +class Byebug::StackOnErrorSetting < ::Byebug::Setting + # pkg:gem/byebug#lib/byebug/settings/stack_on_error.rb:11 + def banner; end +end + +# Implements the step functionality. +# +# Allows the user the continue execution until the next instruction, possibily +# in a different frame. Use step to step into method calls or blocks. +# +# pkg:gem/byebug#lib/byebug/commands/step.rb:13 +class Byebug::StepCommand < ::Byebug::Command + include ::Byebug::Helpers::ParseHelper + + # pkg:gem/byebug#lib/byebug/commands/step.rb:32 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/step.rb:20 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/step.rb:16 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/step.rb:28 + def short_description; end + end +end + +# Subcommand additions. +# +# pkg:gem/byebug#lib/byebug/subcommands.rb:12 +module Byebug::Subcommands + extend ::Forwardable + + mixes_in_class_methods ::Byebug::Subcommands::ClassMethods + + # Delegates to subcommands or prints help if no subcommand specified. + # + # pkg:gem/byebug#lib/byebug/subcommands.rb:23 + def execute; end + + # pkg:gem/byebug#lib/byebug/subcommands.rb:18 + def subcommand_list(*args, **, &block); end + + class << self + # pkg:gem/byebug#lib/byebug/subcommands.rb:13 + def included(command); end + end +end + +# Class methods added to subcommands +# +# pkg:gem/byebug#lib/byebug/subcommands.rb:36 +module Byebug::Subcommands::ClassMethods + include ::Byebug::Helpers::ReflectionHelper + + # Default help text for a command with subcommands + # + # pkg:gem/byebug#lib/byebug/subcommands.rb:42 + def help; end + + # Command's subcommands. + # + # pkg:gem/byebug#lib/byebug/subcommands.rb:49 + def subcommand_list; end +end + +# Manipulation of Ruby threads +# +# +# Reopens the +thread+ command to define the +current+ subcommand +# +# +# Reopens the +thread+ command to define the +list+ subcommand +# +# +# Reopens the +thread+ command to define the +resume+ subcommand +# +# +# Reopens the +thread+ command to define the +stop+ subcommand +# +# +# Reopens the +thread+ command to define the +switch+ subcommand +# +# pkg:gem/byebug#lib/byebug/commands/thread/current.rb:9 +class Byebug::ThreadCommand < ::Byebug::Command + include ::Byebug::Subcommands + extend ::Byebug::Helpers::ReflectionHelper + extend ::Byebug::Subcommands::ClassMethods + + class << self + # pkg:gem/byebug#lib/byebug/commands/thread.rb:22 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/thread.rb:18 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/thread.rb:30 + def short_description; end + end +end + +# Information about the current thread +# +# pkg:gem/byebug#lib/byebug/commands/thread/current.rb:13 +class Byebug::ThreadCommand::CurrentCommand < ::Byebug::Command + include ::Byebug::Helpers::ThreadHelper + + # pkg:gem/byebug#lib/byebug/commands/thread/current.rb:32 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/thread/current.rb:20 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/thread/current.rb:16 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/thread/current.rb:28 + def short_description; end + end +end + +# Information about threads +# +# pkg:gem/byebug#lib/byebug/commands/thread/list.rb:13 +class Byebug::ThreadCommand::ListCommand < ::Byebug::Command + include ::Byebug::Helpers::ThreadHelper + + # pkg:gem/byebug#lib/byebug/commands/thread/list.rb:32 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/thread/list.rb:20 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/thread/list.rb:16 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/thread/list.rb:28 + def short_description; end + end +end + +# Resumes the specified thread +# +# pkg:gem/byebug#lib/byebug/commands/thread/resume.rb:13 +class Byebug::ThreadCommand::ResumeCommand < ::Byebug::Command + include ::Byebug::Helpers::ThreadHelper + + # pkg:gem/byebug#lib/byebug/commands/thread/resume.rb:32 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/thread/resume.rb:20 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/thread/resume.rb:16 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/thread/resume.rb:28 + def short_description; end + end +end + +# Stops the specified thread +# +# pkg:gem/byebug#lib/byebug/commands/thread/stop.rb:13 +class Byebug::ThreadCommand::StopCommand < ::Byebug::Command + include ::Byebug::Helpers::ThreadHelper + + # pkg:gem/byebug#lib/byebug/commands/thread/stop.rb:32 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/thread/stop.rb:20 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/thread/stop.rb:16 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/thread/stop.rb:28 + def short_description; end + end +end + +# Switches to the specified thread +# +# pkg:gem/byebug#lib/byebug/commands/thread/switch.rb:13 +class Byebug::ThreadCommand::SwitchCommand < ::Byebug::Command + include ::Byebug::Helpers::ThreadHelper + + # pkg:gem/byebug#lib/byebug/commands/thread/switch.rb:32 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/thread/switch.rb:20 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/thread/switch.rb:16 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/thread/switch.rb:28 + def short_description; end + end +end + +class Byebug::ThreadsTable; end + +# Show (and possibily stop) at every line that changes a global variable. +# +# pkg:gem/byebug#lib/byebug/commands/tracevar.rb:9 +class Byebug::TracevarCommand < ::Byebug::Command + # pkg:gem/byebug#lib/byebug/commands/tracevar.rb:32 + def execute; end + + private + + # pkg:gem/byebug#lib/byebug/commands/tracevar.rb:48 + def on_change(name, value, stop); end + + class << self + # pkg:gem/byebug#lib/byebug/commands/tracevar.rb:16 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/tracevar.rb:10 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/tracevar.rb:28 + def short_description; end + end +end + +# Remove expressions from display list. +# +# pkg:gem/byebug#lib/byebug/commands/undisplay.rb:10 +class Byebug::UndisplayCommand < ::Byebug::Command + include ::Byebug::Helpers::ParseHelper + + # pkg:gem/byebug#lib/byebug/commands/undisplay.rb:35 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/undisplay.rb:19 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/undisplay.rb:15 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/undisplay.rb:31 + def short_description; end + end +end + +# Stop tracing a global variable. +# +# pkg:gem/byebug#lib/byebug/commands/untracevar.rb:9 +class Byebug::UntracevarCommand < ::Byebug::Command + # pkg:gem/byebug#lib/byebug/commands/untracevar.rb:26 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/untracevar.rb:14 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/untracevar.rb:10 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/untracevar.rb:22 + def short_description; end + end +end + +# Move the current frame up in the backtrace. +# +# pkg:gem/byebug#lib/byebug/commands/up.rb:12 +class Byebug::UpCommand < ::Byebug::Command + include ::Byebug::Helpers::FrameHelper + include ::Byebug::Helpers::ParseHelper + + # pkg:gem/byebug#lib/byebug/commands/up.rb:36 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/up.rb:22 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/up.rb:18 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/up.rb:32 + def short_description; end + end +end + +# Shows variables and its values +# +# +# Reopens the +var+ command to define the +all+ subcommand +# +# +# Reopens the +var+ command to define the +args+ subcommand +# +# +# Reopens the +var+ command to define the +const+ subcommand +# +# +# Reopens the +var+ command to define the +global+ subcommand +# +# +# Reopens the +var+ command to define the +instance+ subcommand +# +# +# Reopens the +var+ command to define the +local+ subcommand +# +# pkg:gem/byebug#lib/byebug/commands/var/all.rb:9 +class Byebug::VarCommand < ::Byebug::Command + include ::Byebug::Subcommands + extend ::Byebug::Helpers::ReflectionHelper + extend ::Byebug::Subcommands::ClassMethods + + class << self + # pkg:gem/byebug#lib/byebug/commands/var.rb:25 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/var.rb:21 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/var.rb:33 + def short_description; end + end +end + +# Shows global, instance and local variables +# +# pkg:gem/byebug#lib/byebug/commands/var/all.rb:13 +class Byebug::VarCommand::AllCommand < ::Byebug::Command + include ::Byebug::Helpers::EvalHelper + include ::Byebug::Helpers::VarHelper + + # pkg:gem/byebug#lib/byebug/commands/var/all.rb:34 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/var/all.rb:22 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/var/all.rb:18 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/var/all.rb:30 + def short_description; end + end +end + +# Information about arguments of the current method/block +# +# pkg:gem/byebug#lib/byebug/commands/var/args.rb:13 +class Byebug::VarCommand::ArgsCommand < ::Byebug::Command + include ::Byebug::Helpers::EvalHelper + include ::Byebug::Helpers::VarHelper + + # pkg:gem/byebug#lib/byebug/commands/var/args.rb:34 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/var/args.rb:22 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/var/args.rb:18 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/var/args.rb:30 + def short_description; end + end +end + +# Shows constants +# +# pkg:gem/byebug#lib/byebug/commands/var/const.rb:13 +class Byebug::VarCommand::ConstCommand < ::Byebug::Command + include ::Byebug::Helpers::EvalHelper + + # pkg:gem/byebug#lib/byebug/commands/var/const.rb:34 + def execute; end + + private + + # pkg:gem/byebug#lib/byebug/commands/var/const.rb:44 + def str_obj; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/var/const.rb:22 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/var/const.rb:18 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/var/const.rb:30 + def short_description; end + end +end + +# Shows global variables +# +# pkg:gem/byebug#lib/byebug/commands/var/global.rb:11 +class Byebug::VarCommand::GlobalCommand < ::Byebug::Command + include ::Byebug::Helpers::EvalHelper + include ::Byebug::Helpers::VarHelper + + # pkg:gem/byebug#lib/byebug/commands/var/global.rb:32 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/var/global.rb:20 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/var/global.rb:16 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/var/global.rb:28 + def short_description; end + end +end + +# Shows instance variables +# +# pkg:gem/byebug#lib/byebug/commands/var/instance.rb:13 +class Byebug::VarCommand::InstanceCommand < ::Byebug::Command + include ::Byebug::Helpers::EvalHelper + include ::Byebug::Helpers::VarHelper + + # pkg:gem/byebug#lib/byebug/commands/var/instance.rb:34 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/var/instance.rb:22 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/var/instance.rb:18 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/var/instance.rb:30 + def short_description; end + end +end + +# Shows local variables in current scope +# +# pkg:gem/byebug#lib/byebug/commands/var/local.rb:13 +class Byebug::VarCommand::LocalCommand < ::Byebug::Command + include ::Byebug::Helpers::EvalHelper + include ::Byebug::Helpers::VarHelper + + # pkg:gem/byebug#lib/byebug/commands/var/local.rb:34 + def execute; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/var/local.rb:22 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/var/local.rb:18 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/var/local.rb:30 + def short_description; end + end +end + +# Show current backtrace. +# +# pkg:gem/byebug#lib/byebug/commands/where.rb:11 +class Byebug::WhereCommand < ::Byebug::Command + include ::Byebug::Helpers::FrameHelper + + # pkg:gem/byebug#lib/byebug/commands/where.rb:39 + def execute; end + + private + + # pkg:gem/byebug#lib/byebug/commands/where.rb:45 + def print_backtrace; end + + class << self + # pkg:gem/byebug#lib/byebug/commands/where.rb:20 + def description; end + + # pkg:gem/byebug#lib/byebug/commands/where.rb:16 + def regexp; end + + # pkg:gem/byebug#lib/byebug/commands/where.rb:35 + def short_description; end + end +end + +# Setting to customize the maximum width of byebug's output. +# +# pkg:gem/byebug#lib/byebug/settings/width.rb:9 +class Byebug::WidthSetting < ::Byebug::Setting + # pkg:gem/byebug#lib/byebug/settings/width.rb:12 + def banner; end + + # pkg:gem/byebug#lib/byebug/settings/width.rb:16 + def to_s; end +end + +# pkg:gem/byebug#lib/byebug/settings/width.rb:10 +Byebug::WidthSetting::DEFAULT = T.let(T.unsafe(nil), Integer) + +# Extends the extension class to be able to pass information about the +# debugging environment from the c-extension to the user. +# +# pkg:gem/byebug#lib/byebug/core.rb:113 +class Exception + # pkg:gem/byebug#lib/byebug/core.rb:114 + def __bb_context; end +end + +# Adds a `byebug` method to the Kernel module. +# +# Dropping a `byebug` call anywhere in your code, you get a debug prompt. +# +# pkg:gem/byebug#lib/byebug/attacher.rb:34 +module Kernel + # pkg:gem/byebug#lib/byebug/attacher.rb:35 + def byebug; end + + # pkg:gem/byebug#lib/byebug/attacher.rb:47 + def debugger; end + + # pkg:gem/byebug#lib/byebug/attacher.rb:41 + def remote_byebug(host = T.unsafe(nil), port = T.unsafe(nil)); end +end diff --git a/sorbet/rbi/gems/cancancan@3.6.1.rbi b/sorbet/rbi/gems/cancancan@3.6.1.rbi new file mode 100644 index 000000000..a9aa5bf5f --- /dev/null +++ b/sorbet/rbi/gems/cancancan@3.6.1.rbi @@ -0,0 +1,1822 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `cancancan` gem. +# Please instead update this file by running `bin/tapioca gem cancancan`. + + +# this class is responsible of converting the hash of conditions +# in "where conditions" to generate the sql query +# it consists of a names_cache that helps calculating the next name given to the association +# it tries to reflect the behavior of ActiveRecord when generating aliases for tables. +# this class is responsible of normalizing the hash of conditions +# by exploding has_many through associations +# when a condition is defined with an has_many through association this is exploded in all its parts +# TODO: it could identify STI and normalize it +# this class is responsible for detecting sti classes and creating new rules for the +# relevant subclasses, using the inheritance_column as a merger +# +# pkg:gem/cancancan#lib/cancan/version.rb:3 +module CanCan + class << self + # Determines how CanCan should build queries when calling accessible_by, + # if the query will contain a join. The default strategy is `:subquery`. + # + # # config/initializers/cancan.rb + # CanCan.accessible_by_strategy = :subquery + # + # Valid strategies are: + # - :subquery - Creates a nested query with all joins, wrapped by a + # WHERE IN query. + # - :left_join - Calls the joins directly using `left_joins`, and + # ensures records are unique using `distinct`. Note that + # `distinct` is not reliable in some cases. See + # https://github.com/CanCanCommunity/cancancan/pull/605 + # + # pkg:gem/cancancan#lib/cancan/config.rb:50 + def accessible_by_strategy; end + + # pkg:gem/cancancan#lib/cancan/config.rb:67 + def accessible_by_strategy=(value); end + + # pkg:gem/cancancan#lib/cancan/config.rb:56 + def default_accessible_by_strategy; end + + # pkg:gem/cancancan#lib/cancan/config.rb:97 + def does_not_support_subquery_strategy?; end + + # You can disable the rules compressor if it's causing unexpected issues. + # + # pkg:gem/cancancan#lib/cancan/config.rb:15 + def rules_compressor_enabled; end + + # pkg:gem/cancancan#lib/cancan/config.rb:21 + def rules_compressor_enabled=(value); end + + # pkg:gem/cancancan#lib/cancan/config.rb:4 + def valid_accessible_by_strategies; end + + # pkg:gem/cancancan#lib/cancan/config.rb:91 + def validate_accessible_by_strategy!(value); end + + # pkg:gem/cancancan#lib/cancan/config.rb:77 + def with_accessible_by_strategy(value); end + + # pkg:gem/cancancan#lib/cancan/config.rb:25 + def with_rules_compressor_enabled(value); end + end +end + +# This module is designed to be included into an Ability class. This will +# provide the "can" methods for defining and checking abilities. +# +# class Ability +# include CanCan::Ability +# +# def initialize(user) +# if user.admin? +# can :manage, :all +# else +# can :read, :all +# end +# end +# end +# +# pkg:gem/cancancan#lib/cancan/ability/rules.rb:4 +module CanCan::Ability + include ::CanCan::Ability::Rules + include ::CanCan::Ability::Actions + include ::CanCan::UnauthorizedMessageResolver + include ::CanCan::Ability::StrongParameterSupport + + # pkg:gem/cancancan#lib/cancan/ability.rb:185 + def attributes_for(action, subject); end + + # See ControllerAdditions#authorize! for documentation. + # + # pkg:gem/cancancan#lib/cancan/ability.rb:176 + def authorize!(action, subject, *args); end + + # Defines which abilities are allowed using two arguments. The first one is the action + # you're setting the permission for, the second one is the class of object you're setting it on. + # + # can :update, Article + # + # You can pass an array for either of these parameters to match any one. + # Here the user has the ability to update or destroy both articles and comments. + # + # can [:update, :destroy], [Article, Comment] + # + # You can pass :all to match any object and :manage to match any action. Here are some examples. + # + # can :manage, :all + # can :update, :all + # can :manage, Project + # + # You can pass a hash of conditions as the third argument. Here the user can only see active projects which he owns. + # + # can :read, Project, :active => true, :user_id => user.id + # + # See ActiveRecordAdditions#accessible_by for how to use this in database queries. These conditions + # are also used for initial attributes when building a record in ControllerAdditions#load_resource. + # + # If the conditions hash does not give you enough control over defining abilities, you can use a block + # along with any Ruby code you want. + # + # can :update, Project do |project| + # project.groups.include?(user.group) + # end + # + # If the block returns true then the user has that :update ability for that project, otherwise he + # will be denied access. The downside to using a block is that it cannot be used to generate + # conditions for database queries. + # + # You can pass custom objects into this "can" method, this is usually done with a symbol + # and is useful if a class isn't available to define permissions on. + # + # can :read, :stats + # can? :read, :stats # => true + # + # IMPORTANT: Neither a hash of conditions nor a block will be used when checking permission on a class. + # + # can :update, Project, :priority => 3 + # can? :update, Project # => true + # + # If you pass no arguments to +can+, the action, class, and object will be passed to the block and the + # block will always be executed. This allows you to override the full behavior if the permissions are + # defined in an external source such as the database. + # + # can do |action, object_class, object| + # # check the database and return true/false + # end + # + # pkg:gem/cancancan#lib/cancan/ability.rb:144 + def can(action = T.unsafe(nil), subject = T.unsafe(nil), *attributes_and_conditions, &block); end + + # Check if the user has permission to perform a given action on an object. + # + # can? :destroy, @project + # + # You can also pass the class instead of an instance (if you don't have one handy). + # + # can? :create, Project + # + # Nested resources can be passed through a hash, this way conditions which are + # dependent upon the association will work when using a class. + # + # can? :create, @category => Project + # + # You can also pass multiple objects to check. You only need to pass a hash + # following the pattern { :any => [many subjects] }. The behaviour is check if + # there is a permission on any of the given objects. + # + # can? :create, {:any => [Project, Rule]} + # + # + # Any additional arguments will be passed into the "can" block definition. This + # can be used to pass more information about the user's request for example. + # + # can? :create, Project, request.remote_ip + # + # can :create, Project do |project, remote_ip| + # # ... + # end + # + # Not only can you use the can? method in the controller and view (see ControllerAdditions), + # but you can also call it directly on an ability instance. + # + # ability.can? :destroy, @project + # + # This makes testing a user's abilities very easy. + # + # def test "user can only destroy projects which he owns" + # user = User.new + # ability = Ability.new(user) + # assert ability.can?(:destroy, Project.new(:user => user)) + # assert ability.cannot?(:destroy, Project.new) + # end + # + # Also see the RSpec Matchers to aid in testing. + # + # pkg:gem/cancancan#lib/cancan/ability.rb:74 + def can?(action, subject, attribute = T.unsafe(nil), *extra_args); end + + # Defines an ability which cannot be done. Accepts the same arguments as "can". + # + # can :read, :all + # cannot :read, Comment + # + # A block can be passed just like "can", however if the logic is complex it is recommended + # to use the "can" method. + # + # cannot :read, Product do |product| + # product.invisible? + # end + # + # pkg:gem/cancancan#lib/cancan/ability.rb:160 + def cannot(action = T.unsafe(nil), subject = T.unsafe(nil), *attributes_and_conditions, &block); end + + # Convenience method which works the same as "can?" but returns the opposite value. + # + # cannot? :destroy, @project + # + # pkg:gem/cancancan#lib/cancan/ability.rb:87 + def cannot?(*args); end + + # pkg:gem/cancancan#lib/cancan/ability.rb:275 + def extract_rule_in_permissions(permissions_list, rule); end + + # pkg:gem/cancancan#lib/cancan/ability.rb:193 + def has_block?(action, subject); end + + # pkg:gem/cancancan#lib/cancan/ability.rb:197 + def has_raw_sql?(action, subject); end + + # Copies all rules and aliased actions of the given +CanCan::Ability+ and adds them to +self+. + # class ReadAbility + # include CanCan::Ability + # + # def initialize + # can :read, User + # alias_action :show, :index, to: :see + # end + # end + # + # class WritingAbility + # include CanCan::Ability + # + # def initialize + # can :edit, User + # alias_action :create, :update, to: :modify + # end + # end + # + # read_ability = ReadAbility.new + # read_ability.can? :edit, User.new #=> false + # read_ability.merge(WritingAbility.new) + # read_ability.can? :edit, User.new #=> true + # read_ability.aliased_actions #=> [:see => [:show, :index], :modify => [:create, :update]] + # + # If there are collisions when merging the +aliased_actions+, the actions on +self+ will be + # overwritten. + # + # class ReadAbility + # include CanCan::Ability + # + # def initialize + # alias_action :show, :index, to: :see + # end + # end + # + # class ShowAbility + # include CanCan::Ability + # + # def initialize + # alias_action :show, to: :see + # end + # end + # + # read_ability = ReadAbility.new + # read_ability.merge(ShowAbility) + # read_ability.aliased_actions #=> [:see => [:show]] + # + # pkg:gem/cancancan#lib/cancan/ability.rb:248 + def merge(ability); end + + # pkg:gem/cancancan#lib/cancan/ability.rb:170 + def model_adapter(model_class, action); end + + # Return a hash of permissions for the user in the format of: + # { + # can: can_hash, + # cannot: cannot_hash + # } + # + # Where can_hash and cannot_hash are formatted thusly: + # { + # action: { subject: [attributes] } + # } + # + # pkg:gem/cancancan#lib/cancan/ability.rb:266 + def permissions; end + + # User shouldn't specify targets with names of real actions or it will cause Seg fault + # + # pkg:gem/cancancan#lib/cancan/ability.rb:165 + def validate_target(target); end + + private + + # pkg:gem/cancancan#lib/cancan/ability.rb:303 + def alternative_subjects(subject); end + + # It translates to an array the subject or the hash with multiple subjects given to can?. + # + # pkg:gem/cancancan#lib/cancan/ability.rb:295 + def extract_subjects(subject); end + + # pkg:gem/cancancan#lib/cancan/ability.rb:286 + def unauthorized_message_keys(action, subject); end +end + +# pkg:gem/cancancan#lib/cancan/ability/actions.rb:5 +module CanCan::Ability::Actions + # Alias one or more actions into another one. + # + # alias_action :update, :destroy, :to => :modify + # can :modify, Comment + # + # Then :modify permission will apply to both :update and :destroy requests. + # + # can? :update, Comment # => true + # can? :destroy, Comment # => true + # + # This only works in one direction. Passing the aliased action into the "can?" call + # will not work because aliases are meant to generate more generic actions. + # + # alias_action :update, :destroy, :to => :modify + # can :update, Comment + # can? :modify, Comment # => false + # + # Unless that exact alias is used. + # + # can :modify, Comment + # can? :modify, Comment # => true + # + # The following aliases are added by default for conveniently mapping common controller actions. + # + # alias_action :index, :show, :to => :read + # alias_action :new, :to => :create + # alias_action :edit, :to => :update + # + # This way one can use params[:action] in the controller to determine the permission. + # + # pkg:gem/cancancan#lib/cancan/ability/actions.rb:35 + def alias_action(*args); end + + # Returns a hash of aliased actions. The key is the target and the value is an array of actions aliasing the key. + # + # pkg:gem/cancancan#lib/cancan/ability/actions.rb:43 + def aliased_actions; end + + # Removes previously aliased actions including the defaults. + # + # pkg:gem/cancancan#lib/cancan/ability/actions.rb:48 + def clear_aliased_actions; end + + private + + # Given an action, it will try to find all of the actions which are aliased to it. + # This does the opposite kind of lookup as expand_actions. + # + # pkg:gem/cancancan#lib/cancan/ability/actions.rb:64 + def aliases_for_action(action); end + + # pkg:gem/cancancan#lib/cancan/ability/actions.rb:54 + def default_alias_actions; end + + # Accepts an array of actions and returns an array of actions which match. + # This should be called before "matches?" and other checking methods since they + # rely on the actions to be expanded. + # + # pkg:gem/cancancan#lib/cancan/ability/actions.rb:79 + def expand_actions(actions); end + + # pkg:gem/cancancan#lib/cancan/ability/actions.rb:72 + def expanded_actions; end +end + +# pkg:gem/cancancan#lib/cancan/ability/rules.rb:5 +module CanCan::Ability::Rules + protected + + # Must be protected as an ability can merge with other abilities. + # This means that an ability must expose their rules with another ability. + # + # pkg:gem/cancancan#lib/cancan/ability/rules.rb:10 + def rules; end + + private + + # pkg:gem/cancancan#lib/cancan/ability/rules.rb:16 + def add_rule(rule); end + + # pkg:gem/cancancan#lib/cancan/ability/rules.rb:21 + def add_rule_to_index(rule, position); end + + # Optimizes the order of the rules, so that rules with the :all subject are evaluated first. + # + # pkg:gem/cancancan#lib/cancan/ability/rules.rb:82 + def optimize_order!(rules); end + + # pkg:gem/cancancan#lib/cancan/ability/rules.rb:47 + def possible_relevant_rules(subject); end + + # Returns an array of Rule instances which match the action and subject + # This does not take into consideration any hash conditions or block statements + # + # pkg:gem/cancancan#lib/cancan/ability/rules.rb:35 + def relevant_rules(action, subject); end + + # pkg:gem/cancancan#lib/cancan/ability/rules.rb:59 + def relevant_rules_for_match(action, subject); end + + # pkg:gem/cancancan#lib/cancan/ability/rules.rb:69 + def relevant_rules_for_query(action, subject); end +end + +# pkg:gem/cancancan#lib/cancan/ability/strong_parameter_support.rb:5 +module CanCan::Ability::StrongParameterSupport + # Returns an array of attributes suitable for use with strong parameters + # + # Note: reversing the relevant rules is important. Normal order means that 'cannot' + # rules will come before 'can' rules. However, you can't remove attributes before + # they are added. The 'reverse' is so that attributes will be added before the + # 'cannot' rules remove them. + # + # pkg:gem/cancancan#lib/cancan/ability/strong_parameter_support.rb:12 + def permitted_attributes(action, subject); end + + private + + # pkg:gem/cancancan#lib/cancan/ability/strong_parameter_support.rb:30 + def get_attributes(rule, subject); end + + # pkg:gem/cancancan#lib/cancan/ability/strong_parameter_support.rb:25 + def subject_class?(subject); end +end + +# This error is raised when a user isn't allowed to access a given controller action. +# This usually happens within a call to ControllerAdditions#authorize! but can be +# raised manually. +# +# raise CanCan::AccessDenied.new("Not authorized!", :read, Article) +# +# The passed message, action, and subject are optional and can later be retrieved when +# rescuing from the exception. +# +# exception.message # => "Not authorized!" +# exception.action # => :read +# exception.subject # => Article +# +# If the message is not specified (or is nil) it will default to "You are not authorized +# to access this page." This default can be overridden by setting default_message. +# +# exception.default_message = "Default error message" +# exception.message # => "Default error message" +# +# See ControllerAdditions#authorize! for more information on rescuing from this exception +# and customizing the message using I18n. +# +# pkg:gem/cancancan#lib/cancan/exceptions.rb:46 +class CanCan::AccessDenied < ::CanCan::Error + # pkg:gem/cancancan#lib/cancan/exceptions.rb:50 + def initialize(message = T.unsafe(nil), action = T.unsafe(nil), subject = T.unsafe(nil), conditions = T.unsafe(nil)); end + + # pkg:gem/cancancan#lib/cancan/exceptions.rb:47 + def action; end + + # pkg:gem/cancancan#lib/cancan/exceptions.rb:47 + def conditions; end + + # pkg:gem/cancancan#lib/cancan/exceptions.rb:48 + def default_message=(_arg0); end + + # pkg:gem/cancancan#lib/cancan/exceptions.rb:62 + def inspect; end + + # pkg:gem/cancancan#lib/cancan/exceptions.rb:47 + def subject; end + + # pkg:gem/cancancan#lib/cancan/exceptions.rb:58 + def to_s; end +end + +# Raised when an unexpected argument is passed as an attribute +# +# pkg:gem/cancancan#lib/cancan/exceptions.rb:20 +class CanCan::AttributeArgumentError < ::CanCan::Error; end + +# Raised when using check_authorization without calling authorize! +# +# pkg:gem/cancancan#lib/cancan/exceptions.rb:14 +class CanCan::AuthorizationNotPerformed < ::CanCan::Error; end + +# Raised when a rule is created with both a block and a hash of conditions +# +# pkg:gem/cancancan#lib/cancan/exceptions.rb:17 +class CanCan::BlockAndConditionsError < ::CanCan::Error; end + +# pkg:gem/cancancan#lib/cancan/conditions_matcher.rb:4 +module CanCan::ConditionsMatcher + # Matches the block or conditions hash + # + # pkg:gem/cancancan#lib/cancan/conditions_matcher.rb:6 + def matches_conditions?(action, subject, attribute = T.unsafe(nil), *extra_args); end + + private + + # pkg:gem/cancancan#lib/cancan/conditions_matcher.rb:111 + def array_like_matches_condition_hash?(attribute, value); end + + # pkg:gem/cancancan#lib/cancan/conditions_matcher.rb:128 + def call_block_with_all(action, subject, *extra_args); end + + # pkg:gem/cancancan#lib/cancan/conditions_matcher.rb:90 + def condition_match?(attribute, value); end + + # pkg:gem/cancancan#lib/cancan/conditions_matcher.rb:140 + def conditions_empty?; end + + # pkg:gem/cancancan#lib/cancan/conditions_matcher.rb:103 + def hash_condition_match?(attribute, value); end + + # pkg:gem/cancancan#lib/cancan/conditions_matcher.rb:70 + def matches_all_conditions?(adapter, subject, conditions); end + + # pkg:gem/cancancan#lib/cancan/conditions_matcher.rb:21 + def matches_block_conditions(subject, attribute, *extra_args); end + + # Checks if the given subject matches the given conditions hash. + # This behavior can be overridden by a model adapter by defining two class methods: + # override_matching_for_conditions?(subject, conditions) and + # matches_conditions_hash?(subject, conditions) + # + # pkg:gem/cancancan#lib/cancan/conditions_matcher.rb:58 + def matches_conditions_hash?(subject, conditions = T.unsafe(nil)); end + + # pkg:gem/cancancan#lib/cancan/conditions_matcher.rb:80 + def matches_hash_conditions?(adapter, subject, conditions); end + + # pkg:gem/cancancan#lib/cancan/conditions_matcher.rb:31 + def matches_non_block_conditions(subject); end + + # pkg:gem/cancancan#lib/cancan/conditions_matcher.rb:136 + def model_adapter(subject); end + + # pkg:gem/cancancan#lib/cancan/conditions_matcher.rb:39 + def nested_subject_matches_conditions?(subject_hash); end + + # pkg:gem/cancancan#lib/cancan/conditions_matcher.rb:16 + def subject_class?(subject); end +end + +# This module is automatically included into all controllers. +# It also makes the "can?" and "cannot?" methods available to all views. +# +# pkg:gem/cancancan#lib/cancan/controller_additions.rb:6 +module CanCan::ControllerAdditions + include GeneratedInstanceMethods + + mixes_in_class_methods GeneratedClassMethods + mixes_in_class_methods ::CanCan::ControllerAdditions::ClassMethods + + # Raises a CanCan::AccessDenied exception if the current_ability cannot + # perform the given action. This is usually called in a controller action or + # before filter to perform the authorization. + # + # def show + # @article = Article.find(params[:id]) + # authorize! :read, @article + # end + # + # A :message option can be passed to specify a different message. + # + # authorize! :read, @article, :message => "Not authorized to read #{@article.name}" + # + # You can also use I18n to customize the message. Action aliases defined in Ability work here. + # + # en: + # unauthorized: + # manage: + # all: "Not authorized to %{action} %{subject}." + # user: "Not allowed to manage other user accounts." + # update: + # project: "Not allowed to update this project." + # + # You can rescue from the exception in the controller to customize how unauthorized + # access is displayed to the user. + # + # class ApplicationController < ActionController::Base + # rescue_from CanCan::AccessDenied do |exception| + # redirect_to root_url, :alert => exception.message + # end + # end + # + # See the CanCan::AccessDenied exception for more details on working with the exception. + # + # See the load_and_authorize_resource method to automatically add the authorize! behavior + # to the default RESTful actions. + # + # pkg:gem/cancancan#lib/cancan/controller_additions.rb:342 + def authorize!(*args); end + + # Use in the controller or view to check the user's permission for a given action + # and object. + # + # can? :destroy, @project + # + # You can also pass the class instead of an instance (if you don't have one handy). + # + # <% if can? :create, Project %> + # <%= link_to "New Project", new_project_path %> + # <% end %> + # + # If it's a nested resource, you can pass the parent instance in a hash. This way it will + # check conditions which reach through that association. + # + # <% if can? :create, @category => Project %> + # <%= link_to "New Project", new_project_path %> + # <% end %> + # + # This simply calls "can?" on the current_ability. See Ability#can?. + # + # pkg:gem/cancancan#lib/cancan/controller_additions.rb:381 + def can?(*args); end + + # Convenience method which works the same as "can?" but returns the opposite value. + # + # cannot? :destroy, @project + # + # pkg:gem/cancancan#lib/cancan/controller_additions.rb:389 + def cannot?(*args); end + + # Creates and returns the current user's ability and caches it. If you + # want to override how the Ability is defined then this is the place. + # Just define the method in the controller to change behavior. + # + # def current_ability + # # instead of Ability.new(current_user) + # @current_ability ||= UserAbility.new(current_account) + # end + # + # Notice it is important to cache the ability object so it is not + # recreated every time. + # + # pkg:gem/cancancan#lib/cancan/controller_additions.rb:358 + def current_ability; end + + class << self + # pkg:gem/cancancan#lib/cancan/controller_additions.rb:300 + def included(base); end + end + + module GeneratedClassMethods + def _cancan_skipper; end + def _cancan_skipper=(value); end + def _cancan_skipper?; end + end + + module GeneratedInstanceMethods + def _cancan_skipper; end + def _cancan_skipper=(value); end + def _cancan_skipper?; end + end +end + +# pkg:gem/cancancan#lib/cancan/controller_additions.rb:7 +module CanCan::ControllerAdditions::ClassMethods + # Sets up a before filter which authorizes the resource using the instance variable. + # For example, if you have an ArticlesController it will check the @article instance variable + # and ensure the user can perform the current action on it. Under the hood it is doing + # something like the following. + # + # authorize!(params[:action].to_sym, @article || Article) + # + # Call this method directly on the controller class. + # + # class BooksController < ApplicationController + # authorize_resource + # end + # + # If you pass in the name of a resource which does not match the controller it will assume + # it is a parent resource. + # + # class BooksController < ApplicationController + # authorize_resource :author + # authorize_resource :book + # end + # + # Here it will authorize :+show+, @+author+ on every action before authorizing the book. + # + # That first argument is optional and will default to the singular name of the controller. + # A hash of options (see below) can also be passed to this method to further customize it. + # + # See load_and_authorize_resource to automatically load the resource too. + # + # Options: + # [:+only+] + # Only applies before filter to given actions. + # + # [:+except+] + # Does not apply before filter to given actions. + # + # [:+singleton+] + # Pass +true+ if this is a singleton resource through a +has_one+ association. + # + # [:+parent+] + # True or false depending on if the resource is considered a parent resource. + # This defaults to +true+ if a resource name is given which does not match the controller. + # + # [:+class+] + # The class to use for the model (string or constant). This passed in when the instance variable is not set. + # Pass +false+ if there is no associated class for this resource and it will use a symbol of the resource name. + # + # [:+instance_name+] + # The name of the instance variable for this resource. + # + # [:+id_param+] + # Find using a param key other than :id. For example: + # + # load_resource :id_param => :url # will use find(params[:url]) + # + # [:+through+] + # Authorize conditions on this parent resource when instance isn't available. + # + # [:+prepend+] + # Passing +true+ will use prepend_before_action instead of a normal before_action. + # + # pkg:gem/cancancan#lib/cancan/controller_additions.rb:185 + def authorize_resource(*args); end + + # pkg:gem/cancancan#lib/cancan/controller_additions.rb:291 + def cancan_resource_class; end + + # pkg:gem/cancancan#lib/cancan/controller_additions.rb:295 + def cancan_skipper; end + + # Add this to a controller to ensure it performs authorization through +authorize+! or +authorize_resource+ call. + # If neither of these authorization methods are called, + # a CanCan::AuthorizationNotPerformed exception will be raised. + # This is normally added to the ApplicationController to ensure all controller actions do authorization. + # + # class ApplicationController < ActionController::Base + # check_authorization + # end + # + # See skip_authorization_check to bypass this check on specific controller actions. + # + # Options: + # [:+only+] + # Only applies to given actions. + # + # [:+except+] + # Does not apply to given actions. + # + # [:+if+] + # Supply the name of a controller method to be called. + # The authorization check only takes place if this returns true. + # + # check_authorization :if => :admin_controller? + # + # [:+unless+] + # Supply the name of a controller method to be called. + # The authorization check only takes place if this returns false. + # + # check_authorization :unless => :devise_controller? + # + # pkg:gem/cancancan#lib/cancan/controller_additions.rb:265 + def check_authorization(options = T.unsafe(nil)); end + + # Sets up a before filter which loads and authorizes the current resource. This performs both + # load_resource and authorize_resource and accepts the same arguments. See those methods for details. + # + # class BooksController < ApplicationController + # load_and_authorize_resource + # end + # + # pkg:gem/cancancan#lib/cancan/controller_additions.rb:15 + def load_and_authorize_resource(*args); end + + # Sets up a before filter which loads the model resource into an instance variable. + # For example, given an ArticlesController it will load the current article into the @article + # instance variable. It does this by either calling Article.find(params[:id]) or + # Article.new(params[:article]) depending upon the action. The index action will + # automatically set @articles to Article.accessible_by(current_ability). + # + # If a conditions hash is used in the Ability, the +new+ and +create+ actions will set + # the initial attributes based on these conditions. This way these actions will satisfy + # the ability restrictions. + # + # Call this method directly on the controller class. + # + # class BooksController < ApplicationController + # load_resource + # end + # + # A resource is not loaded if the instance variable is already set. This makes it easy to override + # the behavior through a before_action on certain actions. + # + # class BooksController < ApplicationController + # before_action :find_book_by_permalink, :only => :show + # load_resource + # + # private + # + # def find_book_by_permalink + # @book = Book.find_by_permalink!(params[:id]) + # end + # end + # + # If a name is provided which does not match the controller it assumes it is a parent resource. Child + # resources can then be loaded through it. + # + # class BooksController < ApplicationController + # load_resource :author + # load_resource :book, :through => :author + # end + # + # Here the author resource will be loaded before each action using params[:author_id]. The book resource + # will then be loaded through the @author instance variable. + # + # That first argument is optional and will default to the singular name of the controller. + # A hash of options (see below) can also be passed to this method to further customize it. + # + # See load_and_authorize_resource to automatically authorize the resource too. + # + # Options: + # [:+only+] + # Only applies before filter to given actions. + # + # [:+except+] + # Does not apply before filter to given actions. + # + # [:+through+] + # Load this resource through another one. This should match the name of the parent instance variable or method. + # + # [:+through_association+] + # The name of the association to fetch the child records through the parent resource. + # This is normally not needed because it defaults to the pluralized resource name. + # + # [:+shallow+] + # Pass +true+ to allow this resource to be loaded directly when parent is +nil+. Defaults to +false+. + # + # [:+singleton+] + # Pass +true+ if this is a singleton resource through a +has_one+ association. + # + # [:+parent+] + # True or false depending on if the resource is considered a parent resource. + # This defaults to +true+ if a resource name is given which does not match the controller. + # + # [:+class+] + # The class to use for the model (string or constant). + # + # [:+instance_name+] + # The name of the instance variable to load the resource into. + # + # [:+find_by+] + # Find using a different attribute other than id. For example. + # + # load_resource :find_by => :permalink # will use find_by_permalink!(params[:id]) + # + # [:+id_param+] + # Find using a param key other than :id. For example: + # + # load_resource :id_param => :url # will use find(params[:url]) + # + # [:+collection+] + # Specify which actions are resource collection actions in addition to :+index+. This + # is usually not necessary because it will try to guess depending on if the id param is present. + # + # load_resource :collection => [:sort, :list] + # + # [:+new+] + # Specify which actions are new resource actions in addition to :+new+ and :+create+. + # Pass an action name into here if you would like to build a new resource instead of + # fetch one. + # + # load_resource :new => :build + # + # [:+prepend+] + # Passing +true+ will use prepend_before_action instead of a normal before_action. + # + # pkg:gem/cancancan#lib/cancan/controller_additions.rb:121 + def load_resource(*args); end + + # Call this in the class of a controller to skip the check_authorization behavior on the actions. + # + # class HomeController < ApplicationController + # skip_authorization_check :only => :index + # end + # + # Any arguments are passed to the +before_action+ it triggers. + # + # pkg:gem/cancancan#lib/cancan/controller_additions.rb:286 + def skip_authorization_check(*args); end + + # Skip the authorization behavior of CanCan. This is useful when using +load_and_authorize_resource+ but want to + # only do loading on certain actions. You can pass :only and :except options to specify which actions to + # skip the effects on. It will apply to all actions by default. + # + # class ProjectsController < ApplicationController + # load_and_authorize_resource + # skip_authorize_resource :only => :index + # end + # + # You can also pass the resource name as the first argument to skip that resource. + # + # pkg:gem/cancancan#lib/cancan/controller_additions.rb:229 + def skip_authorize_resource(*args); end + + # Skip both the loading and authorization behavior of CanCan for this given controller. This is primarily + # useful to skip the behavior of a superclass. You can pass :only and :except options to specify which actions + # to skip the effects on. It will apply to all actions by default. + # + # class ProjectsController < SomeOtherController + # skip_load_and_authorize_resource :only => :index + # end + # + # You can also pass the resource name as the first argument to skip that resource. + # + # pkg:gem/cancancan#lib/cancan/controller_additions.rb:198 + def skip_load_and_authorize_resource(*args); end + + # Skip the loading behavior of CanCan. This is useful when using +load_and_authorize_resource+ but want to + # only do authorization on certain actions. You can pass :only and :except options to specify which actions to + # skip the effects on. It will apply to all actions by default. + # + # class ProjectsController < ApplicationController + # load_and_authorize_resource + # skip_load_resource :only => :index + # end + # + # You can also pass the resource name as the first argument to skip that resource. + # + # pkg:gem/cancancan#lib/cancan/controller_additions.rb:213 + def skip_load_resource(*args); end +end + +# Handle the load and authorization controller logic +# so we don't clutter up all controllers with non-interface methods. +# This class is used internally, so you do not need to call methods directly on it. +# +# pkg:gem/cancancan#lib/cancan/controller_resource.rb:8 +class CanCan::ControllerResource + include ::CanCan::ControllerResourceNameFinder + include ::CanCan::ControllerResourceFinder + include ::CanCan::ControllerResourceBuilder + include ::CanCan::ControllerResourceSanitizer + include ::CanCan::ControllerResourceLoader + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:25 + def initialize(controller, *args); end + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:37 + def authorize_resource; end + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:32 + def load_and_authorize_resource; end + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:43 + def parent?; end + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:47 + def skip?(behavior); end + + protected + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:119 + def collection_actions; end + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:105 + def collection_instance; end + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:101 + def collection_instance=(instance); end + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:115 + def instance_name; end + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:77 + def load_collection?; end + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:73 + def load_instance?; end + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:81 + def member_action?; end + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:111 + def parameters_require_sanitizing?; end + + # Returns the class used for this resource. This can be overridden by the :class option. + # If +false+ is passed in it will use the resource name as a symbol in which case it should + # only be used for authorization, not loading since there's no class to load through. + # + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:60 + def resource_class; end + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:87 + def resource_class_with_parent; end + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:95 + def resource_instance; end + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:91 + def resource_instance=(instance); end + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:123 + def save_actions; end + + private + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:129 + def action_exists_in?(options); end + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:133 + def adapter; end + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:137 + def current_ability; end + + class << self + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:11 + def add_before_action(controller_class, method, *args); end + + # pkg:gem/cancancan#lib/cancan/controller_resource.rb:21 + def before_callback_name(options); end + end +end + +# pkg:gem/cancancan#lib/cancan/controller_resource_builder.rb:4 +module CanCan::ControllerResourceBuilder + protected + + # pkg:gem/cancancan#lib/cancan/controller_resource_builder.rb:12 + def assign_attributes(resource); end + + # pkg:gem/cancancan#lib/cancan/controller_resource_builder.rb:7 + def build_resource; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_builder.rb:20 + def initial_attributes; end +end + +# pkg:gem/cancancan#lib/cancan/controller_resource_finder.rb:4 +module CanCan::ControllerResourceFinder + protected + + # pkg:gem/cancancan#lib/cancan/controller_resource_finder.rb:21 + def find_by_dynamic_finder; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_finder.rb:26 + def find_by_find_by_finder; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_finder.rb:7 + def find_resource; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_finder.rb:17 + def find_resource_using_find_by; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_finder.rb:30 + def id_param; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_finder.rb:34 + def id_param_key; end +end + +# pkg:gem/cancancan#lib/cancan/controller_resource_loader.rb:8 +module CanCan::ControllerResourceLoader + include ::CanCan::ControllerResourceNameFinder + include ::CanCan::ControllerResourceFinder + include ::CanCan::ControllerResourceBuilder + include ::CanCan::ControllerResourceSanitizer + + # pkg:gem/cancancan#lib/cancan/controller_resource_loader.rb:14 + def load_resource; end + + protected + + # pkg:gem/cancancan#lib/cancan/controller_resource_loader.rb:98 + def authorization_action; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_loader.rb:50 + def fetch_parent(name); end + + # pkg:gem/cancancan#lib/cancan/controller_resource_loader.rb:102 + def load_collection; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_loader.rb:106 + def load_resource_instance; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_loader.rb:26 + def new_actions; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_loader.rb:94 + def parent_authorization_action; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_loader.rb:63 + def parent_name; end + + # The object to load this resource through. + # + # pkg:gem/cancancan#lib/cancan/controller_resource_loader.rb:59 + def parent_resource; end + + # The object that methods (such as "find", "new" or "build") are called on. + # If the :through option is passed it will go through an association on that instance. + # If the :shallow option is passed it will use the resource_class if there's no parent + # If the :singleton option is passed it won't use the association because it needs to be handled later. + # + # pkg:gem/cancancan#lib/cancan/controller_resource_loader.rb:90 + def resource_base; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_loader.rb:75 + def resource_base_through; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_loader.rb:67 + def resource_base_through_parent_resource; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_loader.rb:42 + def resource_params; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_loader.rb:30 + def resource_params_by_key(key); end + + # pkg:gem/cancancan#lib/cancan/controller_resource_loader.rb:36 + def resource_params_by_namespaced_name; end + + private + + # pkg:gem/cancancan#lib/cancan/controller_resource_loader.rb:116 + def extract_key(value); end +end + +# pkg:gem/cancancan#lib/cancan/controller_resource_name_finder.rb:4 +module CanCan::ControllerResourceNameFinder + protected + + # pkg:gem/cancancan#lib/cancan/controller_resource_name_finder.rb:15 + def name; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_name_finder.rb:7 + def name_from_controller; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_name_finder.rb:19 + def namespace; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_name_finder.rb:11 + def namespaced_name; end +end + +# pkg:gem/cancancan#lib/cancan/controller_resource_sanitizer.rb:4 +module CanCan::ControllerResourceSanitizer + protected + + # pkg:gem/cancancan#lib/cancan/controller_resource_sanitizer.rb:24 + def params_method; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_sanitizer.rb:18 + def params_methods; end + + # pkg:gem/cancancan#lib/cancan/controller_resource_sanitizer.rb:7 + def sanitize_parameters; end +end + +# A general CanCan exception +# +# pkg:gem/cancancan#lib/cancan/exceptions.rb:5 +class CanCan::Error < ::StandardError; end + +# Raised when removed code is called, an alternative solution is provided in message. +# +# pkg:gem/cancancan#lib/cancan/exceptions.rb:11 +class CanCan::ImplementationRemoved < ::CanCan::Error; end + +# pkg:gem/cancancan#lib/cancan/model_adapters/abstract_adapter.rb:4 +module CanCan::ModelAdapters; end + +# pkg:gem/cancancan#lib/cancan/model_adapters/abstract_adapter.rb:5 +class CanCan::ModelAdapters::AbstractAdapter + # pkg:gem/cancancan#lib/cancan/model_adapters/abstract_adapter.rb:66 + def initialize(model_class, rules); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/abstract_adapter.rb:71 + def database_records; end + + # pkg:gem/cancancan#lib/cancan/model_adapters/abstract_adapter.rb:6 + def model_class; end + + class << self + # pkg:gem/cancancan#lib/cancan/model_adapters/abstract_adapter.rb:13 + def adapter_class(model_class); end + + # Override if you need custom find behavior + # + # pkg:gem/cancancan#lib/cancan/model_adapters/abstract_adapter.rb:23 + def find(model_class, id); end + + # Used to determine if the given adapter should be used for the passed in class. + # + # pkg:gem/cancancan#lib/cancan/model_adapters/abstract_adapter.rb:18 + def for_class?(_member_class); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/abstract_adapter.rb:8 + def inherited(subclass); end + + # Override if override_condition_matching? returns true + # + # pkg:gem/cancancan#lib/cancan/model_adapters/abstract_adapter.rb:62 + def matches_condition?(_subject, _name, _value); end + + # Override if override_conditions_hash_matching? returns true + # + # pkg:gem/cancancan#lib/cancan/model_adapters/abstract_adapter.rb:34 + def matches_conditions_hash?(_subject, _conditions); end + + # Override if override_nested_subject_conditions_matching? returns true + # + # pkg:gem/cancancan#lib/cancan/model_adapters/abstract_adapter.rb:51 + def nested_subject_matches_conditions?(_parent, _child, _all_conditions); end + + # Used to determine if this model adapter will override the matching behavior for a specific condition. + # If this returns true then matches_condition? will be called. See Rule#matches_conditions_hash + # + # pkg:gem/cancancan#lib/cancan/model_adapters/abstract_adapter.rb:57 + def override_condition_matching?(_subject, _name, _value); end + + # Used to determine if this model adapter will override the matching behavior for a hash of conditions. + # If this returns true then matches_conditions_hash? will be called. See Rule#matches_conditions_hash + # + # pkg:gem/cancancan#lib/cancan/model_adapters/abstract_adapter.rb:29 + def override_conditions_hash_matching?(_subject, _conditions); end + + # Used above override_conditions_hash_matching to determine if this model adapter will override the + # matching behavior for nested subject. + # If this returns true then nested_subject_matches_conditions? will be called. + # + # pkg:gem/cancancan#lib/cancan/model_adapters/abstract_adapter.rb:46 + def override_nested_subject_conditions_matching?(_parent, _child, _all_conditions); end + + # Override if parent condition could be under a different key in conditions + # + # pkg:gem/cancancan#lib/cancan/model_adapters/abstract_adapter.rb:39 + def parent_condition_name(parent, _child); end + end +end + +# pkg:gem/cancancan#lib/cancan/model_adapters/active_record_4_adapter.rb:5 +class CanCan::ModelAdapters::ActiveRecord4Adapter < ::CanCan::ModelAdapters::ActiveRecordAdapter + private + + # As of rails 4, `includes()` no longer causes active record to + # look inside the where clause to decide to outer join tables + # you're using in the where. Instead, `references()` is required + # in addition to `includes()` to force the outer join. + # + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_4_adapter.rb:37 + def build_joins_relation(relation, *_where_conditions); end + + # Rails 4.2 deprecates `sanitize_sql_hash_for_conditions` + # + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_4_adapter.rb:42 + def sanitize_sql(conditions); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_4_adapter.rb:50 + def sanitize_sql_activerecord4(conditions); end + + class << self + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_4_adapter.rb:9 + def for_class?(model_class); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_4_adapter.rb:17 + def matches_condition?(subject, name, value); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_4_adapter.rb:13 + def override_condition_matching?(subject, name, _value); end + end +end + +# pkg:gem/cancancan#lib/cancan/model_adapters/active_record_5_adapter.rb:5 +class CanCan::ModelAdapters::ActiveRecord5Adapter < ::CanCan::ModelAdapters::ActiveRecord4Adapter + private + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_5_adapter.rb:24 + def build_joins_relation(relation, *where_conditions); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_5_adapter.rb:33 + def sanitize_sql(conditions); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_5_adapter.rb:41 + def sanitize_sql_activerecord5(conditions); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_5_adapter.rb:28 + def strategy_class; end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_5_adapter.rb:49 + def visit_nodes(node); end + + class << self + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_5_adapter.rb:8 + def for_class?(model_class); end + + # rails 5 is capable of using strings in enum + # but often people use symbols in rules + # + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_5_adapter.rb:14 + def matches_condition?(subject, name, value); end + end +end + +# pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:8 +class CanCan::ModelAdapters::ActiveRecordAdapter < ::CanCan::ModelAdapters::AbstractAdapter + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:19 + def initialize(model_class, rules); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:138 + def build_relation(*where_conditions); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:17 + def compressed_rules; end + + # Returns conditions intended to be used inside a database query. Normally you will not call this + # method directly, but instead go through ModelAdditions#accessible_by. + # + # If there is only one "can" definition, a hash of conditions will be returned matching the one defined. + # + # can :manage, User, :id => 1 + # query(:manage, User).conditions # => { :id => 1 } + # + # If there are multiple "can" definitions, a SQL string will be returned to handle complex cases. + # + # can :manage, User, :id => 1 + # can :manage, User, :manager_id => 1 + # cannot :manage, User, :self_managed => true + # query(:manage, User).conditions # => "not (self_managed = 't') AND ((manager_id = 1) OR (id = 1))" + # + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:112 + def conditions; end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:128 + def database_records; end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:122 + def extract_multiple_conditions(conditions_extractor, rules); end + + # Returns the associations used in conditions for the :joins option of a search. + # See ModelAdditions#accessible_by + # + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:148 + def joins; end + + private + + # Removes empty hashes and moves everything into arrays. + # + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:159 + def deep_clean(joins_hash); end + + # Takes two hashes and does a deep merge. + # + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:164 + def deep_merge(base_hash, added_hash); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:209 + def false_sql; end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:189 + def merge_conditions(sql, conditions_hash, behavior); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:197 + def merge_non_empty_conditions(behavior, conditions_hash, sql); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:174 + def override_scope; end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:182 + def raise_override_scope_error; end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:217 + def sanitize_sql(conditions); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:213 + def true_sql; end + + class << self + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:74 + def child_association_to_parent(parent, child); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:64 + def matching_parent_child_polymorphic_association(parent_assoc, child_class); end + + # parent_id condition can be an array of integer or one integer, we check the parent against this + # + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:38 + def nested_subject_matches_conditions?(parent, child, all_conditions); end + + # When belongs_to parent_id is a condition for a model, + # we want to check the parent when testing ability for a hash {parent => model} + # + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:33 + def override_nested_subject_conditions_matching?(parent, child, all_conditions); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:46 + def parent_child_conditions(parent, child, all_conditions); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:92 + def parent_condition_name(parent, child); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:9 + def version_greater_or_equal?(version); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/active_record_adapter.rb:13 + def version_lower?(version); end + end +end + +# pkg:gem/cancancan#lib/cancan/model_adapters/conditions_extractor.rb:9 +class CanCan::ModelAdapters::ConditionsExtractor + # pkg:gem/cancancan#lib/cancan/model_adapters/conditions_extractor.rb:10 + def initialize(model_class); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/conditions_extractor.rb:15 + def tableize_conditions(conditions, model_class = T.unsafe(nil), path_to_key = T.unsafe(nil)); end + + private + + # pkg:gem/cancancan#lib/cancan/model_adapters/conditions_extractor.rb:68 + def add_to_cache(table_alias, relation_name, path_to_key); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/conditions_extractor.rb:64 + def already_used?(table_alias, relation_name, path_to_key); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/conditions_extractor.rb:37 + def calculate_nested(model_class, result_hash, relation_name, value, path_to_key); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/conditions_extractor.rb:30 + def calculate_result_hash(key, model_class, path_to_key, result_hash, value); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/conditions_extractor.rb:50 + def generate_table_alias(model_class, relation_name, path_to_key); end +end + +# pkg:gem/cancancan#lib/cancan/model_adapters/conditions_normalizer.rb:7 +class CanCan::ModelAdapters::ConditionsNormalizer + class << self + # pkg:gem/cancancan#lib/cancan/model_adapters/conditions_normalizer.rb:9 + def normalize(model_class, rules); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/conditions_normalizer.rb:13 + def normalize_conditions(model_class, conditions); end + + private + + # pkg:gem/cancancan#lib/cancan/model_adapters/conditions_normalizer.rb:28 + def calculate_result_hash(model_class, key, value); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/conditions_normalizer.rb:43 + def normalizable_association?(reflection); end + end +end + +# pkg:gem/cancancan#lib/cancan/model_adapters/default_adapter.rb:5 +class CanCan::ModelAdapters::DefaultAdapter < ::CanCan::ModelAdapters::AbstractAdapter; end + +# pkg:gem/cancancan#lib/cancan/model_adapters/sti_normalizer.rb:7 +class CanCan::ModelAdapters::StiNormalizer + class << self + # pkg:gem/cancancan#lib/cancan/model_adapters/sti_normalizer.rb:9 + def normalize(rules); end + + private + + # create a new rule for the subclasses that links on the inheritance_column + # + # pkg:gem/cancancan#lib/cancan/model_adapters/sti_normalizer.rb:32 + def build_rule_for_subclass(rule, subject); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/sti_normalizer.rb:24 + def update_rule(subject, rule, rules_cache); end + end +end + +# pkg:gem/cancancan#lib/cancan/model_adapters/strategies/base.rb:3 +class CanCan::ModelAdapters::Strategies; end + +# pkg:gem/cancancan#lib/cancan/model_adapters/strategies/base.rb:4 +class CanCan::ModelAdapters::Strategies::Base + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/base.rb:20 + def initialize(adapter:, relation:, where_conditions:); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/base.rb:5 + def adapter; end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/base.rb:26 + def aliased_table_name; end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/base.rb:7 + def compressed_rules(*, **, &); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/base.rb:17 + def connection(*, **, &); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/base.rb:7 + def extract_multiple_conditions(*, **, &); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/base.rb:7 + def joins(*, **, &); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/base.rb:7 + def model_class(*, **, &); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/base.rb:18 + def quote_table_name(*, **, &); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/base.rb:7 + def quoted_aliased_table_name; end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/base.rb:7 + def quoted_primary_key(*, **, &); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/base.rb:7 + def quoted_table_name; end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/base.rb:5 + def relation; end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/base.rb:5 + def where_conditions; end +end + +# pkg:gem/cancancan#lib/cancan/model_adapters/strategies/joined_alias_each_rule_as_exists_subquery.rb:6 +class CanCan::ModelAdapters::Strategies::JoinedAliasEachRuleAsExistsSubquery < ::CanCan::ModelAdapters::Strategies::Base + # Converts an array like [:child, :grand_child] into a hash like {child: {grand_child: {}} + # + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/joined_alias_each_rule_as_exists_subquery.rb:78 + def current_path_to_hash(current_path); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/joined_alias_each_rule_as_exists_subquery.rb:16 + def double_exists_sql; end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/joined_alias_each_rule_as_exists_subquery.rb:7 + def execute!; end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/joined_alias_each_rule_as_exists_subquery.rb:55 + def extra_joins_recursive(current_path, conditions, joins, left_joins); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/joined_alias_each_rule_as_exists_subquery.rb:67 + def extra_joins_recursive_merge_joins(current_path, value, joins, left_joins); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/joined_alias_each_rule_as_exists_subquery.rb:47 + def extract_joins_from_rule(rule); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/joined_alias_each_rule_as_exists_subquery.rb:27 + def sub_query_for_rule(rule); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/joined_alias_each_rule_as_exists_subquery.rb:34 + def sub_query_for_rules_and_join_hashes(rule_where_conditions, joins_hash, left_joins_hash); end +end + +# pkg:gem/cancancan#lib/cancan/model_adapters/strategies/joined_alias_exists_subquery.rb:6 +class CanCan::ModelAdapters::Strategies::JoinedAliasExistsSubquery < ::CanCan::ModelAdapters::Strategies::Base + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/joined_alias_exists_subquery.rb:7 + def execute!; end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/joined_alias_exists_subquery.rb:16 + def joined_alias_exists_subquery_inner_query; end +end + +# pkg:gem/cancancan#lib/cancan/model_adapters/strategies/left_join.rb:4 +class CanCan::ModelAdapters::Strategies::LeftJoin < ::CanCan::ModelAdapters::Strategies::Base + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/left_join.rb:5 + def execute!; end +end + +# pkg:gem/cancancan#lib/cancan/model_adapters/strategies/subquery.rb:4 +class CanCan::ModelAdapters::Strategies::Subquery < ::CanCan::ModelAdapters::Strategies::Base + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/subquery.rb:9 + def build_joins_relation_subquery(where_conditions); end + + # pkg:gem/cancancan#lib/cancan/model_adapters/strategies/subquery.rb:5 + def execute!; end +end + +# This module adds the accessible_by class method to a model. It is included in the model adapters. +# +# pkg:gem/cancancan#lib/cancan/model_additions.rb:5 +module CanCan::ModelAdditions + mixes_in_class_methods ::CanCan::ModelAdditions::ClassMethods + + class << self + # pkg:gem/cancancan#lib/cancan/model_additions.rb:30 + def included(base); end + end +end + +# pkg:gem/cancancan#lib/cancan/model_additions.rb:6 +module CanCan::ModelAdditions::ClassMethods + # Returns a scope which fetches only the records that the passed ability + # can perform a given action on. The action defaults to :index. This + # is usually called from a controller and passed the +current_ability+. + # + # @articles = Article.accessible_by(current_ability) + # + # Here only the articles which the user is able to read will be returned. + # If the user does not have permission to read any articles then an empty + # result is returned. Since this is a scope it can be combined with any + # other scopes or pagination. + # + # An alternative action can optionally be passed as a second argument. + # + # @articles = Article.accessible_by(current_ability, :update) + # + # Here only the articles which the user can update are returned. + # + # pkg:gem/cancancan#lib/cancan/model_additions.rb:23 + def accessible_by(ability, action = T.unsafe(nil), strategy: T.unsafe(nil)); end +end + +# Raised when behavior is not implemented, usually used in an abstract class. +# +# pkg:gem/cancancan#lib/cancan/exceptions.rb:8 +class CanCan::NotImplemented < ::CanCan::Error; end + +# pkg:gem/cancancan#lib/cancan/parameter_validators.rb:4 +module CanCan::ParameterValidators + # pkg:gem/cancancan#lib/cancan/parameter_validators.rb:5 + def valid_attribute_param?(attribute); end +end + +# pkg:gem/cancancan#lib/cancan/relevant.rb:4 +module CanCan::Relevant + # Matches both the action, subject, and attribute, not necessarily the conditions + # + # pkg:gem/cancancan#lib/cancan/relevant.rb:6 + def relevant?(action, subject); end + + private + + # pkg:gem/cancancan#lib/cancan/relevant.rb:13 + def matches_action?(action); end + + # pkg:gem/cancancan#lib/cancan/relevant.rb:17 + def matches_subject?(subject); end + + # pkg:gem/cancancan#lib/cancan/relevant.rb:21 + def matches_subject_class?(subject); end +end + +# This class is used internally and should only be called through Ability. +# it holds the information about a "can" call made on Ability and provides +# helpful methods to determine permission checking and conditions hash generation. +# +# pkg:gem/cancancan#lib/cancan/rule.rb:11 +class CanCan::Rule + include ::CanCan::ConditionsMatcher + include ::CanCan::Relevant + include ::CanCan::ParameterValidators + + # The first argument when initializing is the base_behavior which is a true/false + # value. True for "can" and false for "cannot". The next two arguments are the action + # and subject respectively (such as :read, @project). The third argument is a hash + # of conditions and the last one is the block passed to the "can" call. + # + # pkg:gem/cancancan#lib/cancan/rule.rb:22 + def initialize(base_behavior, action, subject, *extra_args, &block); end + + # pkg:gem/cancancan#lib/cancan/rule.rb:15 + def actions; end + + # pkg:gem/cancancan#lib/cancan/rule.rb:76 + def associations_hash(conditions = T.unsafe(nil)); end + + # pkg:gem/cancancan#lib/cancan/rule.rb:15 + def attributes; end + + # pkg:gem/cancancan#lib/cancan/rule.rb:86 + def attributes_from_conditions; end + + # pkg:gem/cancancan#lib/cancan/rule.rb:15 + def base_behavior; end + + # pkg:gem/cancancan#lib/cancan/rule.rb:15 + def block; end + + # pkg:gem/cancancan#lib/cancan/rule.rb:51 + def can_rule?; end + + # pkg:gem/cancancan#lib/cancan/rule.rb:55 + def cannot_catch_all?; end + + # pkg:gem/cancancan#lib/cancan/rule.rb:59 + def catch_all?; end + + # pkg:gem/cancancan#lib/cancan/rule.rb:15 + def conditions; end + + # pkg:gem/cancancan#lib/cancan/rule.rb:16 + def conditions=(_arg0); end + + # pkg:gem/cancancan#lib/cancan/rule.rb:16 + def expanded_actions=(_arg0); end + + # pkg:gem/cancancan#lib/cancan/rule.rb:38 + def inspect; end + + # pkg:gem/cancancan#lib/cancan/rule.rb:96 + def matches_attributes?(attribute); end + + # pkg:gem/cancancan#lib/cancan/rule.rb:64 + def only_block?; end + + # pkg:gem/cancancan#lib/cancan/rule.rb:68 + def only_raw_sql?; end + + # pkg:gem/cancancan#lib/cancan/rule.rb:15 + def subjects; end + + # pkg:gem/cancancan#lib/cancan/rule.rb:72 + def with_scope?; end + + private + + # pkg:gem/cancancan#lib/cancan/rule.rb:123 + def condition_and_block_check(conditions, block, action, subject); end + + # pkg:gem/cancancan#lib/cancan/rule.rb:105 + def matches_action?(action); end + + # pkg:gem/cancancan#lib/cancan/rule.rb:109 + def matches_subject?(subject); end + + # pkg:gem/cancancan#lib/cancan/rule.rb:113 + def matches_subject_class?(subject); end + + # pkg:gem/cancancan#lib/cancan/rule.rb:117 + def parse_attributes_from_extra_args(args); end + + # pkg:gem/cancancan#lib/cancan/rule.rb:130 + def wrap(object); end +end + +# pkg:gem/cancancan#lib/cancan/rules_compressor.rb:5 +class CanCan::RulesCompressor + # pkg:gem/cancancan#lib/cancan/rules_compressor.rb:8 + def initialize(rules); end + + # pkg:gem/cancancan#lib/cancan/rules_compressor.rb:13 + def compress(array); end + + # pkg:gem/cancancan#lib/cancan/rules_compressor.rb:6 + def initial_rules; end + + # pkg:gem/cancancan#lib/cancan/rules_compressor.rb:6 + def rules_collapsed; end + + # If we have A OR (!A AND anything ), then we can simplify to A OR anything + # If we have A OR (A OR anything ), then we can simplify to A OR anything + # If we have !A AND (A OR something), then we can simplify it to !A AND something + # If we have !A AND (!A AND something), then we can simplify it to !A AND something + # + # So as soon as we see a condition that is the same as the previous one, + # we can skip it, no matter of the base_behavior + # + # pkg:gem/cancancan#lib/cancan/rules_compressor.rb:31 + def simplify(rules); end +end + +# pkg:gem/cancancan#lib/cancan/unauthorized_message_resolver.rb:4 +module CanCan::UnauthorizedMessageResolver + # pkg:gem/cancancan#lib/cancan/unauthorized_message_resolver.rb:15 + def translate_subject(subject); end + + # pkg:gem/cancancan#lib/cancan/unauthorized_message_resolver.rb:5 + def unauthorized_message(action, subject); end +end + +# pkg:gem/cancancan#lib/cancan/version.rb:4 +CanCan::VERSION = T.let(T.unsafe(nil), String) + +# Raised when using a wrong association name +# +# pkg:gem/cancancan#lib/cancan/exceptions.rb:23 +class CanCan::WrongAssociationName < ::CanCan::Error; end + +# pkg:gem/cancancan#lib/cancancan.rb:5 +module CanCanCan; end + +# pkg:gem/cancancan#lib/cancan/sti_detector.rb:3 +class StiDetector + class << self + # pkg:gem/cancancan#lib/cancan/sti_detector.rb:4 + def sti_class?(subject); end + end +end + +# This class is responsible for matching classes and their subclasses as well as +# upmatching classes to their ancestors. +# This is used to generate sti connections +# +# pkg:gem/cancancan#lib/cancan/class_matcher.rb:6 +class SubjectClassMatcher + class << self + # pkg:gem/cancancan#lib/cancan/class_matcher.rb:25 + def matches_class_or_is_related(subject, sub); end + + # pkg:gem/cancancan#lib/cancan/class_matcher.rb:7 + def matches_subject_class?(subjects, subject); end + + # pkg:gem/cancancan#lib/cancan/class_matcher.rb:14 + def matching_class_check(subject, sub, has_subclasses); end + end +end 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 000000000..e953b951e --- /dev/null +++ b/sorbet/rbi/gems/capybara@3.40.0.rbi @@ -0,0 +1,8285 @@ +# 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`. + + +# pkg:gem/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 [String] html The raw html + # @return [Nokogiri::HTML::Document] HTML document + # + # pkg:gem/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 [Symbol] name The name of the selector to add + # @yield A block executed in the context of the new {Capybara::Selector} + # + # pkg:gem/capybara#lib/capybara.rb:182 + def add_selector(name, **options, &block); end + + # pkg:gem/capybara#lib/capybara.rb:45 + def allow_gumbo(*args, **, &block); end + + # pkg:gem/capybara#lib/capybara.rb:45 + def allow_gumbo=(*args, **, &block); end + + # pkg:gem/capybara#lib/capybara.rb:58 + def always_include_port(*args, **, &block); end + + # pkg:gem/capybara#lib/capybara.rb:58 + def always_include_port=(*args, **, &block); end + + # pkg:gem/capybara#lib/capybara.rb:45 + def app(*args, **, &block); end + + # pkg:gem/capybara#lib/capybara.rb:45 + def app=(*args, **, &block); end + + # pkg:gem/capybara#lib/capybara.rb:58 + def app_host(*args, **, &block); end + + # pkg:gem/capybara#lib/capybara.rb:58 + def app_host=(*args, **, &block); end + + # pkg:gem/capybara#lib/capybara.rb:58 + def asset_host(*args, **, &block); end + + # pkg:gem/capybara#lib/capybara.rb:58 + def asset_host=(*args, **, &block); end + + # pkg:gem/capybara#lib/capybara.rb:58 + def automatic_label_click(*args, **, &block); end + + # pkg:gem/capybara#lib/capybara.rb:58 + def automatic_label_click=(*args, **, &block); end + + # pkg:gem/capybara#lib/capybara.rb:58 + def automatic_reload(*args, **, &block); end + + # pkg:gem/capybara#lib/capybara.rb:58 + def automatic_reload=(*args, **, &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 `