sorbet-rails 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.travis.yml +0 -2
  4. data/CONTRIBUTING.md +2 -4
  5. data/Gemfile +0 -4
  6. data/README.md +41 -7
  7. data/Rakefile +3 -14
  8. data/lib/bundled_rbi/parameters.rbi +4 -26
  9. data/lib/bundled_rbi/pluck_to_tstruct.rbi +22 -0
  10. data/lib/bundled_rbi/type_assert.rbi +27 -0
  11. data/lib/sorbet-rails/gem_plugins/elastic_search_plugin.rb +40 -0
  12. data/lib/sorbet-rails/gem_plugins/shrine_plugin.rb +76 -0
  13. data/lib/sorbet-rails/model_plugins/active_record_assoc.rb +2 -11
  14. data/lib/sorbet-rails/model_plugins/active_record_attribute.rb +3 -6
  15. data/lib/sorbet-rails/model_plugins/active_record_querying.rb +10 -2
  16. data/lib/sorbet-rails/model_plugins/plugins.rb +6 -0
  17. data/lib/sorbet-rails/rails_mixins/pluck_to_tstruct.rb +33 -0
  18. data/lib/sorbet-rails/railtie.rb +4 -0
  19. data/lib/sorbet-rails/sorbet_utils.rb +4 -1
  20. data/lib/sorbet-rails/tasks/rails_rbi.rake +16 -6
  21. data/sorbet-rails.gemspec +1 -1
  22. data/spec/bin/run_all_specs.sh +0 -1
  23. data/spec/bin/run_spec.sh +4 -6
  24. data/spec/generators/rails-template.rb +67 -124
  25. data/spec/generators/sorbet_test_cases.rb +26 -16
  26. data/spec/pluck_to_tstruct_spec.rb +79 -0
  27. data/spec/rails_helper.rb +0 -2
  28. data/spec/rake_rails_rbi_models_spec.rb +2 -0
  29. data/spec/sorbet_utils_spec.rb +37 -0
  30. data/spec/spec_helper.rb +1 -2
  31. data/spec/support/v5.0/Gemfile.lock +6 -6
  32. data/spec/support/v5.0/config/boot.rb +1 -1
  33. data/spec/support/v5.0/config/initializers/sorbet_rails.rb +1 -1
  34. data/spec/support/v5.0/db/migrate/20190620000004_add_more_column_types_to_wands.rb +1 -1
  35. data/spec/support/v5.0/sorbet_test_cases.rb +26 -16
  36. data/spec/support/v5.1/Gemfile.lock +6 -6
  37. data/spec/support/v5.1/config/boot.rb +1 -1
  38. data/spec/support/v5.1/config/initializers/sorbet_rails.rb +1 -1
  39. data/spec/support/v5.1/db/migrate/20190620000004_add_more_column_types_to_wands.rb +1 -1
  40. data/spec/support/v5.1/sorbet_test_cases.rb +26 -16
  41. data/spec/support/v5.2/Gemfile.lock +6 -6
  42. data/spec/support/v5.2/config/boot.rb +1 -1
  43. data/spec/support/v5.2/config/initializers/sorbet_rails.rb +1 -1
  44. data/spec/support/v5.2/db/migrate/20190620000004_add_more_column_types_to_wands.rb +1 -1
  45. data/spec/support/v5.2/sorbet_test_cases.rb +26 -16
  46. data/spec/support/v6.0/Gemfile.lock +6 -6
  47. data/spec/support/v6.0/config/boot.rb +1 -1
  48. data/spec/support/v6.0/config/initializers/sorbet_rails.rb +1 -1
  49. data/spec/support/v6.0/config/initializers/wrap_parameters.rb +1 -1
  50. data/spec/support/v6.0/db/migrate/20190620000004_add_more_column_types_to_wands.rb +1 -1
  51. data/spec/support/v6.0/sorbet_test_cases.rb +26 -16
  52. data/spec/test_data/v5.0/expected_internal_metadata.rbi +209 -197
  53. data/spec/test_data/v5.0/expected_potion.rbi +208 -196
  54. data/spec/test_data/v5.0/expected_schema_migration.rbi +209 -197
  55. data/spec/test_data/v5.0/expected_spell_book.rbi +208 -196
  56. data/spec/test_data/v5.0/expected_squib.rbi +209 -197
  57. data/spec/test_data/v5.0/expected_wand.rbi +208 -196
  58. data/spec/test_data/v5.0/expected_wizard.rbi +209 -197
  59. data/spec/test_data/v5.0/expected_wizard_wo_spellbook.rbi +209 -197
  60. data/spec/test_data/v5.1/expected_internal_metadata.rbi +213 -213
  61. data/spec/test_data/v5.1/expected_potion.rbi +212 -212
  62. data/spec/test_data/v5.1/expected_schema_migration.rbi +213 -213
  63. data/spec/test_data/v5.1/expected_spell_book.rbi +212 -212
  64. data/spec/test_data/v5.1/expected_squib.rbi +213 -213
  65. data/spec/test_data/v5.1/expected_wand.rbi +212 -212
  66. data/spec/test_data/v5.1/expected_wizard.rbi +213 -213
  67. data/spec/test_data/v5.1/expected_wizard_wo_spellbook.rbi +213 -213
  68. data/spec/test_data/v5.2/expected_attachment.rbi +212 -212
  69. data/spec/test_data/v5.2/expected_blob.rbi +212 -212
  70. data/spec/test_data/v5.2/expected_internal_metadata.rbi +213 -213
  71. data/spec/test_data/v5.2/expected_potion.rbi +212 -212
  72. data/spec/test_data/v5.2/expected_schema_migration.rbi +213 -213
  73. data/spec/test_data/v5.2/expected_spell_book.rbi +212 -212
  74. data/spec/test_data/v5.2/expected_squib.rbi +213 -213
  75. data/spec/test_data/v5.2/expected_wand.rbi +212 -212
  76. data/spec/test_data/v5.2/expected_wizard.rbi +213 -213
  77. data/spec/test_data/v5.2/expected_wizard_wo_spellbook.rbi +213 -213
  78. data/spec/test_data/v6.0/expected_attachment.rbi +244 -244
  79. data/spec/test_data/v6.0/expected_blob.rbi +244 -244
  80. data/spec/test_data/v6.0/expected_internal_metadata.rbi +245 -245
  81. data/spec/test_data/v6.0/expected_potion.rbi +244 -244
  82. data/spec/test_data/v6.0/expected_schema_migration.rbi +245 -245
  83. data/spec/test_data/v6.0/expected_spell_book.rbi +244 -244
  84. data/spec/test_data/v6.0/expected_squib.rbi +245 -245
  85. data/spec/test_data/v6.0/expected_wand.rbi +244 -244
  86. data/spec/test_data/v6.0/expected_wizard.rbi +245 -245
  87. data/spec/test_data/v6.0/expected_wizard_wo_spellbook.rbi +245 -245
  88. metadata +8 -185
  89. data/spec/bin/install.sh +0 -11
  90. data/spec/support/v4.2/.gitignore +0 -17
  91. data/spec/support/v4.2/Gemfile +0 -33
  92. data/spec/support/v4.2/Gemfile.lock +0 -128
  93. data/spec/support/v4.2/README.rdoc +0 -28
  94. data/spec/support/v4.2/Rakefile +0 -6
  95. data/spec/support/v4.2/app/assets/images/.keep +0 -0
  96. data/spec/support/v4.2/app/assets/stylesheets/application.css +0 -15
  97. data/spec/support/v4.2/app/controllers/application_controller.rb +0 -6
  98. data/spec/support/v4.2/app/controllers/concerns/.keep +0 -0
  99. data/spec/support/v4.2/app/helpers/application_helper.rb +0 -3
  100. data/spec/support/v4.2/app/helpers/bar_helper.rb +0 -3
  101. data/spec/support/v4.2/app/helpers/baz_helper.rb +0 -3
  102. data/spec/support/v4.2/app/helpers/foo_helper.rb +0 -3
  103. data/spec/support/v4.2/app/mailers/.keep +0 -0
  104. data/spec/support/v4.2/app/mailers/application_mailer.rb +0 -3
  105. data/spec/support/v4.2/app/mailers/daily_prophet_mailer.rb +0 -9
  106. data/spec/support/v4.2/app/mailers/hogwarts_acceptance_mailer.rb +0 -13
  107. data/spec/support/v4.2/app/models/.keep +0 -0
  108. data/spec/support/v4.2/app/models/application_record.rb +0 -4
  109. data/spec/support/v4.2/app/models/concerns/.keep +0 -0
  110. data/spec/support/v4.2/app/models/concerns/mythical.rb +0 -11
  111. data/spec/support/v4.2/app/models/potion.rb +0 -5
  112. data/spec/support/v4.2/app/models/spell_book.rb +0 -11
  113. data/spec/support/v4.2/app/models/squib.rb +0 -6
  114. data/spec/support/v4.2/app/models/wand.rb +0 -19
  115. data/spec/support/v4.2/app/models/wizard.rb +0 -29
  116. data/spec/support/v4.2/app/views/layouts/application.html.erb +0 -13
  117. data/spec/support/v4.2/bin/bundle +0 -3
  118. data/spec/support/v4.2/bin/rails +0 -4
  119. data/spec/support/v4.2/bin/rake +0 -4
  120. data/spec/support/v4.2/bin/setup +0 -29
  121. data/spec/support/v4.2/config.ru +0 -4
  122. data/spec/support/v4.2/config/application.rb +0 -36
  123. data/spec/support/v4.2/config/boot.rb +0 -4
  124. data/spec/support/v4.2/config/database.yml +0 -25
  125. data/spec/support/v4.2/config/environment.rb +0 -6
  126. data/spec/support/v4.2/config/environments/development.rb +0 -29
  127. data/spec/support/v4.2/config/environments/production.rb +0 -68
  128. data/spec/support/v4.2/config/environments/test.rb +0 -43
  129. data/spec/support/v4.2/config/initializers/backtrace_silencers.rb +0 -8
  130. data/spec/support/v4.2/config/initializers/cookies_serializer.rb +0 -4
  131. data/spec/support/v4.2/config/initializers/filter_parameter_logging.rb +0 -5
  132. data/spec/support/v4.2/config/initializers/inflections.rb +0 -17
  133. data/spec/support/v4.2/config/initializers/mime_types.rb +0 -5
  134. data/spec/support/v4.2/config/initializers/session_store.rb +0 -4
  135. data/spec/support/v4.2/config/initializers/sorbet_rails.rb +0 -3
  136. data/spec/support/v4.2/config/initializers/to_time_preserves_timezone.rb +0 -11
  137. data/spec/support/v4.2/config/initializers/wrap_parameters.rb +0 -15
  138. data/spec/support/v4.2/config/locales/en.yml +0 -23
  139. data/spec/support/v4.2/config/routes.rb +0 -58
  140. data/spec/support/v4.2/db/migrate/20190620000001_create_wizards.rb +0 -13
  141. data/spec/support/v4.2/db/migrate/20190620000002_create_wands.rb +0 -12
  142. data/spec/support/v4.2/db/migrate/20190620000003_create_spell_books.rb +0 -10
  143. data/spec/support/v4.2/db/migrate/20190620000004_add_more_column_types_to_wands.rb +0 -17
  144. data/spec/support/v4.2/db/migrate/20190620000005_add_broom_to_wizard.rb +0 -6
  145. data/spec/support/v4.2/db/migrate/20190620000007_add_type_to_wizard.rb +0 -6
  146. data/spec/support/v4.2/db/schema.rb +0 -49
  147. data/spec/support/v4.2/db/seeds.rb +0 -8
  148. data/spec/support/v4.2/lib/assets/.keep +0 -0
  149. data/spec/support/v4.2/lib/mythical_rbi_plugin.rb +0 -16
  150. data/spec/support/v4.2/lib/tasks/.keep +0 -0
  151. data/spec/support/v4.2/log/.keep +0 -0
  152. data/spec/support/v4.2/sorbet_test_cases.rb +0 -238
  153. data/spec/support/v4.2/test/controllers/.keep +0 -0
  154. data/spec/support/v4.2/test/fixtures/.keep +0 -0
  155. data/spec/support/v4.2/test/helpers/.keep +0 -0
  156. data/spec/support/v4.2/test/integration/.keep +0 -0
  157. data/spec/support/v4.2/test/mailers/.keep +0 -0
  158. data/spec/support/v4.2/test/models/.keep +0 -0
  159. data/spec/support/v4.2/test/test_helper.rb +0 -11
  160. data/spec/support/v4.2/typed-override.yaml +0 -2
  161. data/spec/support/v4.2/vendor/assets/stylesheets/.keep +0 -0
  162. data/spec/test_data/v4.2/expected_application_mailer.rbi +0 -5
  163. data/spec/test_data/v4.2/expected_daily_prophet_mailer.rbi +0 -7
  164. data/spec/test_data/v4.2/expected_helpers.rbi +0 -22
  165. data/spec/test_data/v4.2/expected_helpers_with_application_and_devise_helpers.rbi +0 -29
  166. data/spec/test_data/v4.2/expected_hogwarts_acceptance_mailer.rbi +0 -10
  167. data/spec/test_data/v4.2/expected_no_routes.rbi +0 -4
  168. data/spec/test_data/v4.2/expected_potion.rbi +0 -657
  169. data/spec/test_data/v4.2/expected_routes.rbi +0 -19
  170. data/spec/test_data/v4.2/expected_spell_book.rbi +0 -771
  171. data/spec/test_data/v4.2/expected_squib.rbi +0 -912
  172. data/spec/test_data/v4.2/expected_srb_tc_output.txt +0 -65
  173. data/spec/test_data/v4.2/expected_wand.rbi +0 -873
  174. data/spec/test_data/v4.2/expected_wizard.rbi +0 -912
  175. data/spec/test_data/v4.2/expected_wizard_wo_spellbook.rbi +0 -912
