railties 6.0.0.beta2 → 6.0.2.rc1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +150 -7
- data/RDOC_MAIN.rdoc +3 -3
- data/README.rdoc +1 -1
- data/lib/rails/api/task.rb +1 -0
- data/lib/rails/application.rb +23 -5
- data/lib/rails/application/bootstrap.rb +2 -10
- data/lib/rails/application/configuration.rb +45 -1
- data/lib/rails/application/default_middleware_stack.rb +1 -0
- data/lib/rails/application/dummy_erb_compiler.rb +18 -0
- data/lib/rails/application/finisher.rb +44 -1
- data/lib/rails/autoloaders.rb +14 -2
- data/lib/rails/command/base.rb +4 -0
- data/lib/rails/command/environment_argument.rb +7 -4
- data/lib/rails/commands/console/console_command.rb +6 -0
- data/lib/rails/commands/credentials/USAGE +1 -1
- data/lib/rails/commands/credentials/credentials_command.rb +17 -3
- data/lib/rails/commands/dbconsole/dbconsole_command.rb +19 -7
- data/lib/rails/commands/dev/dev_command.rb +4 -2
- data/lib/rails/commands/encrypted/USAGE +28 -0
- data/lib/rails/commands/encrypted/encrypted_command.rb +1 -0
- data/lib/rails/commands/initializers/initializers_command.rb +7 -0
- data/lib/rails/commands/notes/notes_command.rb +1 -1
- data/lib/rails/commands/runner/runner_command.rb +7 -3
- data/lib/rails/commands/server/server_command.rb +8 -6
- data/lib/rails/engine.rb +41 -42
- data/lib/rails/engine/configuration.rb +3 -2
- data/lib/rails/gem_version.rb +2 -2
- data/lib/rails/generators.rb +2 -0
- data/lib/rails/generators/app_base.rb +5 -5
- data/lib/rails/generators/app_name.rb +2 -2
- data/lib/rails/generators/base.rb +4 -0
- data/lib/rails/generators/database.rb +1 -1
- data/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt +6 -3
- data/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt +8 -0
- data/lib/rails/generators/generated_attribute.rb +36 -10
- data/lib/rails/generators/named_base.rb +1 -1
- data/lib/rails/generators/rails/app/app_generator.rb +1 -0
- data/lib/rails/generators/rails/app/templates/Gemfile.tt +4 -4
- data/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt +8 -0
- data/lib/rails/generators/rails/app/templates/bin/setup.tt +3 -2
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +2 -0
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +2 -0
- data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +10 -4
- data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +3 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_0.rb.tt +12 -0
- data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +3 -0
- data/lib/rails/generators/rails/app/templates/gitignore.tt +1 -0
- data/lib/rails/generators/rails/app/templates/package.json.tt +3 -3
- data/lib/rails/generators/rails/app/templates/public/robots.txt +1 -1
- data/lib/rails/generators/rails/app/templates/ruby-version.tt +1 -1
- data/lib/rails/generators/rails/assets/assets_generator.rb +7 -0
- data/lib/rails/generators/rails/db/system/change/change_generator.rb +12 -2
- data/lib/rails/generators/rails/plugin/plugin_generator.rb +0 -15
- data/lib/rails/generators/rails/plugin/templates/gitignore.tt +1 -0
- data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +14 -0
- data/lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt +1 -1
- data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt +1 -1
- data/lib/rails/generators/test_unit/model/templates/fixtures.yml.tt +2 -2
- data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +7 -2
- data/lib/rails/info.rb +1 -1
- data/lib/rails/mailers_controller.rb +6 -3
- data/lib/rails/source_annotation_extractor.rb +19 -6
- data/lib/rails/tasks.rb +1 -0
- data/lib/rails/tasks/zeitwerk.rake +66 -0
- metadata +18 -13
- data/lib/rails/generators/rails/app/templates/bin/update.tt +0 -33
data/lib/rails/engine.rb
CHANGED
@@ -230,7 +230,7 @@ module Rails
|
|
230
230
|
#
|
231
231
|
# If +MyEngine+ is isolated, The routes above will point to
|
232
232
|
# <tt>MyEngine::ArticlesController</tt>. You also don't need to use longer
|
233
|
-
#
|
233
|
+
# URL helpers like +my_engine_articles_path+. Instead, you should simply use
|
234
234
|
# +articles_path+, like you would do with your main application.
|
235
235
|
#
|
236
236
|
# To make this behavior consistent with other parts of the framework,
|
@@ -238,7 +238,7 @@ module Rails
|
|
238
238
|
# normal Rails app, when you use a namespaced model such as
|
239
239
|
# <tt>Namespace::Article</tt>, <tt>ActiveModel::Naming</tt> will generate
|
240
240
|
# names with the prefix "namespace". In an isolated engine, the prefix will
|
241
|
-
# be omitted in
|
241
|
+
# be omitted in URL helpers and form fields, for convenience.
|
242
242
|
#
|
243
243
|
# polymorphic_url(MyEngine::Article.new)
|
244
244
|
# # => "articles_path" # not "my_engine_articles_path"
|
@@ -286,11 +286,11 @@ module Rails
|
|
286
286
|
# Note that the <tt>:as</tt> option given to mount takes the <tt>engine_name</tt> as default, so most of the time
|
287
287
|
# you can simply omit it.
|
288
288
|
#
|
289
|
-
# Finally, if you want to generate a
|
289
|
+
# Finally, if you want to generate a URL to an engine's route using
|
290
290
|
# <tt>polymorphic_url</tt>, you also need to pass the engine helper. Let's
|
291
291
|
# say that you want to create a form pointing to one of the engine's routes.
|
292
292
|
# All you need to do is pass the helper as the first element in array with
|
293
|
-
# attributes for
|
293
|
+
# attributes for URL:
|
294
294
|
#
|
295
295
|
# form_for([my_engine, @user])
|
296
296
|
#
|
@@ -469,13 +469,16 @@ module Rails
|
|
469
469
|
self
|
470
470
|
end
|
471
471
|
|
472
|
-
# Eager load the application by loading all ruby
|
473
|
-
# files inside eager_load paths.
|
474
472
|
def eager_load!
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
473
|
+
# Already done by Zeitwerk::Loader.eager_load_all in the finisher.
|
474
|
+
return if Rails.autoloaders.zeitwerk_enabled?
|
475
|
+
|
476
|
+
config.eager_load_paths.each do |load_path|
|
477
|
+
# Starts after load_path plus a slash, ends before ".rb".
|
478
|
+
relname_range = (load_path.to_s.length + 1)...-3
|
479
|
+
Dir.glob("#{load_path}/**/*.rb").sort.each do |file|
|
480
|
+
require_dependency file[relname_range]
|
481
|
+
end
|
479
482
|
end
|
480
483
|
end
|
481
484
|
|
@@ -530,9 +533,9 @@ module Rails
|
|
530
533
|
|
531
534
|
# Defines the routes for this engine. If a block is given to
|
532
535
|
# routes, it is appended to the engine.
|
533
|
-
def routes
|
536
|
+
def routes(&block)
|
534
537
|
@routes ||= ActionDispatch::Routing::RouteSet.new_with_config(config)
|
535
|
-
@routes.append(&
|
538
|
+
@routes.append(&block) if block_given?
|
536
539
|
@routes
|
537
540
|
end
|
538
541
|
|
@@ -547,12 +550,23 @@ module Rails
|
|
547
550
|
# Blog::Engine.load_seed
|
548
551
|
def load_seed
|
549
552
|
seed_file = paths["db/seeds.rb"].existent.first
|
550
|
-
|
553
|
+
return unless seed_file
|
554
|
+
|
555
|
+
if config.try(:active_job)&.queue_adapter == :async
|
556
|
+
with_inline_jobs { load(seed_file) }
|
557
|
+
else
|
558
|
+
load(seed_file)
|
559
|
+
end
|
551
560
|
end
|
552
561
|
|
553
|
-
|
554
|
-
|
555
|
-
|
562
|
+
initializer :load_environment_config, before: :load_environment_hook, group: :all do
|
563
|
+
paths["config/environments"].existent.each do |environment|
|
564
|
+
require environment
|
565
|
+
end
|
566
|
+
end
|
567
|
+
|
568
|
+
initializer :set_load_path, before: :bootstrap_hook do |app|
|
569
|
+
_all_load_paths(app.config.add_autoload_paths_to_load_path).reverse_each do |path|
|
556
570
|
$LOAD_PATH.unshift(path) if File.directory?(path)
|
557
571
|
end
|
558
572
|
$LOAD_PATH.uniq!
|
@@ -567,12 +581,15 @@ module Rails
|
|
567
581
|
ActiveSupport::Dependencies.autoload_paths.unshift(*_all_autoload_paths)
|
568
582
|
ActiveSupport::Dependencies.autoload_once_paths.unshift(*_all_autoload_once_paths)
|
569
583
|
|
570
|
-
# Freeze so future modifications will fail rather than do nothing mysteriously
|
571
584
|
config.autoload_paths.freeze
|
572
|
-
config.eager_load_paths.freeze
|
573
585
|
config.autoload_once_paths.freeze
|
574
586
|
end
|
575
587
|
|
588
|
+
initializer :set_eager_load_paths, before: :bootstrap_hook do
|
589
|
+
ActiveSupport::Dependencies._eager_load_paths.merge(config.eager_load_paths)
|
590
|
+
config.eager_load_paths.freeze
|
591
|
+
end
|
592
|
+
|
576
593
|
initializer :add_routing_paths do |app|
|
577
594
|
routing_paths = paths["config/routes.rb"].existent
|
578
595
|
|
@@ -596,12 +613,6 @@ module Rails
|
|
596
613
|
end
|
597
614
|
end
|
598
615
|
|
599
|
-
initializer :load_environment_config, before: :load_environment_hook, group: :all do
|
600
|
-
paths["config/environments"].existent.each do |environment|
|
601
|
-
require environment
|
602
|
-
end
|
603
|
-
end
|
604
|
-
|
605
616
|
initializer :prepend_helpers_path do |app|
|
606
617
|
if !isolated? || (app == self)
|
607
618
|
app.config.helpers_paths.unshift(*paths["app/helpers"].existent)
|
@@ -651,22 +662,6 @@ module Rails
|
|
651
662
|
|
652
663
|
private
|
653
664
|
|
654
|
-
def eager_load_with_zeitwerk!
|
655
|
-
(config.eager_load_paths - Zeitwerk::Loader.all_dirs).each do |path|
|
656
|
-
Dir.glob("#{path}/**/*.rb").sort.each { |file| require file }
|
657
|
-
end
|
658
|
-
end
|
659
|
-
|
660
|
-
def eager_load_with_dependencies!
|
661
|
-
config.eager_load_paths.each do |load_path|
|
662
|
-
# Starts after load_path plus a slash, ends before ".rb".
|
663
|
-
relname_range = (load_path.to_s.length + 1)...-3
|
664
|
-
Dir.glob("#{load_path}/**/*.rb").sort.each do |file|
|
665
|
-
require_dependency file[relname_range]
|
666
|
-
end
|
667
|
-
end
|
668
|
-
end
|
669
|
-
|
670
665
|
def load_config_initializer(initializer) # :doc:
|
671
666
|
ActiveSupport::Notifications.instrument("load_config_initializer.railties", initializer: initializer) do
|
672
667
|
load(initializer)
|
@@ -713,8 +708,12 @@ module Rails
|
|
713
708
|
@_all_autoload_paths ||= (config.autoload_paths + config.eager_load_paths + config.autoload_once_paths).uniq
|
714
709
|
end
|
715
710
|
|
716
|
-
def _all_load_paths
|
717
|
-
@_all_load_paths ||=
|
711
|
+
def _all_load_paths(add_autoload_paths_to_load_path)
|
712
|
+
@_all_load_paths ||= begin
|
713
|
+
load_paths = config.paths.load_paths
|
714
|
+
load_paths += _all_autoload_paths if add_autoload_paths_to_load_path
|
715
|
+
load_paths.uniq
|
716
|
+
end
|
718
717
|
end
|
719
718
|
|
720
719
|
def build_request(env)
|
@@ -6,7 +6,7 @@ module Rails
|
|
6
6
|
class Engine
|
7
7
|
class Configuration < ::Rails::Railtie::Configuration
|
8
8
|
attr_reader :root
|
9
|
-
attr_accessor :middleware
|
9
|
+
attr_accessor :middleware, :javascript_path
|
10
10
|
attr_writer :eager_load_paths, :autoload_once_paths, :autoload_paths
|
11
11
|
|
12
12
|
def initialize(root = nil)
|
@@ -14,6 +14,7 @@ module Rails
|
|
14
14
|
@root = root
|
15
15
|
@generators = app_generators.dup
|
16
16
|
@middleware = Rails::Configuration::MiddlewareStackProxy.new
|
17
|
+
@javascript_path = "javascript"
|
17
18
|
end
|
18
19
|
|
19
20
|
# Holds generators configuration:
|
@@ -40,7 +41,7 @@ module Rails
|
|
40
41
|
|
41
42
|
paths.add "app", eager_load: true,
|
42
43
|
glob: "{*,*/concerns}",
|
43
|
-
exclude:
|
44
|
+
exclude: ["assets", javascript_path]
|
44
45
|
paths.add "app/assets", glob: "*"
|
45
46
|
paths.add "app/controllers", eager_load: true
|
46
47
|
paths.add "app/channels", eager_load: true, glob: "**/*_channel.rb"
|
data/lib/rails/gem_version.rb
CHANGED
data/lib/rails/generators.rb
CHANGED
@@ -192,7 +192,7 @@ module Rails
|
|
192
192
|
def web_server_gemfile_entry # :doc:
|
193
193
|
return [] if options[:skip_puma]
|
194
194
|
comment = "Use Puma as the app server"
|
195
|
-
GemfileEntry.new("puma", "~>
|
195
|
+
GemfileEntry.new("puma", "~> 4.1", comment)
|
196
196
|
end
|
197
197
|
|
198
198
|
def include_all_railties? # :doc:
|
@@ -282,7 +282,7 @@ module Rails
|
|
282
282
|
]
|
283
283
|
elsif options.edge?
|
284
284
|
[
|
285
|
-
GemfileEntry.github("rails", "rails/rails")
|
285
|
+
GemfileEntry.github("rails", "rails/rails", "6-0-stable")
|
286
286
|
]
|
287
287
|
else
|
288
288
|
[GemfileEntry.version("rails",
|
@@ -307,7 +307,7 @@ module Rails
|
|
307
307
|
def assets_gemfile_entry
|
308
308
|
return [] if options[:skip_sprockets]
|
309
309
|
|
310
|
-
GemfileEntry.version("sass-rails", "
|
310
|
+
GemfileEntry.version("sass-rails", ">= 6", "Use SCSS for stylesheets")
|
311
311
|
end
|
312
312
|
|
313
313
|
def webpacker_gemfile_entry
|
@@ -316,13 +316,13 @@ module Rails
|
|
316
316
|
if options.dev? || options.edge?
|
317
317
|
GemfileEntry.github "webpacker", "rails/webpacker", nil, "Use development version of Webpacker"
|
318
318
|
else
|
319
|
-
GemfileEntry.version "webpacker", "
|
319
|
+
GemfileEntry.version "webpacker", "~> 4.0", "Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker"
|
320
320
|
end
|
321
321
|
end
|
322
322
|
|
323
323
|
def jbuilder_gemfile_entry
|
324
324
|
comment = "Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder"
|
325
|
-
GemfileEntry.new "jbuilder", "~> 2.
|
325
|
+
GemfileEntry.new "jbuilder", "~> 2.7", comment, {}, options[:api]
|
326
326
|
end
|
327
327
|
|
328
328
|
def javascript_gemfile_entry
|
@@ -7,11 +7,11 @@ module Rails
|
|
7
7
|
|
8
8
|
private
|
9
9
|
def app_name
|
10
|
-
@app_name ||= original_app_name.tr("
|
10
|
+
@app_name ||= original_app_name.tr('\\', "").tr("-. ", "_")
|
11
11
|
end
|
12
12
|
|
13
13
|
def original_app_name
|
14
|
-
@original_app_name ||=
|
14
|
+
@original_app_name ||= defined_app_const_base? ? defined_app_name : File.basename(destination_root)
|
15
15
|
end
|
16
16
|
|
17
17
|
def defined_app_name
|
@@ -24,6 +24,10 @@ module Rails
|
|
24
24
|
add_runtime_options!
|
25
25
|
strict_args_position!
|
26
26
|
|
27
|
+
def self.exit_on_failure? # :nodoc:
|
28
|
+
false
|
29
|
+
end
|
30
|
+
|
27
31
|
# Returns the source root for this generator using default_source_root as default.
|
28
32
|
def self.source_root(path = nil)
|
29
33
|
@_source_root = path if path
|
@@ -15,7 +15,7 @@ module Rails
|
|
15
15
|
case database
|
16
16
|
when "mysql" then ["mysql2", [">= 0.4.4"]]
|
17
17
|
when "postgresql" then ["pg", [">= 0.18", "< 2.0"]]
|
18
|
-
when "sqlite3" then ["sqlite3", ["~> 1.
|
18
|
+
when "sqlite3" then ["sqlite3", ["~> 1.4"]]
|
19
19
|
when "oracle" then ["activerecord-oracle_enhanced-adapter", nil]
|
20
20
|
when "frontbase" then ["ruby-frontbase", nil]
|
21
21
|
when "sqlserver" then ["activerecord-sqlserver-adapter", nil]
|
@@ -4,9 +4,9 @@
|
|
4
4
|
<h2><%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>
|
5
5
|
|
6
6
|
<ul>
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
<%% <%= singular_table_name %>.errors.full_messages.each do |message| %>
|
8
|
+
<li><%%= message %></li>
|
9
|
+
<%% end %>
|
10
10
|
</ul>
|
11
11
|
</div>
|
12
12
|
<%% end %>
|
@@ -21,6 +21,9 @@
|
|
21
21
|
<div class="field">
|
22
22
|
<%%= form.label :password_confirmation %>
|
23
23
|
<%%= form.password_field :password_confirmation %>
|
24
|
+
<% elsif attribute.attachments? -%>
|
25
|
+
<%%= form.label :<%= attribute.column_name %> %>
|
26
|
+
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true %>
|
24
27
|
<% else -%>
|
25
28
|
<%%= form.label :<%= attribute.column_name %> %>
|
26
29
|
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %> %>
|
@@ -3,7 +3,15 @@
|
|
3
3
|
<% attributes.reject(&:password_digest?).each do |attribute| -%>
|
4
4
|
<p>
|
5
5
|
<strong><%= attribute.human_name %>:</strong>
|
6
|
+
<% if attribute.attachment? -%>
|
7
|
+
<%%= link_to @<%= singular_table_name %>.<%= attribute.column_name %>.filename, @<%= singular_table_name %>.<%= attribute.column_name %> if @<%= singular_table_name %>.<%= attribute.column_name %>.attached? %>
|
8
|
+
<% elsif attribute.attachments? -%>
|
9
|
+
<%% @<%= singular_table_name %>.<%= attribute.column_name %>.each do |<%= attribute.singular_name %>| %>
|
10
|
+
<div><%%= link_to <%= attribute.singular_name %>.filename, <%= attribute.singular_name %> %></div>
|
11
|
+
<%% end %>
|
12
|
+
<% else -%>
|
6
13
|
<%%= @<%= singular_table_name %>.<%= attribute.column_name %> %>
|
14
|
+
<% end -%>
|
7
15
|
</p>
|
8
16
|
|
9
17
|
<% end -%>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "active_support/time"
|
4
|
+
require "active_support/deprecation"
|
4
5
|
|
5
6
|
module Rails
|
6
7
|
module Generators
|
@@ -51,6 +52,12 @@ module Rails
|
|
51
52
|
type = $1
|
52
53
|
provided_options = $2.split(/[,.-]/)
|
53
54
|
options = Hash[provided_options.map { |opt| [opt.to_sym, true] }]
|
55
|
+
|
56
|
+
if options[:required]
|
57
|
+
ActiveSupport::Deprecation.warn("Passing {required} option has no effect on the model generator. It will be removed in Rails 6.1.\n")
|
58
|
+
options.delete(:required)
|
59
|
+
end
|
60
|
+
|
54
61
|
return type, options
|
55
62
|
else
|
56
63
|
return type, {}
|
@@ -68,13 +75,15 @@ module Rails
|
|
68
75
|
|
69
76
|
def field_type
|
70
77
|
@field_type ||= case type
|
71
|
-
when :integer
|
72
|
-
when :float, :decimal
|
73
|
-
when :time
|
74
|
-
when :datetime, :timestamp
|
75
|
-
when :date
|
76
|
-
when :text
|
77
|
-
when :
|
78
|
+
when :integer then :number_field
|
79
|
+
when :float, :decimal then :text_field
|
80
|
+
when :time then :time_select
|
81
|
+
when :datetime, :timestamp then :datetime_select
|
82
|
+
when :date then :date_select
|
83
|
+
when :text then :text_area
|
84
|
+
when :rich_text then :rich_text_area
|
85
|
+
when :boolean then :check_box
|
86
|
+
when :attachment, :attachments then :file_field
|
78
87
|
else
|
79
88
|
:text_field
|
80
89
|
end
|
@@ -90,7 +99,9 @@ module Rails
|
|
90
99
|
when :string then name == "type" ? "" : "MyString"
|
91
100
|
when :text then "MyText"
|
92
101
|
when :boolean then false
|
93
|
-
when :references, :belongs_to
|
102
|
+
when :references, :belongs_to,
|
103
|
+
:attachment, :attachments,
|
104
|
+
:rich_text then nil
|
94
105
|
else
|
95
106
|
""
|
96
107
|
end
|
@@ -133,7 +144,7 @@ module Rails
|
|
133
144
|
end
|
134
145
|
|
135
146
|
def required?
|
136
|
-
|
147
|
+
reference? && Rails.application.config.active_record.belongs_to_required_by_default
|
137
148
|
end
|
138
149
|
|
139
150
|
def has_index?
|
@@ -152,6 +163,22 @@ module Rails
|
|
152
163
|
type == :token
|
153
164
|
end
|
154
165
|
|
166
|
+
def rich_text?
|
167
|
+
type == :rich_text
|
168
|
+
end
|
169
|
+
|
170
|
+
def attachment?
|
171
|
+
type == :attachment
|
172
|
+
end
|
173
|
+
|
174
|
+
def attachments?
|
175
|
+
type == :attachments
|
176
|
+
end
|
177
|
+
|
178
|
+
def virtual?
|
179
|
+
rich_text? || attachment? || attachments?
|
180
|
+
end
|
181
|
+
|
155
182
|
def inject_options
|
156
183
|
(+"").tap { |s| options_for_migration.each { |k, v| s << ", #{k}: #{v.inspect}" } }
|
157
184
|
end
|
@@ -163,7 +190,6 @@ module Rails
|
|
163
190
|
def options_for_migration
|
164
191
|
@attr_options.dup.tap do |options|
|
165
192
|
if required?
|
166
|
-
options.delete(:required)
|
167
193
|
options[:null] = false
|
168
194
|
end
|
169
195
|
|
@@ -213,7 +213,7 @@ module Rails
|
|
213
213
|
#
|
214
214
|
def self.check_class_collision(options = {}) # :doc:
|
215
215
|
define_method :check_class_collision do
|
216
|
-
name = if respond_to?(:controller_class_name) # for ResourceHelpers
|
216
|
+
name = if respond_to?(:controller_class_name, true) # for ResourceHelpers
|
217
217
|
controller_class_name
|
218
218
|
else
|
219
219
|
class_name
|
@@ -28,7 +28,7 @@ ruby <%= "'#{RUBY_VERSION}'" -%>
|
|
28
28
|
|
29
29
|
<% if depend_on_bootsnap? -%>
|
30
30
|
# Reduces boot times through caching; required in config/boot.rb
|
31
|
-
gem 'bootsnap', '>= 1.4.
|
31
|
+
gem 'bootsnap', '>= 1.4.2', require: false
|
32
32
|
|
33
33
|
<%- end -%>
|
34
34
|
<%- if options.api? -%>
|
@@ -69,10 +69,10 @@ group :test do
|
|
69
69
|
# Adds support for Capybara system testing and selenium driver
|
70
70
|
gem 'capybara', '>= 2.15'
|
71
71
|
gem 'selenium-webdriver'
|
72
|
-
# Easy installation and use of
|
73
|
-
gem '
|
72
|
+
# Easy installation and use of web drivers to run system tests with browsers
|
73
|
+
gem 'webdrivers'
|
74
74
|
end
|
75
|
-
<%- end -%>
|
76
75
|
|
76
|
+
<%- end -%>
|
77
77
|
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
78
78
|
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|