sorbet-rails 0.7.31 → 0.7.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci-master.yml +1 -1
- data/.github/workflows/ci.yml +1 -1
- data/.github/workflows/publish-gem.yml +9 -19
- data/CONTRIBUTING.md +1 -0
- data/Gemfile +4 -0
- data/README.md +14 -3
- data/Rakefile +27 -1
- data/lib/sorbet-rails/active_record_rbi_formatter.rb +4 -4
- data/lib/sorbet-rails/model_plugins/active_record_querying.rb +27 -0
- data/lib/sorbet-rails/model_rbi_formatter.rb +3 -3
- data/lib/sorbet-rails/rails_mixins/active_record_overrides.rb +1 -1
- data/lib/sorbet-rails/rails_mixins/custom_finder_methods.rb +8 -0
- data/lib/sorbet-rails/tasks/rails_rbi.rake +15 -0
- data/sorbet-rails.gemspec +2 -2
- data/spec/bin/run_all_specs.sh +1 -0
- data/spec/custom_finder_methods_spec.rb +23 -0
- data/spec/generators/rails-template.rb +2 -7
- data/spec/rails_helper.rb +2 -0
- data/spec/rake_rails_rbi_models_spec.rb +1 -1
- data/spec/support/v5.2/Gemfile.lock +76 -67
- data/spec/support/v5.2/sorbet_test_cases.rb +8 -0
- data/spec/support/v6.0/Gemfile.lock +93 -85
- data/spec/support/v6.0/sorbet_test_cases.rb +8 -0
- data/spec/support/v6.1/Gemfile +1 -1
- data/spec/support/v6.1/Gemfile.lock +115 -108
- data/spec/support/v6.1/sorbet_test_cases.rb +11 -0
- data/spec/support/v7.0/.gitattributes +7 -0
- data/spec/support/v7.0/.gitignore +35 -0
- data/spec/support/v7.0/Gemfile +48 -0
- data/spec/support/v7.0/Gemfile.lock +218 -0
- data/spec/support/v7.0/README.md +24 -0
- data/spec/support/v7.0/Rakefile +6 -0
- data/spec/support/v7.0/app/assets/images/.keep +0 -0
- data/spec/support/v7.0/app/assets/stylesheets/application.css +1 -0
- data/spec/support/v7.0/app/controllers/application_controller.rb +3 -0
- data/spec/support/v7.0/app/controllers/concerns/.keep +0 -0
- data/spec/support/v7.0/app/helpers/application_helper.rb +3 -0
- data/spec/support/v7.0/app/helpers/bar_helper.rb +3 -0
- data/spec/support/v7.0/app/helpers/baz_helper.rb +3 -0
- data/spec/support/v7.0/app/helpers/foo_helper.rb +3 -0
- data/spec/support/v7.0/app/jobs/application_job.rb +8 -0
- data/spec/support/v7.0/app/jobs/award_house_point_hourglasses.rb +12 -0
- data/spec/support/v7.0/app/mailers/application_mailer.rb +5 -0
- data/spec/support/v7.0/app/mailers/daily_prophet_mailer.rb +9 -0
- data/spec/support/v7.0/app/mailers/hogwarts_acceptance_mailer.rb +29 -0
- data/spec/support/v7.0/app/models/application_record.rb +4 -0
- data/spec/support/v7.0/app/models/concerns/.keep +0 -0
- data/spec/support/v7.0/app/models/concerns/mythical.rb +11 -0
- data/spec/support/v7.0/app/models/headmaster.rb +8 -0
- data/spec/support/v7.0/app/models/potion.rb +6 -0
- data/spec/support/v7.0/app/models/robe.rb +4 -0
- data/spec/support/v7.0/app/models/school.rb +5 -0
- data/spec/support/v7.0/app/models/spell.rb +5 -0
- data/spec/support/v7.0/app/models/spell_book.rb +18 -0
- data/spec/support/v7.0/app/models/squib.rb +6 -0
- data/spec/support/v7.0/app/models/subject.rb +5 -0
- data/spec/support/v7.0/app/models/wand.rb +19 -0
- data/spec/support/v7.0/app/models/wizard.rb +65 -0
- data/spec/support/v7.0/app/views/layouts/application.html.erb +15 -0
- data/spec/support/v7.0/app/views/layouts/mailer.html.erb +13 -0
- data/spec/support/v7.0/app/views/layouts/mailer.text.erb +1 -0
- data/spec/support/v7.0/bin/bundle +114 -0
- data/spec/support/v7.0/bin/rails +4 -0
- data/spec/support/v7.0/bin/rake +4 -0
- data/spec/support/v7.0/bin/setup +33 -0
- data/spec/support/v7.0/config/application.rb +38 -0
- data/spec/support/v7.0/config/boot.rb +4 -0
- data/spec/support/v7.0/config/database.yml +25 -0
- data/spec/support/v7.0/config/environment.rb +6 -0
- data/spec/support/v7.0/config/environments/development.rb +69 -0
- data/spec/support/v7.0/config/environments/production.rb +83 -0
- data/spec/support/v7.0/config/environments/test.rb +61 -0
- data/spec/support/v7.0/config/initializers/content_security_policy.rb +26 -0
- data/spec/support/v7.0/config/initializers/filter_parameter_logging.rb +9 -0
- data/spec/support/v7.0/config/initializers/inflections.rb +17 -0
- data/spec/support/v7.0/config/initializers/permissions_policy.rb +12 -0
- data/spec/support/v7.0/config/initializers/sorbet_rails.rb +3 -0
- data/spec/support/v7.0/config/locales/en.yml +33 -0
- data/spec/support/v7.0/config/puma.rb +44 -0
- data/spec/support/v7.0/config/routes.rb +8 -0
- data/spec/support/v7.0/config/storage.yml +34 -0
- data/spec/support/v7.0/config.ru +6 -0
- data/spec/support/v7.0/db/migrate/20190620000001_create_wizards.rb +14 -0
- data/spec/support/v7.0/db/migrate/20190620000002_create_wands.rb +12 -0
- data/spec/support/v7.0/db/migrate/20190620000003_create_spell_books.rb +10 -0
- data/spec/support/v7.0/db/migrate/20190620000004_add_more_column_types_to_wands.rb +14 -0
- data/spec/support/v7.0/db/migrate/20190620000005_add_broom_to_wizard.rb +6 -0
- data/spec/support/v7.0/db/migrate/20190620000006_add_more_enums_to_wizard.rb +9 -0
- data/spec/support/v7.0/db/migrate/20190620000007_add_type_to_wizard.rb +6 -0
- data/spec/support/v7.0/db/migrate/20190620000008_add_robe_to_wizard.rb +8 -0
- data/spec/support/v7.0/db/migrate/20190620000009_add_school.rb +10 -0
- data/spec/support/v7.0/db/migrate/20190620000010_add_subject.rb +8 -0
- data/spec/support/v7.0/db/migrate/20190620000011_add_subjects_wizards.rb +8 -0
- data/spec/support/v7.0/db/migrate/20190620000012_add_spell.rb +8 -0
- data/spec/support/v7.0/db/migrate/20190620000013_add_spells_spell_books.rb +8 -0
- data/spec/support/v7.0/db/migrate/20190620000014_create_headmasters.rb +9 -0
- data/spec/support/v7.0/db/migrate/20190620000015_add_serialized_to_wizards.rb +9 -0
- data/spec/support/v7.0/db/schema.rb +98 -0
- data/spec/support/v7.0/db/seeds.rb +8 -0
- data/spec/support/v7.0/lib/assets/.keep +0 -0
- data/spec/support/v7.0/lib/mythical_rbi_plugin.rb +16 -0
- data/spec/support/v7.0/lib/tasks/.keep +0 -0
- data/spec/support/v7.0/log/.keep +0 -0
- data/spec/support/v7.0/sorbet_test_cases.rb +439 -0
- data/spec/support/v7.0/storage/.keep +0 -0
- data/spec/support/v7.0/tmp/.keep +0 -0
- data/spec/support/v7.0/tmp/pids/.keep +0 -0
- data/spec/support/v7.0/tmp/storage/.keep +0 -0
- data/spec/support/v7.0/vendor/.keep +0 -0
- data/spec/test_data/v5.2/expected_active_record_base.rbi +6 -0
- data/spec/test_data/v5.2/expected_active_record_relation.rbi +8 -2
- data/spec/test_data/v5.2/expected_attachment.rbi +3 -3
- data/spec/test_data/v5.2/expected_blob.rbi +3 -3
- data/spec/test_data/v5.2/expected_habtm_subjects.rbi +3 -3
- data/spec/test_data/v5.2/expected_habtm_wizards.rbi +3 -3
- data/spec/test_data/v5.2/expected_headmaster.rbi +3 -3
- data/spec/test_data/v5.2/expected_internal_metadata.rbi +3 -3
- data/spec/test_data/v5.2/expected_potion.rbi +3 -3
- data/spec/test_data/v5.2/expected_robe.rbi +3 -3
- data/spec/test_data/v5.2/expected_schema_migration.rbi +3 -3
- data/spec/test_data/v5.2/expected_school.rbi +3 -3
- data/spec/test_data/v5.2/expected_spell/habtm_spell_books.rbi +3 -3
- data/spec/test_data/v5.2/expected_spell.rbi +3 -3
- data/spec/test_data/v5.2/expected_spell_book/habtm_spell_books.rbi +3 -3
- data/spec/test_data/v5.2/expected_spell_book/habtm_spells.rbi +3 -3
- data/spec/test_data/v5.2/expected_spell_book.rbi +3 -3
- data/spec/test_data/v5.2/expected_squib.rbi +3 -3
- data/spec/test_data/v5.2/expected_subject/habtm_wizards.rbi +3 -3
- data/spec/test_data/v5.2/expected_subject.rbi +3 -3
- data/spec/test_data/v5.2/expected_wand.rbi +3 -3
- data/spec/test_data/v5.2/expected_wizard/habtm_subjects.rbi +3 -3
- data/spec/test_data/v5.2/expected_wizard.rbi +3 -3
- data/spec/test_data/v5.2/expected_wizard_wo_spellbook.rbi +3 -3
- data/spec/test_data/v6.0/expected_active_record_base.rbi +6 -0
- data/spec/test_data/v6.0/expected_active_record_relation.rbi +8 -2
- data/spec/test_data/v6.0/expected_attachment.rbi +3 -3
- data/spec/test_data/v6.0/expected_blob.rbi +3 -3
- data/spec/test_data/v6.0/expected_habtm_subjects.rbi +3 -3
- data/spec/test_data/v6.0/expected_habtm_wizards.rbi +3 -3
- data/spec/test_data/v6.0/expected_headmaster.rbi +3 -3
- data/spec/test_data/v6.0/expected_internal_metadata.rbi +3 -3
- data/spec/test_data/v6.0/expected_potion.rbi +3 -3
- data/spec/test_data/v6.0/expected_robe.rbi +3 -3
- data/spec/test_data/v6.0/expected_schema_migration.rbi +3 -3
- data/spec/test_data/v6.0/expected_school.rbi +3 -3
- data/spec/test_data/v6.0/expected_spell/habtm_spell_books.rbi +3 -3
- data/spec/test_data/v6.0/expected_spell.rbi +3 -3
- data/spec/test_data/v6.0/expected_spell_book/habtm_spell_books.rbi +3 -3
- data/spec/test_data/v6.0/expected_spell_book/habtm_spells.rbi +3 -3
- data/spec/test_data/v6.0/expected_spell_book.rbi +3 -3
- data/spec/test_data/v6.0/expected_squib.rbi +3 -3
- data/spec/test_data/v6.0/expected_subject/habtm_wizards.rbi +3 -3
- data/spec/test_data/v6.0/expected_subject.rbi +3 -3
- data/spec/test_data/v6.0/expected_wand.rbi +3 -3
- data/spec/test_data/v6.0/expected_wizard/habtm_subjects.rbi +3 -3
- data/spec/test_data/v6.0/expected_wizard.rbi +3 -3
- data/spec/test_data/v6.0/expected_wizard_wo_spellbook.rbi +3 -3
- data/spec/test_data/v6.1/expected_active_record_base.rbi +6 -0
- data/spec/test_data/v6.1/expected_active_record_relation.rbi +8 -2
- data/spec/test_data/v6.1/expected_attachment.rbi +9 -3
- data/spec/test_data/v6.1/expected_blob.rbi +9 -3
- data/spec/test_data/v6.1/expected_habtm_subjects.rbi +3 -3
- data/spec/test_data/v6.1/expected_habtm_wizards.rbi +3 -3
- data/spec/test_data/v6.1/expected_headmaster.rbi +9 -3
- data/spec/test_data/v6.1/expected_internal_metadata.rbi +9 -3
- data/spec/test_data/v6.1/expected_potion.rbi +9 -3
- data/spec/test_data/v6.1/expected_record.rbi +9 -3
- data/spec/test_data/v6.1/expected_robe.rbi +9 -3
- data/spec/test_data/v6.1/expected_schema_migration.rbi +9 -3
- data/spec/test_data/v6.1/expected_school.rbi +9 -3
- data/spec/test_data/v6.1/expected_spell/habtm_spell_books.rbi +9 -3
- data/spec/test_data/v6.1/expected_spell.rbi +9 -3
- data/spec/test_data/v6.1/expected_spell_book/habtm_spell_books.rbi +3 -3
- data/spec/test_data/v6.1/expected_spell_book/habtm_spells.rbi +9 -3
- data/spec/test_data/v6.1/expected_spell_book.rbi +9 -3
- data/spec/test_data/v6.1/expected_squib.rbi +9 -3
- data/spec/test_data/v6.1/expected_subject/habtm_wizards.rbi +9 -3
- data/spec/test_data/v6.1/expected_subject.rbi +9 -3
- data/spec/test_data/v6.1/expected_variant_record.rbi +9 -3
- data/spec/test_data/v6.1/expected_wand.rbi +9 -3
- data/spec/test_data/v6.1/expected_wizard/habtm_subjects.rbi +9 -3
- data/spec/test_data/v6.1/expected_wizard.rbi +9 -3
- data/spec/test_data/v6.1/expected_wizard_wo_spellbook.rbi +9 -3
- data/spec/test_data/v7.0/expected_active_record_base.rbi +119 -0
- data/spec/test_data/v7.0/expected_active_record_relation.rbi +180 -0
- data/spec/test_data/v7.0/expected_application_job.rbi +20 -0
- data/spec/test_data/v7.0/expected_application_mailer.rbi +5 -0
- data/spec/test_data/v7.0/expected_attachment.rbi +358 -0
- data/spec/test_data/v7.0/expected_award_house_point_hourglasses.rbi +20 -0
- data/spec/test_data/v7.0/expected_blob.rbi +394 -0
- data/spec/test_data/v7.0/expected_custom_application_job.rbi +21 -0
- data/spec/test_data/v7.0/expected_custom_application_mailer.rbi +6 -0
- data/spec/test_data/v7.0/expected_custom_award_house_point_hourglasses.rbi +21 -0
- data/spec/test_data/v7.0/expected_custom_daily_prophet_mailer.rbi +8 -0
- data/spec/test_data/v7.0/expected_custom_hogwarts_acceptance_mailer.rbi +21 -0
- data/spec/test_data/v7.0/expected_daily_prophet_mailer.rbi +7 -0
- data/spec/test_data/v7.0/expected_headmaster.rbi +376 -0
- data/spec/test_data/v7.0/expected_helpers.rbi +27 -0
- data/spec/test_data/v7.0/expected_helpers_with_application_and_devise_helpers.rbi +34 -0
- data/spec/test_data/v7.0/expected_hogwarts_acceptance_mailer.rbi +20 -0
- data/spec/test_data/v7.0/expected_internal_metadata.rbi +346 -0
- data/spec/test_data/v7.0/expected_no_routes.rbi +4 -0
- data/spec/test_data/v7.0/expected_potion.rbi +328 -0
- data/spec/test_data/v7.0/expected_record.rbi +307 -0
- data/spec/test_data/v7.0/expected_robe.rbi +349 -0
- data/spec/test_data/v7.0/expected_routes.rbi +182 -0
- data/spec/test_data/v7.0/expected_schema_migration.rbi +319 -0
- data/spec/test_data/v7.0/expected_school.rbi +349 -0
- data/spec/test_data/v7.0/expected_spell/habtm_spell_books.rbi +367 -0
- data/spec/test_data/v7.0/expected_spell.rbi +340 -0
- data/spec/test_data/v7.0/expected_spell_book/habtm_spells.rbi +367 -0
- data/spec/test_data/v7.0/expected_spell_book.rbi +499 -0
- data/spec/test_data/v7.0/expected_squib.rbi +1204 -0
- data/spec/test_data/v7.0/expected_srb_tc_output.txt +1 -0
- data/spec/test_data/v7.0/expected_subject/habtm_wizards.rbi +367 -0
- data/spec/test_data/v7.0/expected_subject.rbi +340 -0
- data/spec/test_data/v7.0/expected_variant_record.rbi +382 -0
- data/spec/test_data/v7.0/expected_wand.rbi +611 -0
- data/spec/test_data/v7.0/expected_wizard/habtm_subjects.rbi +367 -0
- data/spec/test_data/v7.0/expected_wizard.rbi +1280 -0
- data/spec/test_data/v7.0/expected_wizard_wo_spellbook.rbi +1274 -0
- metadata +245 -3
@@ -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,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,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,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,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,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,9 @@
|
|
1
|
+
# typed: true
|
2
|
+
class AddSerializedToWizards < ActiveRecord::Migration[7.0]
|
3
|
+
def change
|
4
|
+
add_column :wizards, :owl_results, :text # Hash
|
5
|
+
add_column :wizards, :newt_subjects, :text # generic
|
6
|
+
add_column :wizards, :pets, :text # Array
|
7
|
+
add_column :wizards, :patronus_characteristics, :text # serialized as JSON, but not a JSON column type
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# typed: false
|
2
|
+
# This file is auto-generated from the current state of the database. Instead
|
3
|
+
# of editing this file, please use the migrations feature of Active Record to
|
4
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
+
#
|
6
|
+
# This file is the source Rails uses to define your schema when running `bin/rails
|
7
|
+
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
|
8
|
+
# be faster and is potentially less error prone than running all of your
|
9
|
+
# migrations from scratch. Old migrations may fail to apply correctly if those
|
10
|
+
# migrations use external dependencies or application code.
|
11
|
+
#
|
12
|
+
# It's strongly recommended that you check this file into your version control system.
|
13
|
+
|
14
|
+
ActiveRecord::Schema[7.0].define(version: 2019_06_20_000015) do
|
15
|
+
create_table "headmasters", force: :cascade do |t|
|
16
|
+
t.integer "school_id"
|
17
|
+
t.integer "wizard_id"
|
18
|
+
t.index ["school_id"], name: "index_headmasters_on_school_id"
|
19
|
+
t.index ["wizard_id"], name: "index_headmasters_on_wizard_id"
|
20
|
+
end
|
21
|
+
|
22
|
+
create_table "robes", force: :cascade do |t|
|
23
|
+
t.integer "wizard_id"
|
24
|
+
t.index ["wizard_id"], name: "index_robes_on_wizard_id"
|
25
|
+
end
|
26
|
+
|
27
|
+
create_table "schools", force: :cascade do |t|
|
28
|
+
t.string "name"
|
29
|
+
end
|
30
|
+
|
31
|
+
create_table "spell_books", force: :cascade do |t|
|
32
|
+
t.string "name"
|
33
|
+
t.integer "wizard_id", null: false
|
34
|
+
t.integer "book_type", default: 0, null: false
|
35
|
+
t.index ["wizard_id"], name: "index_spell_books_on_wizard_id"
|
36
|
+
end
|
37
|
+
|
38
|
+
create_table "spell_books_spells", id: false, force: :cascade do |t|
|
39
|
+
t.integer "spell_id", null: false
|
40
|
+
t.integer "spell_book_id", null: false
|
41
|
+
t.index ["spell_id", "spell_book_id"], name: "index_spell_books_spells_on_spell_id_and_spell_book_id"
|
42
|
+
end
|
43
|
+
|
44
|
+
create_table "spells", force: :cascade do |t|
|
45
|
+
t.string "name"
|
46
|
+
end
|
47
|
+
|
48
|
+
create_table "subjects", force: :cascade do |t|
|
49
|
+
t.string "name"
|
50
|
+
end
|
51
|
+
|
52
|
+
create_table "subjects_wizards", id: false, force: :cascade do |t|
|
53
|
+
t.integer "subject_id"
|
54
|
+
t.integer "wizard_id"
|
55
|
+
t.index ["subject_id", "wizard_id"], name: "index_subjects_wizards_on_subject_id_and_wizard_id"
|
56
|
+
end
|
57
|
+
|
58
|
+
create_table "wands", force: :cascade do |t|
|
59
|
+
t.integer "wizard_id", null: false
|
60
|
+
t.string "wood_type"
|
61
|
+
t.integer "core_type"
|
62
|
+
t.datetime "created_at", null: false
|
63
|
+
t.datetime "updated_at", null: false
|
64
|
+
t.float "flexibility", default: 0.5, null: false
|
65
|
+
t.decimal "hardness", precision: 10, scale: 10, default: "5.0", null: false
|
66
|
+
t.decimal "reflectance", precision: 10, default: "0", null: false
|
67
|
+
t.boolean "broken", default: false, null: false
|
68
|
+
t.datetime "broken_at"
|
69
|
+
t.date "chosen_at_date"
|
70
|
+
t.time "chosen_at_time"
|
71
|
+
t.json "spell_history"
|
72
|
+
t.json "maker_info", default: "{}", null: false
|
73
|
+
t.index ["wizard_id"], name: "index_wands_on_wizard_id"
|
74
|
+
end
|
75
|
+
|
76
|
+
create_table "wizards", force: :cascade do |t|
|
77
|
+
t.string "name"
|
78
|
+
t.integer "house"
|
79
|
+
t.integer "professor"
|
80
|
+
t.string "parent_email"
|
81
|
+
t.text "notes"
|
82
|
+
t.datetime "created_at", null: false
|
83
|
+
t.datetime "updated_at", null: false
|
84
|
+
t.string "broom"
|
85
|
+
t.integer "quidditch_position"
|
86
|
+
t.integer "hair_color"
|
87
|
+
t.integer "eye_color"
|
88
|
+
t.integer "hair_length"
|
89
|
+
t.string "type", default: "Wizard", null: false
|
90
|
+
t.integer "school_id"
|
91
|
+
t.text "owl_results"
|
92
|
+
t.text "newt_subjects"
|
93
|
+
t.text "pets"
|
94
|
+
t.text "patronus_characteristics"
|
95
|
+
end
|
96
|
+
|
97
|
+
add_foreign_key "wizards", "schools"
|
98
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# typed: strict
|
2
|
+
# This file should contain all the record creation needed to seed the database with its default values.
|
3
|
+
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
|
4
|
+
#
|
5
|
+
# Examples:
|
6
|
+
#
|
7
|
+
# movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }])
|
8
|
+
# Character.create(name: "Luke", movie: movies.first)
|
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# typed: true
|
2
|
+
class MythicalRbiPlugin < SorbetRails::ModelPlugins::Base
|
3
|
+
def generate(root)
|
4
|
+
return unless @model_class.include?(Mythical)
|
5
|
+
|
6
|
+
model_class_rbi = root.create_class(self.model_class_name)
|
7
|
+
|
8
|
+
# ActiveSupport::Concern class method will be inserted to the class
|
9
|
+
# directly. We need to also put the sig in the model class rbi directly
|
10
|
+
model_class_rbi.create_method(
|
11
|
+
'mythicals',
|
12
|
+
class_method: true,
|
13
|
+
return_type: "T::Array[#{model_class_name}]",
|
14
|
+
)
|
15
|
+
end
|
16
|
+
end
|
File without changes
|
File without changes
|