sorbet-rails 0.7.33 → 0.7.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci-master.yml +1 -1
  3. data/.github/workflows/ci.yml +1 -1
  4. data/CONTRIBUTING.md +1 -0
  5. data/Gemfile +4 -0
  6. data/README.md +1 -1
  7. data/Rakefile +27 -1
  8. data/lib/sorbet-rails/active_record_rbi_formatter.rb +1 -1
  9. data/lib/sorbet-rails/model_plugins/active_record_querying.rb +14 -0
  10. data/lib/sorbet-rails/rails_mixins/active_record_overrides.rb +1 -1
  11. data/lib/sorbet-rails/tasks/rails_rbi.rake +15 -0
  12. data/sorbet-rails.gemspec +1 -1
  13. data/spec/bin/run_all_specs.sh +1 -0
  14. data/spec/generators/rails-template.rb +2 -7
  15. data/spec/rails_helper.rb +2 -0
  16. data/spec/rake_rails_rbi_models_spec.rb +1 -1
  17. data/spec/support/v5.2/sorbet_test_cases.rb +8 -0
  18. data/spec/support/v6.0/sorbet_test_cases.rb +8 -0
  19. data/spec/support/v6.1/sorbet_test_cases.rb +8 -0
  20. data/spec/support/v7.0/.gitattributes +7 -0
  21. data/spec/support/v7.0/.gitignore +35 -0
  22. data/spec/support/v7.0/Gemfile +48 -0
  23. data/spec/support/v7.0/Gemfile.lock +218 -0
  24. data/spec/support/v7.0/README.md +24 -0
  25. data/spec/support/v7.0/Rakefile +6 -0
  26. data/spec/support/v7.0/app/assets/images/.keep +0 -0
  27. data/spec/support/v7.0/app/assets/stylesheets/application.css +1 -0
  28. data/spec/support/v7.0/app/controllers/application_controller.rb +3 -0
  29. data/spec/support/v7.0/app/controllers/concerns/.keep +0 -0
  30. data/spec/support/v7.0/app/helpers/application_helper.rb +3 -0
  31. data/spec/support/v7.0/app/helpers/bar_helper.rb +3 -0
  32. data/spec/support/v7.0/app/helpers/baz_helper.rb +3 -0
  33. data/spec/support/v7.0/app/helpers/foo_helper.rb +3 -0
  34. data/spec/support/v7.0/app/jobs/application_job.rb +8 -0
  35. data/spec/support/v7.0/app/jobs/award_house_point_hourglasses.rb +12 -0
  36. data/spec/support/v7.0/app/mailers/application_mailer.rb +5 -0
  37. data/spec/support/v7.0/app/mailers/daily_prophet_mailer.rb +9 -0
  38. data/spec/support/v7.0/app/mailers/hogwarts_acceptance_mailer.rb +29 -0
  39. data/spec/support/v7.0/app/models/application_record.rb +4 -0
  40. data/spec/support/v7.0/app/models/concerns/.keep +0 -0
  41. data/spec/support/v7.0/app/models/concerns/mythical.rb +11 -0
  42. data/spec/support/v7.0/app/models/headmaster.rb +8 -0
  43. data/spec/support/v7.0/app/models/potion.rb +6 -0
  44. data/spec/support/v7.0/app/models/robe.rb +4 -0
  45. data/spec/support/v7.0/app/models/school.rb +5 -0
  46. data/spec/support/v7.0/app/models/spell.rb +5 -0
  47. data/spec/support/v7.0/app/models/spell_book.rb +18 -0
  48. data/spec/support/v7.0/app/models/squib.rb +6 -0
  49. data/spec/support/v7.0/app/models/subject.rb +5 -0
  50. data/spec/support/v7.0/app/models/wand.rb +19 -0
  51. data/spec/support/v7.0/app/models/wizard.rb +65 -0
  52. data/spec/support/v7.0/app/views/layouts/application.html.erb +15 -0
  53. data/spec/support/v7.0/app/views/layouts/mailer.html.erb +13 -0
  54. data/spec/support/v7.0/app/views/layouts/mailer.text.erb +1 -0
  55. data/spec/support/v7.0/bin/bundle +114 -0
  56. data/spec/support/v7.0/bin/rails +4 -0
  57. data/spec/support/v7.0/bin/rake +4 -0
  58. data/spec/support/v7.0/bin/setup +33 -0
  59. data/spec/support/v7.0/config/application.rb +38 -0
  60. data/spec/support/v7.0/config/boot.rb +4 -0
  61. data/spec/support/v7.0/config/database.yml +25 -0
  62. data/spec/support/v7.0/config/environment.rb +6 -0
  63. data/spec/support/v7.0/config/environments/development.rb +69 -0
  64. data/spec/support/v7.0/config/environments/production.rb +83 -0
  65. data/spec/support/v7.0/config/environments/test.rb +61 -0
  66. data/spec/support/v7.0/config/initializers/content_security_policy.rb +26 -0
  67. data/spec/support/v7.0/config/initializers/filter_parameter_logging.rb +9 -0
  68. data/spec/support/v7.0/config/initializers/inflections.rb +17 -0
  69. data/spec/support/v7.0/config/initializers/permissions_policy.rb +12 -0
  70. data/spec/support/v7.0/config/initializers/sorbet_rails.rb +3 -0
  71. data/spec/support/v7.0/config/locales/en.yml +33 -0
  72. data/spec/support/v7.0/config/puma.rb +44 -0
  73. data/spec/support/v7.0/config/routes.rb +8 -0
  74. data/spec/support/v7.0/config/storage.yml +34 -0
  75. data/spec/support/v7.0/config.ru +6 -0
  76. data/spec/support/v7.0/db/migrate/20190620000001_create_wizards.rb +14 -0
  77. data/spec/support/v7.0/db/migrate/20190620000002_create_wands.rb +12 -0
  78. data/spec/support/v7.0/db/migrate/20190620000003_create_spell_books.rb +10 -0
  79. data/spec/support/v7.0/db/migrate/20190620000004_add_more_column_types_to_wands.rb +14 -0
  80. data/spec/support/v7.0/db/migrate/20190620000005_add_broom_to_wizard.rb +6 -0
  81. data/spec/support/v7.0/db/migrate/20190620000006_add_more_enums_to_wizard.rb +9 -0
  82. data/spec/support/v7.0/db/migrate/20190620000007_add_type_to_wizard.rb +6 -0
  83. data/spec/support/v7.0/db/migrate/20190620000008_add_robe_to_wizard.rb +8 -0
  84. data/spec/support/v7.0/db/migrate/20190620000009_add_school.rb +10 -0
  85. data/spec/support/v7.0/db/migrate/20190620000010_add_subject.rb +8 -0
  86. data/spec/support/v7.0/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
  87. data/spec/support/v7.0/db/migrate/20190620000012_add_spell.rb +8 -0
  88. data/spec/support/v7.0/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
  89. data/spec/support/v7.0/db/migrate/20190620000014_create_headmasters.rb +9 -0
  90. data/spec/support/v7.0/db/migrate/20190620000015_add_serialized_to_wizards.rb +9 -0
  91. data/spec/support/v7.0/db/schema.rb +98 -0
  92. data/spec/support/v7.0/db/seeds.rb +8 -0
  93. data/spec/support/v7.0/lib/assets/.keep +0 -0
  94. data/spec/support/v7.0/lib/mythical_rbi_plugin.rb +16 -0
  95. data/spec/support/v7.0/lib/tasks/.keep +0 -0
  96. data/spec/support/v7.0/log/.keep +0 -0
  97. data/spec/support/v7.0/sorbet_test_cases.rb +439 -0
  98. data/spec/support/v7.0/storage/.keep +0 -0
  99. data/spec/support/v7.0/tmp/.keep +0 -0
  100. data/spec/support/v7.0/tmp/pids/.keep +0 -0
  101. data/spec/support/v7.0/tmp/storage/.keep +0 -0
  102. data/spec/support/v7.0/vendor/.keep +0 -0
  103. data/spec/test_data/v5.2/expected_active_record_base.rbi +6 -0
  104. data/spec/test_data/v5.2/expected_active_record_relation.rbi +6 -0
  105. data/spec/test_data/v6.0/expected_active_record_base.rbi +6 -0
  106. data/spec/test_data/v6.0/expected_active_record_relation.rbi +6 -0
  107. data/spec/test_data/v6.1/expected_active_record_base.rbi +6 -0
  108. data/spec/test_data/v6.1/expected_active_record_relation.rbi +6 -0
  109. data/spec/test_data/v7.0/expected_active_record_base.rbi +119 -0
  110. data/spec/test_data/v7.0/expected_active_record_relation.rbi +180 -0
  111. data/spec/test_data/v7.0/expected_application_job.rbi +20 -0
  112. data/spec/test_data/v7.0/expected_application_mailer.rbi +5 -0
  113. data/spec/test_data/v7.0/expected_attachment.rbi +358 -0
  114. data/spec/test_data/v7.0/expected_award_house_point_hourglasses.rbi +20 -0
  115. data/spec/test_data/v7.0/expected_blob.rbi +394 -0
  116. data/spec/test_data/v7.0/expected_custom_application_job.rbi +21 -0
  117. data/spec/test_data/v7.0/expected_custom_application_mailer.rbi +6 -0
  118. data/spec/test_data/v7.0/expected_custom_award_house_point_hourglasses.rbi +21 -0
  119. data/spec/test_data/v7.0/expected_custom_daily_prophet_mailer.rbi +8 -0
  120. data/spec/test_data/v7.0/expected_custom_hogwarts_acceptance_mailer.rbi +21 -0
  121. data/spec/test_data/v7.0/expected_daily_prophet_mailer.rbi +7 -0
  122. data/spec/test_data/v7.0/expected_headmaster.rbi +376 -0
  123. data/spec/test_data/v7.0/expected_helpers.rbi +27 -0
  124. data/spec/test_data/v7.0/expected_helpers_with_application_and_devise_helpers.rbi +34 -0
  125. data/spec/test_data/v7.0/expected_hogwarts_acceptance_mailer.rbi +20 -0
  126. data/spec/test_data/v7.0/expected_internal_metadata.rbi +346 -0
  127. data/spec/test_data/v7.0/expected_no_routes.rbi +4 -0
  128. data/spec/test_data/v7.0/expected_potion.rbi +328 -0
  129. data/spec/test_data/v7.0/expected_record.rbi +307 -0
  130. data/spec/test_data/v7.0/expected_robe.rbi +349 -0
  131. data/spec/test_data/v7.0/expected_routes.rbi +182 -0
  132. data/spec/test_data/v7.0/expected_schema_migration.rbi +319 -0
  133. data/spec/test_data/v7.0/expected_school.rbi +349 -0
  134. data/spec/test_data/v7.0/expected_spell/habtm_spell_books.rbi +367 -0
  135. data/spec/test_data/v7.0/expected_spell.rbi +340 -0
  136. data/spec/test_data/v7.0/expected_spell_book/habtm_spells.rbi +367 -0
  137. data/spec/test_data/v7.0/expected_spell_book.rbi +499 -0
  138. data/spec/test_data/v7.0/expected_squib.rbi +1204 -0
  139. data/spec/test_data/v7.0/expected_srb_tc_output.txt +1 -0
  140. data/spec/test_data/v7.0/expected_subject/habtm_wizards.rbi +367 -0
  141. data/spec/test_data/v7.0/expected_subject.rbi +340 -0
  142. data/spec/test_data/v7.0/expected_variant_record.rbi +382 -0
  143. data/spec/test_data/v7.0/expected_wand.rbi +611 -0
  144. data/spec/test_data/v7.0/expected_wizard/habtm_subjects.rbi +367 -0
  145. data/spec/test_data/v7.0/expected_wizard.rbi +1280 -0
  146. data/spec/test_data/v7.0/expected_wizard_wo_spellbook.rbi +1274 -0
  147. metadata +243 -1
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative "../config/boot"
3
+ require "rake"
4
+ Rake.application.run
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env ruby
2
+ require "fileutils"
3
+
4
+ # path to your application root.
5
+ APP_ROOT = File.expand_path("..", __dir__)
6
+
7
+ def system!(*args)
8
+ system(*args) || abort("\n== Command #{args} failed ==")
9
+ end
10
+
11
+ FileUtils.chdir APP_ROOT do
12
+ # This script is a way to set up or update your development environment automatically.
13
+ # This script is idempotent, so that you can run it at any time and get an expectable outcome.
14
+ # Add necessary setup steps to this file.
15
+
16
+ puts "== Installing dependencies =="
17
+ system! "gem install bundler --conservative"
18
+ system("bundle check") || system!("bundle install")
19
+
20
+ # puts "\n== Copying sample files =="
21
+ # unless File.exist?("config/database.yml")
22
+ # FileUtils.cp "config/database.yml.sample", "config/database.yml"
23
+ # end
24
+
25
+ puts "\n== Preparing database =="
26
+ system! "bin/rails db:prepare"
27
+
28
+ puts "\n== Removing old logs and tempfiles =="
29
+ system! "bin/rails log:clear tmp:clear"
30
+
31
+ puts "\n== Restarting application server =="
32
+ system! "bin/rails restart"
33
+ end
@@ -0,0 +1,38 @@
1
+ # typed: strict
2
+ require_relative "boot"
3
+
4
+ require "rails"
5
+ # Pick the frameworks you want:
6
+ require "active_model/railtie"
7
+ require "active_job/railtie"
8
+ require "active_record/railtie"
9
+ require "active_storage/engine"
10
+ require "action_controller/railtie"
11
+ require "action_mailer/railtie"
12
+ require "action_mailbox/engine"
13
+ # require "action_text/engine"
14
+ require "action_view/railtie"
15
+ # require "action_cable/engine"
16
+ # require "rails/test_unit/railtie"
17
+
18
+ # Require the gems listed in Gemfile, including any gems
19
+ # you've limited to :test, :development, or :production.
20
+ Bundler.require(*Rails.groups)
21
+
22
+ module V70
23
+ class Application < Rails::Application
24
+ # Initialize configuration defaults for originally generated Rails version.
25
+ config.load_defaults 7.0
26
+
27
+ # Configuration for the application, engines, and railties goes here.
28
+ #
29
+ # These settings can be overridden in specific environments using the files
30
+ # in config/environments, which are processed later.
31
+ #
32
+ # config.time_zone = "Central Time (US & Canada)"
33
+ # config.eager_load_paths << Rails.root.join("extras")
34
+
35
+ # Don't generate system test files.
36
+ config.generators.system_tests = nil
37
+ end
38
+ end
@@ -0,0 +1,4 @@
1
+ # typed: strict
2
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
3
+
4
+ require "bundler/setup" # Set up gems listed in the Gemfile.
@@ -0,0 +1,25 @@
1
+ # SQLite. Versions 3.8.0 and up are supported.
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem "sqlite3"
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: db/production.sqlite3
@@ -0,0 +1,6 @@
1
+ # typed: strict
2
+ # Load the Rails application.
3
+ require_relative "application"
4
+
5
+ # Initialize the Rails application.
6
+ Rails.application.initialize!
@@ -0,0 +1,69 @@
1
+ # typed: strict
2
+ require "active_support/core_ext/integer/time"
3
+
4
+ Rails.application.configure do
5
+ # Settings specified here will take precedence over those in config/application.rb.
6
+
7
+ # In the development environment your application's code is reloaded any time
8
+ # it changes. This slows down response time but is perfect for development
9
+ # since you don't have to restart the web server when you make code changes.
10
+ config.cache_classes = false
11
+
12
+ # Do not eager load code on boot.
13
+ config.eager_load = false
14
+
15
+ # Show full error reports.
16
+ config.consider_all_requests_local = true
17
+
18
+ # Enable server timing
19
+ config.server_timing = true
20
+
21
+ # Enable/disable caching. By default caching is disabled.
22
+ # Run rails dev:cache to toggle caching.
23
+ if Rails.root.join("tmp/caching-dev.txt").exist?
24
+ config.action_controller.perform_caching = true
25
+ config.action_controller.enable_fragment_cache_logging = true
26
+
27
+ config.cache_store = :memory_store
28
+ config.public_file_server.headers = {
29
+ "Cache-Control" => "public, max-age=#{2.days.to_i}"
30
+ }
31
+ else
32
+ config.action_controller.perform_caching = false
33
+
34
+ config.cache_store = :null_store
35
+ end
36
+
37
+ # Store uploaded files on the local file system (see config/storage.yml for options).
38
+ config.active_storage.service = :local
39
+
40
+ # Don't care if the mailer can't send.
41
+ config.action_mailer.raise_delivery_errors = false
42
+
43
+ config.action_mailer.perform_caching = false
44
+
45
+ # Print deprecation notices to the Rails logger.
46
+ config.active_support.deprecation = :log
47
+
48
+ # Raise exceptions for disallowed deprecations.
49
+ config.active_support.disallowed_deprecation = :raise
50
+
51
+ # Tell Active Support which deprecation messages to disallow.
52
+ config.active_support.disallowed_deprecation_warnings = []
53
+
54
+ # Raise an error on page load if there are pending migrations.
55
+ config.active_record.migration_error = :page_load
56
+
57
+ # Highlight code that triggered database queries in logs.
58
+ config.active_record.verbose_query_logs = true
59
+
60
+
61
+ # Raises error for missing translations.
62
+ # config.i18n.raise_on_missing_translations = true
63
+
64
+ # Annotate rendered view with file names.
65
+ # config.action_view.annotate_rendered_view_with_filenames = true
66
+
67
+ # Uncomment if you wish to allow Action Cable access from any origin.
68
+ # config.action_cable.disable_request_forgery_protection = true
69
+ end
@@ -0,0 +1,83 @@
1
+ # typed: strict
2
+ require "active_support/core_ext/integer/time"
3
+
4
+ Rails.application.configure do
5
+ # Settings specified here will take precedence over those in config/application.rb.
6
+
7
+ # Code is not reloaded between requests.
8
+ config.cache_classes = true
9
+
10
+ # Eager load code on boot. This eager loads most of Rails and
11
+ # your application in memory, allowing both threaded web servers
12
+ # and those relying on copy on write to perform better.
13
+ # Rake tasks automatically ignore this option for performance.
14
+ config.eager_load = true
15
+
16
+ # Full error reports are disabled and caching is turned on.
17
+ config.consider_all_requests_local = false
18
+ config.action_controller.perform_caching = true
19
+
20
+ # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
21
+ # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
22
+ # config.require_master_key = true
23
+
24
+ # Disable serving static files from the `/public` folder by default since
25
+ # Apache or NGINX already handles this.
26
+ config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
27
+
28
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
29
+ # config.asset_host = "http://assets.example.com"
30
+
31
+ # Specifies the header that your server uses for sending files.
32
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
33
+ # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
34
+
35
+ # Store uploaded files on the local file system (see config/storage.yml for options).
36
+ config.active_storage.service = :local
37
+
38
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
39
+ # config.force_ssl = true
40
+
41
+ # Include generic and useful information about system operation, but avoid logging too much
42
+ # information to avoid inadvertent exposure of personally identifiable information (PII).
43
+ config.log_level = :info
44
+
45
+ # Prepend all log lines with the following tags.
46
+ config.log_tags = [ :request_id ]
47
+
48
+ # Use a different cache store in production.
49
+ # config.cache_store = :mem_cache_store
50
+
51
+ # Use a real queuing backend for Active Job (and separate queues per environment).
52
+ # config.active_job.queue_adapter = :resque
53
+ # config.active_job.queue_name_prefix = "v7_0_production"
54
+
55
+ config.action_mailer.perform_caching = false
56
+
57
+ # Ignore bad email addresses and do not raise email delivery errors.
58
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
59
+ # config.action_mailer.raise_delivery_errors = false
60
+
61
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
62
+ # the I18n.default_locale when a translation cannot be found).
63
+ config.i18n.fallbacks = true
64
+
65
+ # Don't log any deprecations.
66
+ config.active_support.report_deprecations = false
67
+
68
+ # Use default logging formatter so that PID and timestamp are not suppressed.
69
+ config.log_formatter = ::Logger::Formatter.new
70
+
71
+ # Use a different logger for distributed setups.
72
+ # require "syslog/logger"
73
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
74
+
75
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
76
+ logger = ActiveSupport::Logger.new(STDOUT)
77
+ logger.formatter = config.log_formatter
78
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
79
+ end
80
+
81
+ # Do not dump schema after migrations.
82
+ config.active_record.dump_schema_after_migration = false
83
+ end
@@ -0,0 +1,61 @@
1
+ # typed: strict
2
+ require "active_support/core_ext/integer/time"
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+
9
+ Rails.application.configure do
10
+ # Settings specified here will take precedence over those in config/application.rb.
11
+
12
+ # Turn false under Spring and add config.action_view.cache_template_loading = true.
13
+ config.cache_classes = true
14
+
15
+ # Eager loading loads your whole application. When running a single test locally,
16
+ # this probably isn't necessary. It's a good idea to do in a continuous integration
17
+ # system, or in some way before deploying your code.
18
+ config.eager_load = ENV["CI"].present?
19
+
20
+ # Configure public file server for tests with Cache-Control for performance.
21
+ config.public_file_server.enabled = true
22
+ config.public_file_server.headers = {
23
+ "Cache-Control" => "public, max-age=#{1.hour.to_i}"
24
+ }
25
+
26
+ # Show full error reports and disable caching.
27
+ config.consider_all_requests_local = true
28
+ config.action_controller.perform_caching = false
29
+ config.cache_store = :null_store
30
+
31
+ # Raise exceptions instead of rendering exception templates.
32
+ config.action_dispatch.show_exceptions = false
33
+
34
+ # Disable request forgery protection in test environment.
35
+ config.action_controller.allow_forgery_protection = false
36
+
37
+ # Store uploaded files on the local file system in a temporary directory.
38
+ config.active_storage.service = :test
39
+
40
+ config.action_mailer.perform_caching = false
41
+
42
+ # Tell Action Mailer not to deliver emails to the real world.
43
+ # The :test delivery method accumulates sent emails in the
44
+ # ActionMailer::Base.deliveries array.
45
+ config.action_mailer.delivery_method = :test
46
+
47
+ # Print deprecation notices to the stderr.
48
+ config.active_support.deprecation = :stderr
49
+
50
+ # Raise exceptions for disallowed deprecations.
51
+ config.active_support.disallowed_deprecation = :raise
52
+
53
+ # Tell Active Support which deprecation messages to disallow.
54
+ config.active_support.disallowed_deprecation_warnings = []
55
+
56
+ # Raises error for missing translations.
57
+ # config.i18n.raise_on_missing_translations = true
58
+
59
+ # Annotate rendered view with file names.
60
+ # config.action_view.annotate_rendered_view_with_filenames = true
61
+ end
@@ -0,0 +1,26 @@
1
+ # typed: strict
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ # Define an application-wide content security policy.
5
+ # See the Securing Rails Applications Guide for more information:
6
+ # https://guides.rubyonrails.org/security.html#content-security-policy-header
7
+
8
+ # Rails.application.configure do
9
+ # config.content_security_policy do |policy|
10
+ # policy.default_src :self, :https
11
+ # policy.font_src :self, :https, :data
12
+ # policy.img_src :self, :https, :data
13
+ # policy.object_src :none
14
+ # policy.script_src :self, :https
15
+ # policy.style_src :self, :https
16
+ # # Specify URI for violation reports
17
+ # # policy.report_uri "/csp-violation-report-endpoint"
18
+ # end
19
+ #
20
+ # # Generate session nonces for permitted importmap and inline scripts
21
+ # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
22
+ # config.content_security_policy_nonce_directives = %w(script-src)
23
+ #
24
+ # # Report violations without enforcing the policy.
25
+ # # config.content_security_policy_report_only = true
26
+ # end
@@ -0,0 +1,9 @@
1
+ # typed: strict
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ # Configure parameters to be filtered from the log file. Use this to limit dissemination of
5
+ # sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
6
+ # notations and behaviors.
7
+ Rails.application.config.filter_parameters += [
8
+ :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
9
+ ]
@@ -0,0 +1,17 @@
1
+ # typed: strict
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ # Add new inflection rules using the following format. Inflections
5
+ # are locale specific, and you may define rules for as many different
6
+ # locales as you wish. All of these examples are active by default:
7
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
8
+ # inflect.plural /^(ox)$/i, "\\1en"
9
+ # inflect.singular /^(ox)en/i, "\\1"
10
+ # inflect.irregular "person", "people"
11
+ # inflect.uncountable %w( fish sheep )
12
+ # end
13
+
14
+ # These inflection rules are supported but not enabled by default:
15
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
16
+ # inflect.acronym "RESTful"
17
+ # end
@@ -0,0 +1,12 @@
1
+ # typed: strict
2
+ # Define an application-wide HTTP permissions policy. For further
3
+ # information see https://developers.google.com/web/updates/2018/06/feature-policy
4
+ #
5
+ # Rails.application.config.permissions_policy do |f|
6
+ # f.camera :none
7
+ # f.gyroscope :none
8
+ # f.microphone :none
9
+ # f.usb :none
10
+ # f.fullscreen :self
11
+ # f.payment :self, "https://secure.example.com"
12
+ # end
@@ -0,0 +1,3 @@
1
+ # typed: false
2
+ require(Rails.root.join('lib/mythical_rbi_plugin'))
3
+ SorbetRails::ModelRbiFormatter.register_plugin(MythicalRbiPlugin)
@@ -0,0 +1,33 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t "hello"
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t("hello") %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # The following keys must be escaped otherwise they will not be retrieved by
20
+ # the default I18n backend:
21
+ #
22
+ # true, false, on, off, yes, no
23
+ #
24
+ # Instead, surround them with single quotes.
25
+ #
26
+ # en:
27
+ # "true": "foo"
28
+ #
29
+ # To learn more, please read the Rails Internationalization guide
30
+ # available at https://guides.rubyonrails.org/i18n.html.
31
+
32
+ en:
33
+ hello: "Hello world"
@@ -0,0 +1,44 @@
1
+ # typed: false
2
+ # Puma can serve each request in a thread from an internal thread pool.
3
+ # The `threads` method setting takes two numbers: a minimum and maximum.
4
+ # Any libraries that use thread pools should be configured to match
5
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
6
+ # and maximum; this matches the default thread size of Active Record.
7
+ #
8
+ max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
9
+ min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
10
+ threads min_threads_count, max_threads_count
11
+
12
+ # Specifies the `worker_timeout` threshold that Puma will use to wait before
13
+ # terminating a worker in development environments.
14
+ #
15
+ worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
16
+
17
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
18
+ #
19
+ port ENV.fetch("PORT") { 3000 }
20
+
21
+ # Specifies the `environment` that Puma will run in.
22
+ #
23
+ environment ENV.fetch("RAILS_ENV") { "development" }
24
+
25
+ # Specifies the `pidfile` that Puma will use.
26
+ pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
27
+
28
+ # Specifies the number of `workers` to boot in clustered mode.
29
+ # Workers are forked web server processes. If using threads and workers together
30
+ # the concurrency of the application would be max `threads` * `workers`.
31
+ # Workers do not work on JRuby or Windows (both of which do not support
32
+ # processes).
33
+ #
34
+ # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
35
+
36
+ # Use the `preload_app!` method when specifying a `workers` number.
37
+ # This directive tells Puma to first boot the application and load code
38
+ # before forking the application. This takes advantage of Copy On Write
39
+ # process behavior so workers use less memory.
40
+ #
41
+ # preload_app!
42
+
43
+ # Allow puma to be restarted by `bin/rails restart` command.
44
+ plugin :tmp_restart
@@ -0,0 +1,8 @@
1
+ # typed: false
2
+ Rails.application.routes.draw do
3
+ get 'test/index' => 'test#index'
4
+ # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
5
+
6
+ # Defines the root path route ("/")
7
+ # root "articles#index"
8
+ end
@@ -0,0 +1,34 @@
1
+ test:
2
+ service: Disk
3
+ root: <%= Rails.root.join("tmp/storage") %>
4
+
5
+ local:
6
+ service: Disk
7
+ root: <%= Rails.root.join("storage") %>
8
+
9
+ # Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10
+ # amazon:
11
+ # service: S3
12
+ # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13
+ # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14
+ # region: us-east-1
15
+ # bucket: your_own_bucket-<%= Rails.env %>
16
+
17
+ # Remember not to checkin your GCS keyfile to a repository
18
+ # google:
19
+ # service: GCS
20
+ # project: your_project
21
+ # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22
+ # bucket: your_own_bucket-<%= Rails.env %>
23
+
24
+ # Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25
+ # microsoft:
26
+ # service: AzureStorage
27
+ # storage_account_name: your_account_name
28
+ # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29
+ # container: your_container_name-<%= Rails.env %>
30
+
31
+ # mirror:
32
+ # service: Mirror
33
+ # primary: local
34
+ # mirrors: [ amazon, google, microsoft ]
@@ -0,0 +1,6 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require_relative "config/environment"
4
+
5
+ run Rails.application
6
+ Rails.application.load_server
@@ -0,0 +1,14 @@
1
+ # typed: true
2
+ class CreateWizards < ActiveRecord::Migration[7.0]
3
+ def change
4
+ create_table :wizards do |t|
5
+ t.string :name
6
+ t.integer :house
7
+ t.integer :professor
8
+ t.string :parent_email
9
+ t.text :notes
10
+
11
+ t.timestamps null: false
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ # typed: true
2
+ class CreateWands < ActiveRecord::Migration[7.0]
3
+ def change
4
+ create_table :wands do |t|
5
+ t.references :wizard, unique: true, null: false
6
+ t.string :wood_type
7
+ t.integer :core_type
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,10 @@
1
+ # typed: true
2
+ class CreateSpellBooks < ActiveRecord::Migration[7.0]
3
+ def change
4
+ create_table :spell_books do |t|
5
+ t.string :name
6
+ t.references :wizard, null: false
7
+ t.integer :book_type, null: false, default: 0
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ # typed: true
2
+ class AddMoreColumnTypesToWands < ActiveRecord::Migration[7.0]
3
+ def change
4
+ add_column :wands, :flexibility, :float, null: false, default: 0.5
5
+ add_column :wands, :hardness, :decimal, null: false, precision: 10, scale: 10, default: 5
6
+ add_column :wands, :reflectance, :decimal, null: false, precision: 10, scale: 0, default: 0.5
7
+ add_column :wands, :broken, :boolean, null: false, default: false
8
+ add_column :wands, :broken_at, :datetime, null: true
9
+ add_column :wands, :chosen_at_date, :date
10
+ add_column :wands, :chosen_at_time, :time
11
+ add_column :wands, :spell_history, :json
12
+ add_column :wands, :maker_info, :json, null: false, default: '{}'
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ # typed: true
2
+ class AddBroomToWizard < ActiveRecord::Migration[7.0]
3
+ def change
4
+ add_column :wizards, :broom, :string
5
+ end
6
+ end
@@ -0,0 +1,9 @@
1
+ # typed: true
2
+ class AddMoreEnumsToWizard < ActiveRecord::Migration[7.0]
3
+ def change
4
+ add_column :wizards, :quidditch_position, :integer
5
+ add_column :wizards, :hair_color, :integer
6
+ add_column :wizards, :eye_color, :integer
7
+ add_column :wizards, :hair_length, :integer
8
+ end
9
+ end
@@ -0,0 +1,6 @@
1
+ # typed: true
2
+ class AddTypeToWizard < ActiveRecord::Migration[7.0]
3
+ def change
4
+ add_column :wizards, :type, :string, null: false, default: 'Wizard'
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ # typed: true
2
+ class AddRobeToWizard < ActiveRecord::Migration[7.0]
3
+ def change
4
+ create_table :robes do |t|
5
+ t.references :wizard
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,10 @@
1
+ # typed: true
2
+ class AddSchool < ActiveRecord::Migration[7.0]
3
+ def change
4
+ create_table :schools do |t|
5
+ t.string :name
6
+ end
7
+ add_column :wizards, :school_id, :integer
8
+ add_foreign_key :wizards, :schools
9
+ end
10
+ end
@@ -0,0 +1,8 @@
1
+ # typed: true
2
+ class AddSubject < ActiveRecord::Migration[7.0]
3
+ def change
4
+ create_table :subjects do |t|
5
+ t.string :name
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # typed: true
2
+ class AddSubjectsWizards < ActiveRecord::Migration[7.0]
3
+ def change
4
+ create_join_table :subjects, :wizards, column_options: { null: true } do |t|
5
+ t.index [:subject_id, :wizard_id]
6
+ end
7
+ end
8
+ end