diff --git a/RAILS_VERSION b/RAILS_VERSION
index 21cfcbd0d80d13a69d4421213e476a2ad967518b..6b829f5d9bca8eff26e52b884bd80bded9daf2fc 100644
--- a/RAILS_VERSION
+++ b/RAILS_VERSION
@@ -1 +1 @@
-6.0.0.beta2
+6.0.0.beta3
diff --git a/actioncable/CHANGELOG.md b/actioncable/CHANGELOG.md
index aa72cec9cb50020330baa2b5f5510e400c0514d7..9f312f88067dd35ccba026fc77e8468e26e5f0ad 100644
--- a/actioncable/CHANGELOG.md
+++ b/actioncable/CHANGELOG.md
@@ -1,3 +1,8 @@
+## Rails 6.0.0.beta3 (March 11, 2019) ##
+
+* No changes.
+
+
## Rails 6.0.0.beta2 (February 25, 2019) ##
* PostgreSQL subscription adapters now support `channel_prefix` option in cable.yml
diff --git a/actioncable/lib/action_cable/gem_version.rb b/actioncable/lib/action_cable/gem_version.rb
index 728b3e90cb487528c44637dcb89e7fee231f9a22..2be81736c6e4dcc5a1490935ac79a12a11971092 100644
--- a/actioncable/lib/action_cable/gem_version.rb
+++ b/actioncable/lib/action_cable/gem_version.rb
@@ -10,7 +10,7 @@ module VERSION
MAJOR = 6
MINOR = 0
TINY = 0
- PRE = "beta2"
+ PRE = "beta3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
diff --git a/actioncable/package.json b/actioncable/package.json
index f6691e10d185f349f3609fb3561bda539aca782d..4451afd17ff20c15dc8234cb3d64f013622c4bbf 100644
--- a/actioncable/package.json
+++ b/actioncable/package.json
@@ -1,6 +1,6 @@
{
"name": "@rails/actioncable",
- "version": "6.0.0-beta2",
+ "version": "6.0.0-beta3",
"description": "WebSocket framework for Ruby on Rails.",
"main": "app/assets/javascripts/action_cable.js",
"files": [
diff --git a/actionmailbox/CHANGELOG.md b/actionmailbox/CHANGELOG.md
index d47f72fff7d0e5b9a3e61d4687399f0f0c9f3622..f59c052d6321ea20a06750e23c2e9e7385701ae4 100644
--- a/actionmailbox/CHANGELOG.md
+++ b/actionmailbox/CHANGELOG.md
@@ -1,3 +1,8 @@
+## Rails 6.0.0.beta3 (March 11, 2019) ##
+
+* No changes.
+
+
## Rails 6.0.0.beta2 (February 25, 2019) ##
* Allow skipping incineration of processed emails.
diff --git a/actionmailbox/lib/action_mailbox/gem_version.rb b/actionmailbox/lib/action_mailbox/gem_version.rb
index e7e3317f1685034cc8fe36e32c4fb97d26911480..a063553471a56597c499d6c7a3076b4c2dba77de 100644
--- a/actionmailbox/lib/action_mailbox/gem_version.rb
+++ b/actionmailbox/lib/action_mailbox/gem_version.rb
@@ -10,7 +10,7 @@ module VERSION
MAJOR = 6
MINOR = 0
TINY = 0
- PRE = "beta2"
+ PRE = "beta3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
diff --git a/actionmailer/CHANGELOG.md b/actionmailer/CHANGELOG.md
index e9d8d07c79d5c19519ea88308acaee713acba525..182c43551d5da96cbd1ccca59a7f5b6ebd9ba982 100644
--- a/actionmailer/CHANGELOG.md
+++ b/actionmailer/CHANGELOG.md
@@ -1,3 +1,8 @@
+## Rails 6.0.0.beta3 (March 11, 2019) ##
+
+* No changes.
+
+
## Rails 6.0.0.beta2 (February 25, 2019) ##
* No changes.
diff --git a/actionmailer/lib/action_mailer/gem_version.rb b/actionmailer/lib/action_mailer/gem_version.rb
index 3002fd2ad6d8b1846c63674fdc7a2117828e57a7..4efcd966db2cabd57b730ec778841ae87ffc41be 100644
--- a/actionmailer/lib/action_mailer/gem_version.rb
+++ b/actionmailer/lib/action_mailer/gem_version.rb
@@ -10,7 +10,7 @@ module VERSION
MAJOR = 6
MINOR = 0
TINY = 0
- PRE = "beta2"
+ PRE = "beta3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md
index 8eaaee51008a7ff75b50cb6c53b0881ff9683811..2df6f5fc090404bd0240e9a5feeb076812420da6 100644
--- a/actionpack/CHANGELOG.md
+++ b/actionpack/CHANGELOG.md
@@ -1,3 +1,8 @@
+## Rails 6.0.0.beta3 (March 11, 2019) ##
+
+* No changes.
+
+
## Rails 6.0.0.beta2 (February 25, 2019) ##
* Make debug exceptions works in an environment where ActiveStorage is not loaded.
diff --git a/actionpack/lib/action_dispatch/http/mime_negotiation.rb b/actionpack/lib/action_dispatch/http/mime_negotiation.rb
index 498b1e669576005398fcdcf457cf67ad679d25b2..4e81ba12a58b8378f69cf9ce2ffb93dfcde92918 100644
--- a/actionpack/lib/action_dispatch/http/mime_negotiation.rb
+++ b/actionpack/lib/action_dispatch/http/mime_negotiation.rb
@@ -79,6 +79,11 @@ def formats
else
[Mime[:html]]
end
+
+ v = v.select do |format|
+ format.symbol || format.ref == "*/*"
+ end
+
set_header k, v
end
end
diff --git a/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb b/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb
index 02ccfbc81abea0145600e51cee139ea655d4b3ca..7c43c781c73e1d126792c67bee2ab09de5128f63 100644
--- a/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb
+++ b/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb
@@ -24,9 +24,10 @@ module Session
#
# Rails.application.config.session_store :cookie_store, key: '_your_app_session'
#
- # By default, your secret key base is derived from your application name in
- # the test and development environments. In all other environments, it is stored
- # encrypted in the config/credentials.yml.enc file.
+ # In the development and test environments your application's secret key base is
+ # generated by Rails and stored in a temporary file in tmp/development_secret.txt.
+ # In all other environments, it is stored encrypted in the
+ # config/credentials.yml.enc file.
#
# If your application was not updated to Rails 5.2 defaults, the secret_key_base
# will be found in the old config/secrets.yml file.
diff --git a/actionpack/lib/action_pack/gem_version.rb b/actionpack/lib/action_pack/gem_version.rb
index 8007cfe35bd1ce8af0ad09406c4b80476826bd87..3bbb1734d9053e7885fe4034b0bbed6b91ebdd71 100644
--- a/actionpack/lib/action_pack/gem_version.rb
+++ b/actionpack/lib/action_pack/gem_version.rb
@@ -10,7 +10,7 @@ module VERSION
MAJOR = 6
MINOR = 0
TINY = 0
- PRE = "beta2"
+ PRE = "beta3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
diff --git a/actionpack/test/controller/mime/respond_to_test.rb b/actionpack/test/controller/mime/respond_to_test.rb
index 00e1d5f3b3ddfe22f44c2eba4fa451e89f51f4a2..21de05b323f5fbd2f02402e4a301d57e0f28d689 100644
--- a/actionpack/test/controller/mime/respond_to_test.rb
+++ b/actionpack/test/controller/mime/respond_to_test.rb
@@ -125,7 +125,7 @@ def using_non_conflicting_nested_js_then_js
def custom_type_handling
respond_to do |type|
type.html { render body: "HTML" }
- type.custom("application/crazy-xml") { render body: "Crazy XML" }
+ type.custom("application/fancy-xml") { render body: "Fancy XML" }
type.all { render body: "Nothing" }
end
end
@@ -314,12 +314,14 @@ def setup
@request.host = "www.example.com"
Mime::Type.register_alias("text/html", :iphone)
Mime::Type.register("text/x-mobile", :mobile)
+ Mime::Type.register("application/fancy-xml", :fancy_xml)
end
def teardown
super
Mime::Type.unregister(:iphone)
Mime::Type.unregister(:mobile)
+ Mime::Type.unregister(:fancy_xml)
end
def test_html
@@ -489,10 +491,10 @@ def test_synonyms
end
def test_custom_types
- @request.accept = "application/crazy-xml"
+ @request.accept = "application/fancy-xml"
get :custom_type_handling
- assert_equal "application/crazy-xml", @response.content_type
- assert_equal "Crazy XML", @response.body
+ assert_equal "application/fancy-xml", @response.content_type
+ assert_equal "Fancy XML", @response.body
@request.accept = "text/html"
get :custom_type_handling
diff --git a/actionpack/test/controller/new_base/content_negotiation_test.rb b/actionpack/test/controller/new_base/content_negotiation_test.rb
index 7205e90176f2f60dc2c66ef214b1cf523703dbfb..6de91c57b7286b4d0a69a097c3a8e492d5a0ea72 100644
--- a/actionpack/test/controller/new_base/content_negotiation_test.rb
+++ b/actionpack/test/controller/new_base/content_negotiation_test.rb
@@ -20,9 +20,19 @@ class TestContentNegotiation < Rack::TestCase
assert_body "Hello world */*!"
end
- test "Not all mimes are converted to symbol" do
+ test "A js or */* Accept header will return HTML" do
+ get "/content_negotiation/basic/hello", headers: { "HTTP_ACCEPT" => "text/javascript, */*" }
+ assert_body "Hello world text/html!"
+ end
+
+ test "A js or */* Accept header on xhr will return HTML" do
+ get "/content_negotiation/basic/hello", headers: { "HTTP_ACCEPT" => "text/javascript, */*" }, xhr: true
+ assert_body "Hello world text/javascript!"
+ end
+
+ test "Unregistered mimes are ignored" do
get "/content_negotiation/basic/all", headers: { "HTTP_ACCEPT" => "text/plain, mime/another" }
- assert_body '[:text, "mime/another"]'
+ assert_body '[:text]'
end
end
end
diff --git a/actiontext/CHANGELOG.md b/actiontext/CHANGELOG.md
index 203800da1f1e5df8141a81a5d2f5c1752862c9c3..b79ff612fbefaf9a43f55618424a6be75a97b263 100644
--- a/actiontext/CHANGELOG.md
+++ b/actiontext/CHANGELOG.md
@@ -1,3 +1,8 @@
+## Rails 6.0.0.beta3 (March 11, 2019) ##
+
+* No changes.
+
+
## Rails 6.0.0.beta2 (February 25, 2019) ##
* No changes.
diff --git a/actiontext/lib/action_text/gem_version.rb b/actiontext/lib/action_text/gem_version.rb
index da2a9212d3182dbb1682fc8e5010b03937443fa0..ecd32d5f6935570b6a3ca5e76480275d39e9ec33 100644
--- a/actiontext/lib/action_text/gem_version.rb
+++ b/actiontext/lib/action_text/gem_version.rb
@@ -10,7 +10,7 @@ module VERSION
MAJOR = 6
MINOR = 0
TINY = 0
- PRE = "beta2"
+ PRE = "beta3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
diff --git a/actiontext/package.json b/actiontext/package.json
index 6408d387652349f15c5fa0051f98ecbec10a4bd7..f67fea1642516c859c0104d50912b5bd67ac52cf 100644
--- a/actiontext/package.json
+++ b/actiontext/package.json
@@ -1,6 +1,6 @@
{
"name": "@rails/actiontext",
- "version": "6.0.0-beta2",
+ "version": "6.0.0-beta3",
"description": "Edit and display rich text in Rails applications",
"main": "app/javascript/actiontext/index.js",
"files": [
diff --git a/actionview/CHANGELOG.md b/actionview/CHANGELOG.md
index 2e6c37de581db36d5264d6976084c85254512013..d07794ddf3a657fbfc5554386b58769911e6efe6 100644
--- a/actionview/CHANGELOG.md
+++ b/actionview/CHANGELOG.md
@@ -1,3 +1,8 @@
+## Rails 6.0.0.beta3 (March 11, 2019) ##
+
+* No changes.
+
+
## Rails 6.0.0.beta2 (February 25, 2019) ##
* ActionView::Template.finalize_compiled_template_methods is deprecated with
diff --git a/actionview/lib/action_view/gem_version.rb b/actionview/lib/action_view/gem_version.rb
index c799967cc58a643af601fb71f2187adcd455214e..5bed37583ee28bc0c3cf5bc14361e7aa98a5b358 100644
--- a/actionview/lib/action_view/gem_version.rb
+++ b/actionview/lib/action_view/gem_version.rb
@@ -10,7 +10,7 @@ module VERSION
MAJOR = 6
MINOR = 0
TINY = 0
- PRE = "beta2"
+ PRE = "beta3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
diff --git a/actionview/package.json b/actionview/package.json
index 98827efd62a704bff1cb75ce2923cd3afcc82528..e5c8b9bb7d3f1f7031899497c81845408251883f 100644
--- a/actionview/package.json
+++ b/actionview/package.json
@@ -1,6 +1,6 @@
{
"name": "@rails/ujs",
- "version": "6.0.0-beta2",
+ "version": "6.0.0-beta3",
"description": "Ruby on Rails unobtrusive scripting adapter",
"main": "lib/assets/compiled/rails-ujs.js",
"files": [
diff --git a/activejob/CHANGELOG.md b/activejob/CHANGELOG.md
index f782b2d69fff5f708ef6c4710fb47ba02ba5beaf..de375baa9cf6401fba099b0ddaaaed3060e15ebf 100644
--- a/activejob/CHANGELOG.md
+++ b/activejob/CHANGELOG.md
@@ -1,3 +1,8 @@
+## Rails 6.0.0.beta3 (March 11, 2019) ##
+
+* No changes.
+
+
## Rails 6.0.0.beta2 (February 25, 2019) ##
* No changes.
diff --git a/activejob/lib/active_job/gem_version.rb b/activejob/lib/active_job/gem_version.rb
index f303dcddf5a9f9e0fba3ff3774cbe9ca72b87157..5313a4ab9e98f1be90d1e1fa6820660d5ddc20c3 100644
--- a/activejob/lib/active_job/gem_version.rb
+++ b/activejob/lib/active_job/gem_version.rb
@@ -10,7 +10,7 @@ module VERSION
MAJOR = 6
MINOR = 0
TINY = 0
- PRE = "beta2"
+ PRE = "beta3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
diff --git a/activemodel/CHANGELOG.md b/activemodel/CHANGELOG.md
index 71e56e2522df0b135fd5c4867d29d61c998569a1..56fbfacbd7686b4e03039e6e12e18f9d6cbc155b 100644
--- a/activemodel/CHANGELOG.md
+++ b/activemodel/CHANGELOG.md
@@ -1,26 +1,32 @@
* Change how validation error translation strings are fetched: The new behavior
will first try the more specific keys, including doing locale fallback, then try
the less specific ones.
-
+
For example, this is the order in which keys will now be tried for a `blank`
error on a `product`'s `title` attribute with current locale set to `en-US`:
-
+
en-US.activerecord.errors.models.product.attributes.title.blank
en-US.activerecord.errors.models.product.blank
en-US.activerecord.errors.messages.blank
-
+
en.activerecord.errors.models.product.attributes.title.blank
en.activerecord.errors.models.product.blank
en.activerecord.errors.messages.blank
-
+
en-US.errors.attributes.title.blank
en-US.errors.messages.blank
-
+
en.errors.attributes.title.blank
en.errors.messages.blank
-
+
*Hugo Vacher*
+
+## Rails 6.0.0.beta3 (March 11, 2019) ##
+
+* No changes.
+
+
## Rails 6.0.0.beta2 (February 25, 2019) ##
* Fix date value when casting a multiparameter date hash to not convert
diff --git a/activemodel/lib/active_model/gem_version.rb b/activemodel/lib/active_model/gem_version.rb
index 399e724ceaa8fff66a7e94a384d739fdc0d77504..1626aac4687321b9827e97ed04922c0170f2603e 100644
--- a/activemodel/lib/active_model/gem_version.rb
+++ b/activemodel/lib/active_model/gem_version.rb
@@ -10,7 +10,7 @@ module VERSION
MAJOR = 6
MINOR = 0
TINY = 0
- PRE = "beta2"
+ PRE = "beta3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 2d260f2bf5e808965cd224e0484dc914b7af6551..3d7508252a08e62e4e377387972afa37ed6ffe6b 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -70,6 +70,11 @@
*Juani Villarejo*
+## Rails 6.0.0.beta3 (March 11, 2019) ##
+
+* No changes.
+
+
## Rails 6.0.0.beta2 (February 25, 2019) ##
* Fix prepared statements caching to be enabled even when query caching is enabled.
diff --git a/activerecord/lib/active_record/gem_version.rb b/activerecord/lib/active_record/gem_version.rb
index 345441eea87c0ae743d8b1ddaac59e1d745fc048..f77bc2e3c163fb0ad611ca0d4116fcd0f262c080 100644
--- a/activerecord/lib/active_record/gem_version.rb
+++ b/activerecord/lib/active_record/gem_version.rb
@@ -10,7 +10,7 @@ module VERSION
MAJOR = 6
MINOR = 0
TINY = 0
- PRE = "beta2"
+ PRE = "beta3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
diff --git a/activestorage/CHANGELOG.md b/activestorage/CHANGELOG.md
index ba9204249d52765dab8b46b140b626326df8f2af..54fc9491721c8a7d77780b701b03a9ddf91e6c0b 100644
--- a/activestorage/CHANGELOG.md
+++ b/activestorage/CHANGELOG.md
@@ -1,3 +1,8 @@
+## Rails 6.0.0.beta3 (March 11, 2019) ##
+
+* No changes.
+
+
## Rails 6.0.0.beta2 (February 25, 2019) ##
* No changes.
diff --git a/activestorage/lib/active_storage/gem_version.rb b/activestorage/lib/active_storage/gem_version.rb
index 046534fc073315e58dc295b0ada6616931e8f678..d8f8577cc3038812213881a0d97d17c00acc0082 100644
--- a/activestorage/lib/active_storage/gem_version.rb
+++ b/activestorage/lib/active_storage/gem_version.rb
@@ -10,7 +10,7 @@ module VERSION
MAJOR = 6
MINOR = 0
TINY = 0
- PRE = "beta2"
+ PRE = "beta3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
diff --git a/activestorage/package.json b/activestorage/package.json
index 49b9163bd9510ea583dc542982e9221eed343ed9..c363acebdeaf68f30efc0fd9a9ad101405fef51a 100644
--- a/activestorage/package.json
+++ b/activestorage/package.json
@@ -1,6 +1,6 @@
{
"name": "@rails/activestorage",
- "version": "6.0.0-beta2",
+ "version": "6.0.0-beta3",
"description": "Attach cloud and local files in Rails applications",
"main": "app/assets/javascripts/activestorage.js",
"files": [
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md
index 219ea8787ef88ccfcfb11404b5ceb1071bc7017e..2610cc63a4e9367b97e5c4fa2257c3f42fe62148 100644
--- a/activesupport/CHANGELOG.md
+++ b/activesupport/CHANGELOG.md
@@ -27,6 +27,11 @@
*DHH*
+## Rails 6.0.0.beta3 (March 11, 2019) ##
+
+* No changes.
+
+
## Rails 6.0.0.beta2 (February 25, 2019) ##
* New autoloading based on [Zeitwerk](https://github.com/fxn/zeitwerk).
diff --git a/activesupport/lib/active_support/gem_version.rb b/activesupport/lib/active_support/gem_version.rb
index 009bb895a6650dec07aa78a0240bb659725cedcf..cf17922d7d4001fd660f638780bed2e85e131660 100644
--- a/activesupport/lib/active_support/gem_version.rb
+++ b/activesupport/lib/active_support/gem_version.rb
@@ -10,7 +10,7 @@ module VERSION
MAJOR = 6
MINOR = 0
TINY = 0
- PRE = "beta2"
+ PRE = "beta3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
diff --git a/guides/CHANGELOG.md b/guides/CHANGELOG.md
index 41037146a0593cadda6596b2070b238480d29de2..beace1ed6f908b931d165bf46468c47f4eb86606 100644
--- a/guides/CHANGELOG.md
+++ b/guides/CHANGELOG.md
@@ -1,3 +1,8 @@
+## Rails 6.0.0.beta3 (March 11, 2019) ##
+
+* No changes.
+
+
## Rails 6.0.0.beta2 (February 25, 2019) ##
* No changes.
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md
index d2377b3b6d3baafafe57218667c0552d6bdb1c3d..8163b282aafd87b10a20c5735cdb7ed26ba8efd5 100644
--- a/railties/CHANGELOG.md
+++ b/railties/CHANGELOG.md
@@ -1,3 +1,8 @@
+## Rails 6.0.0.beta3 (March 11, 2019) ##
+
+* No changes.
+
+
## Rails 6.0.0.beta2 (February 25, 2019) ##
* Fix non-symbol access to nested hashes returned from `Rails::Application.config_for`
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index fbad3e5db3d8903b95a28807cff1961db95ac997..558a4d1f5780fce1c551118e9bb71c85220f848a 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -415,8 +415,8 @@ def secrets
# then credentials.secret_key_base, and finally secrets.secret_key_base. For most applications,
# the correct place to store it is in the encrypted credentials file.
def secret_key_base
- if Rails.env.test? || Rails.env.development?
- secrets.secret_key_base || Digest::MD5.hexdigest(self.class.name)
+ if Rails.env.development? || Rails.env.test?
+ secrets.secret_key_base ||= generate_development_secret
else
validate_secret_key_base(
ENV["SECRET_KEY_BASE"] || credentials.secret_key_base || secrets.secret_key_base
@@ -581,6 +581,21 @@ def validate_secret_key_base(secret_key_base)
private
+ def generate_development_secret
+ if secrets.secret_key_base.nil?
+ key_file = Rails.root.join("tmp/development_secret.txt")
+
+ if !File.exist?(key_file)
+ random_key = SecureRandom.hex(64)
+ File.binwrite(key_file, random_key)
+ end
+
+ secrets.secret_key_base = File.binread(key_file)
+ end
+
+ secrets.secret_key_base
+ end
+
def build_request(env)
req = super
env["ORIGINAL_FULLPATH"] = req.fullpath
diff --git a/railties/lib/rails/gem_version.rb b/railties/lib/rails/gem_version.rb
index 249894f9d06c14f1145db04aa2347e66d8d26120..fea24810f50c302cb2b285320e031a1587e47ea9 100644
--- a/railties/lib/rails/gem_version.rb
+++ b/railties/lib/rails/gem_version.rb
@@ -10,7 +10,7 @@ module VERSION
MAJOR = 6
MINOR = 0
TINY = 0
- PRE = "beta2"
+ PRE = "beta3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index 9ba5517afd2cf540676c041e4ef6308fc340eccf..eee2d633be6efd9652ca22d428818a5796f71078 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -596,6 +596,27 @@ def index
assert_equal "some_value", verifier.verify(message)
end
+ test "application will generate secret_key_base in tmp file if blank in development" do
+ app_file "config/initializers/secret_token.rb", <<-RUBY
+ Rails.application.credentials.secret_key_base = nil
+ RUBY
+
+ app "development"
+
+ assert_not_nil app.secrets.secret_key_base
+ assert File.exist?(app_path("tmp/development_secret.txt"))
+ end
+
+ test "application will not generate secret_key_base in tmp file if blank in production" do
+ app_file "config/initializers/secret_token.rb", <<-RUBY
+ Rails.application.credentials.secret_key_base = nil
+ RUBY
+
+ assert_raises ArgumentError do
+ app "production"
+ end
+ end
+
test "raises when secret_key_base is blank" do
app_file "config/initializers/secret_token.rb", <<-RUBY
Rails.application.credentials.secret_key_base = nil
@@ -619,7 +640,6 @@ def index
test "application verifier can build different verifiers" do
make_basic_app do |application|
- application.credentials.secret_key_base = "b3c631c314c0bbca50c1b2843150fe33"
application.config.session_store :disabled
end
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb
index b0662e0159d2d05b46f802ace83bd2a132431ef1..14cdf1ab7c28d07e7faff0ce1f149efe6a06555d 100644
--- a/railties/test/isolation/abstract_unit.rb
+++ b/railties/test/isolation/abstract_unit.rb
@@ -226,6 +226,7 @@ def self.name; "RailtiesTestApp"; end
@app.config.session_store :cookie_store, key: "_myapp_session"
@app.config.active_support.deprecation = :log
@app.config.log_level = :info
+ @app.secrets.secret_key_base = "b3c631c314c0bbca50c1b2843150fe33"
yield @app if block_given?
@app.initialize!
diff --git a/version.rb b/version.rb
index 249894f9d06c14f1145db04aa2347e66d8d26120..fea24810f50c302cb2b285320e031a1587e47ea9 100644
--- a/version.rb
+++ b/version.rb
@@ -10,7 +10,7 @@ module VERSION
MAJOR = 6
MINOR = 0
TINY = 0
- PRE = "beta2"
+ PRE = "beta3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end