@@ -1,28 +0,0 @@
1
- == README
2
-
3
- This README would normally document whatever steps are necessary to get the
4
- application up and running.
5
-
6
- Things you may want to cover:
7
-
8
- * Ruby version
9
-
10
- * System dependencies
11
-
12
- * Configuration
13
-
14
- * Database creation
15
-
16
- * Database initialization
17
-
18
- * How to run the test suite
19
-
20
- * Services (job queues, cache servers, search engines, etc.)
21
-
22
- * Deployment instructions
23
-
24
- * ...
25
-
26
-
27
- Please feel free to use a different markup language if you do not plan to run
28
- <tt>rake doc:app</tt>.
@@ -1,6 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require File.expand_path('../config/application', __FILE__)
5
-
6
- Rails.application.load_tasks
File without changes
@@ -1,15 +0,0 @@
1
- /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
- * compiled file so the styles you add here take precedence over styles defined in any styles
10
- * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
- * file per style scope.
12
- *
13
- *= require_tree .
14
- *= require_self
15
- */
@@ -1,6 +0,0 @@
1
- # typed: strong
2
- class ApplicationController < ActionController::Base
3
- # Prevent CSRF attacks by raising an exception.
4
- # For APIs, you may want to use :null_session instead.
5
- protect_from_forgery with: :exception
6
- end
@@ -1,3 +0,0 @@
1
- # typed: strong
2
- module ApplicationHelper
3
- end
@@ -1,3 +0,0 @@
1
- # typed: strong
2
- module BarHelper
3
- end
@@ -1,3 +0,0 @@
1
- # typed: strong
2
- module BazHelper
3
- end
@@ -1,3 +0,0 @@
1
- # typed: strong
2
- module FooHelper
3
- end
File without changes
@@ -1,3 +0,0 @@
1
- # typed: strong
2
- class ApplicationMailer < ActionMailer::Base
3
- end
@@ -1,9 +0,0 @@
1
- # typed: strong
2
- class DailyProphetMailer < ApplicationMailer
3
- extend T::Sig
4
-
5
- sig { params(wizards: T::Array[Wizard], hotnews_only: T::Boolean).void }
6
- def notify_subscribers(wizards:, hotnews_only:)
7
- # TODO: mail the latest news to wizards!
8
- end
9
- end
@@ -1,13 +0,0 @@
1
- # typed: true
2
- class HogwartsAcceptanceMailer < ApplicationMailer
3
- extend T::Sig
4
-
5
- sig { params(student: Wizard).void }
6
- def notify(student)
7
- # TODO: mail acceptance letter to student
8
- end
9
-
10
- def notify_retry(student)
11
- # TODO: send more owls!!
12
- end
13
- end
File without changes
@@ -1,4 +0,0 @@
1
- # typed: strong
2
- class ApplicationRecord < ActiveRecord::Base
3
- self.abstract_class = true
4
- end
@@ -1,11 +0,0 @@
1
- # typed: false
2
- require 'active_support/concern'
3
- module Mythical
4
- extend ActiveSupport::Concern
5
-
6
- class_methods do
7
- def mythicals
8
- all.to_a # yeah!
9
- end
10
- end
11
- end
@@ -1,5 +0,0 @@
1
- # typed: strong
2
- # an abstract class that has no table
3
- class Potion < ApplicationRecord
4
- self.abstract_class = true
5
- end
@@ -1,11 +0,0 @@
1
- # typed: strict
2
- class SpellBook < ApplicationRecord
3
- validates :name, length: { minimum: 5 }, presence: true
4
- belongs_to :wizard
5
-
6
- enum book_type: {
7
- unclassified: 0,
8
- biology: 1,
9
- dark_art: 999,
10
- }
11
- end
@@ -1,6 +0,0 @@
1
- # typed: true
2
- class Squib < Wizard
3
- def is_magical
4
- false
5
- end
6
- end
@@ -1,19 +0,0 @@
1
- # typed: true
2
- class Wand < ApplicationRecord
3
- include Mythical
4
-
5
- self.skip_time_zone_conversion_for_attributes = [:broken_at]
6
-
7
- enum core_type: {
8
- phoenix_feather: 0,
9
- dragon_heartstring: 1,
10
- unicorn_tail_hair: 2,
11
- basilisk_horn: 3,
12
- }
13
-
14
- belongs_to :wizard
15
-
16
- def wood_type
17
- 'Type ' + super
18
- end
19
- end
@@ -1,29 +0,0 @@
1
- # typed: strict
2
- class Wizard < ApplicationRecord
3
- validates :name, length: { minimum: 5 }, presence: true
4
-
5
- enum house: {
6
- Gryffindor: 0,
7
- Hufflepuff: 1,
8
- Ravenclaw: 2,
9
- Slytherin: 3,
10
- }
11
-
12
- enum professor: {
13
- "Severus Snape": 0,
14
- "Minerva McGonagall": 1,
15
- "Pomona Sprout": 2,
16
- "Filius Flitwick": 3,
17
- "Hagrid": 4,
18
- }
19
-
20
- enum broom: {
21
- nimbus: 'nimbus',
22
- firebolt: 'firebolt',
23
- }
24
-
25
- has_one :wand
26
- has_many :spell_books
27
-
28
- scope :recent, -> { where('created_at > ?', 1.month.ago) }
29
- end
@@ -1,13 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>V42</title>
5
- <%= stylesheet_link_tag 'application', media: 'all' %>
6
- <%= csrf_meta_tags %>
7
- </head>
8
- <body>
9
-
10
- <%= yield %>
11
-
12
- </body>
13
- </html>
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
- load Gem.bin_path('bundler', 'bundle')
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path('../../config/application', __FILE__)
3
- require_relative '../config/boot'
4
- require 'rails/commands'
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require_relative '../config/boot'
3
- require 'rake'
4
- Rake.application.run
@@ -1,29 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'pathname'
3
-
4
- # path to your application root.
5
- APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
-
7
- Dir.chdir APP_ROOT do
8
- # This script is a starting point to setup your application.
9
- # Add necessary setup steps to this file:
10
-
11
- puts "== Installing dependencies =="
12
- system "gem install bundler --conservative"
13
- system "bundle check || bundle install"
14
-
15
- # puts "\n== Copying sample files =="
16
- # unless File.exist?("config/database.yml")
17
- # system "cp config/database.yml.sample config/database.yml"
18
- # end
19
-
20
- puts "\n== Preparing database =="
21
- system "bin/rake db:setup"
22
-
23
- puts "\n== Removing old logs and tempfiles =="
24
- system "rm -f log/*"
25
- system "rm -rf tmp/cache"
26
-
27
- puts "\n== Restarting application server =="
28
- system "touch tmp/restart.txt"
29
- end
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Rails.application
@@ -1,36 +0,0 @@
1
- # typed: strict
2
- require File.expand_path('../boot', __FILE__)
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 "action_controller/railtie"
10
- require "action_mailer/railtie"
11
- require "action_view/railtie"
12
- # require "sprockets/railtie"
13
- require "rails/test_unit/railtie"
14
-
15
- # Require the gems listed in Gemfile, including any gems
16
- # you've limited to :test, :development, or :production.
17
- Bundler.require(*Rails.groups)
18
-
19
- module V42
20
- class Application < Rails::Application
21
- # Settings in config/environments/* take precedence over those specified here.
22
- # Application configuration should go into files in config/initializers
23
- # -- all .rb files in that directory are automatically loaded.
24
-
25
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
26
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
27
- # config.time_zone = 'Central Time (US & Canada)'
28
-
29
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
30
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
31
- # config.i18n.default_locale = :de
32
-
33
- # Do not swallow errors in after_commit/after_rollback callbacks.
34
- config.active_record.raise_in_transactional_callbacks = true
35
- end
36
- end
@@ -1,4 +0,0 @@
1
- # typed: strong
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
-
4
- require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -1,25 +0,0 @@
1
- # SQLite version 3.x
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: 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
@@ -1,6 +0,0 @@
1
- # typed: strict
2
- # Load the Rails application.
3
- require File.expand_path('../application', __FILE__)
4
-
5
- # Initialize the Rails application.
6
- Rails.application.initialize!
@@ -1,29 +0,0 @@
1
- # typed: strict
2
- Rails.application.configure do
3
- # Settings specified here will take precedence over those in config/application.rb.
4
-
5
- # In the development environment your application's code is reloaded on
6
- # every request. This slows down response time but is perfect for development
7
- # since you don't have to restart the web server when you make code changes.
8
- config.cache_classes = false
9
-
10
- # Do not eager load code on boot.
11
- config.eager_load = false
12
-
13
- # Show full error reports and disable caching.
14
- config.consider_all_requests_local = true
15
- config.action_controller.perform_caching = false
16
-
17
- # Don't care if the mailer can't send.
18
- config.action_mailer.raise_delivery_errors = false
19
-
20
- # Print deprecation notices to the Rails logger.
21
- config.active_support.deprecation = :log
22
-
23
- # Raise an error on page load if there are pending migrations.
24
- config.active_record.migration_error = :page_load
25
-
26
-
27
- # Raises error for missing translations
28
- # config.action_view.raise_on_missing_translations = true
29
- end
@@ -1,68 +0,0 @@
1
- # typed: strict
2
- Rails.application.configure do
3
- # Settings specified here will take precedence over those in config/application.rb.
4
-
5
- # Code is not reloaded between requests.
6
- config.cache_classes = true
7
-
8
- # Eager load code on boot. This eager loads most of Rails and
9
- # your application in memory, allowing both threaded web servers
10
- # and those relying on copy on write to perform better.
11
- # Rake tasks automatically ignore this option for performance.
12
- config.eager_load = true
13
-
14
- # Full error reports are disabled and caching is turned on.
15
- config.consider_all_requests_local = false
16
- config.action_controller.perform_caching = true
17
-
18
- # Enable Rack::Cache to put a simple HTTP cache in front of your application
19
- # Add `rack-cache` to your Gemfile before enabling this.
20
- # For large-scale production use, consider using a caching reverse proxy like
21
- # NGINX, varnish or squid.
22
- # config.action_dispatch.rack_cache = true
23
-
24
- # Disable serving static files from the `/public` folder by default since
25
- # Apache or NGINX already handles this.
26
- config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
27
-
28
-
29
- # Specifies the header that your server uses for sending files.
30
- # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
31
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
32
-
33
- # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
34
- # config.force_ssl = true
35
-
36
- # Use the lowest log level to ensure availability of diagnostic information
37
- # when problems arise.
38
- config.log_level = :debug
39
-
40
- # Prepend all log lines with the following tags.
41
- # config.log_tags = [ :subdomain, :uuid ]
42
-
43
- # Use a different logger for distributed setups.
44
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
45
-
46
- # Use a different cache store in production.
47
- # config.cache_store = :mem_cache_store
48
-
49
- # Enable serving of images, stylesheets, and JavaScripts from an asset server.
50
- # config.action_controller.asset_host = 'http://assets.example.com'
51
-
52
- # Ignore bad email addresses and do not raise email delivery errors.
53
- # Set this to true and configure the email server for immediate delivery to raise delivery errors.
54
- # config.action_mailer.raise_delivery_errors = false
55
-
56
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
57
- # the I18n.default_locale when a translation cannot be found).
58
- config.i18n.fallbacks = true
59
-
60
- # Send deprecation notices to registered listeners.
61
- config.active_support.deprecation = :notify
62
-
63
- # Use default logging formatter so that PID and timestamp are not suppressed.
64
- config.log_formatter = ::Logger::Formatter.new
65
-
66
- # Do not dump schema after migrations.
67
- config.active_record.dump_schema_after_migration = false
68
- end