aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionmailer/CHANGELOG.md2
-rw-r--r--actionpack/CHANGELOG.md4
-rw-r--r--activerecord/lib/active_record/attribute_methods/serialization.rb7
-rw-r--r--activerecord/test/cases/adapters/postgresql/array_test.rb9
-rw-r--r--activerecord/test/cases/serialized_attribute_test.rb3
-rw-r--r--activesupport/CHANGELOG.md16
-rw-r--r--guides/source/configuring.md29
-rw-r--r--railties/CHANGELOG.md2
-rw-r--r--railties/lib/rails/commands/commands_tasks.rb2
-rw-r--r--railties/lib/rails/commands/update.rb9
10 files changed, 40 insertions, 43 deletions
diff --git a/actionmailer/CHANGELOG.md b/actionmailer/CHANGELOG.md
index e2900c2d10..5685871ac9 100644
--- a/actionmailer/CHANGELOG.md
+++ b/actionmailer/CHANGELOG.md
@@ -10,7 +10,7 @@
using the new Active Job framework in Rails, and will use whatever queue is
configured for Rails.
- *DHH/Abdelkader Boudih/Cristian Bica*
+ *DHH*, *Abdelkader Boudih*, *Cristian Bica*
* Make `ActionMailer::Previews` methods class methods. Previously they were
instance methods and `ActionMailer` tries to render a message when they
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md
index 64105934cd..4626c2650a 100644
--- a/actionpack/CHANGELOG.md
+++ b/actionpack/CHANGELOG.md
@@ -1,10 +1,10 @@
-* Improve Journey compliance to RFC 3986
+* Improve Journey compliance to RFC 3986.
The scanner in Journey failed to recognize routes that use literals
from the sub-delims section of RFC 3986. It's now able to parse those
authorized delimiters and route as expected.
- Fixes #17212
+ Fixes #17212.
*Nicolas Cavigneaux*
diff --git a/activerecord/lib/active_record/attribute_methods/serialization.rb b/activerecord/lib/active_record/attribute_methods/serialization.rb
index 100d6d4229..cc82d00b20 100644
--- a/activerecord/lib/active_record/attribute_methods/serialization.rb
+++ b/activerecord/lib/active_record/attribute_methods/serialization.rb
@@ -8,11 +8,8 @@ module ActiveRecord
# object, and retrieved as the same object, then specify the name of that
# attribute using this method and it will be handled automatically. The
# serialization is done through YAML. If +class_name+ is specified, the
- # serialized object must be of that class on retrieval or
- # <tt>SerializationTypeMismatch</tt> will be raised.
- #
- # A notable side effect of serialized attributes is that the model will
- # be updated on every save, even if it is not dirty.
+ # serialized object must be of that class on assignment and retrieval.
+ # Otherwise <tt>SerializationTypeMismatch</tt> will be raised.
#
# ==== Parameters
#
diff --git a/activerecord/test/cases/adapters/postgresql/array_test.rb b/activerecord/test/cases/adapters/postgresql/array_test.rb
index ff553c3f1a..fa7bebf08b 100644
--- a/activerecord/test/cases/adapters/postgresql/array_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/array_test.rb
@@ -254,6 +254,15 @@ class PostgresqlArrayTest < ActiveRecord::TestCase
end
end
+ def test_assigning_non_array_value
+ record = PgArray.new(tags: "not-an-array")
+ assert_equal "not-an-array", record.tags
+ e = assert_raises(ActiveRecord::StatementInvalid) do
+ record.save!
+ end
+ assert_instance_of PG::InvalidTextRepresentation, e.original_exception
+ end
+
private
def assert_cycle field, array
# test creation
diff --git a/activerecord/test/cases/serialized_attribute_test.rb b/activerecord/test/cases/serialized_attribute_test.rb
index c5fb491b10..46d4da53df 100644
--- a/activerecord/test/cases/serialized_attribute_test.rb
+++ b/activerecord/test/cases/serialized_attribute_test.rb
@@ -140,11 +140,10 @@ class SerializedAttributeTest < ActiveRecord::TestCase
assert_equal 1, Topic.where(:content => nil).count
end
- def test_serialized_attribute_should_raise_exception_on_save_with_wrong_type
+ def test_serialized_attribute_should_raise_exception_on_assignment_with_wrong_type
Topic.serialize(:content, Hash)
assert_raise(ActiveRecord::SerializationTypeMismatch) do
topic = Topic.new(content: 'string')
- topic.save
end
end
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md
index 74d57180fe..a935d33686 100644
--- a/activesupport/CHANGELOG.md
+++ b/activesupport/CHANGELOG.md
@@ -23,8 +23,8 @@
*Joost Lubach*
-* Time#change can now change nanoseconds (:nsec) as a higher-precision
- alternative to microseconds (:usec).
+* `Time#change` can now change nanoseconds (`:nsec`) as a higher-precision
+ alternative to microseconds (`:usec`).
*Agis Anastasooulos*
@@ -39,14 +39,14 @@
*Akira Matsuda*, *Godfrey Chan*
-* Fixed a bug in Inflector#underscore where acroynms in nested constant names
+* Fixed a bug in `Inflector#underscore` where acroynms in nested constant names
are incorrectly parsed as camelCase.
Fixes #8015.
*Fred Wu*, *Matthew Draper*
-* Make Time#change throw an exception if the :usec option is out of range and
+* Make `Time#change` throw an exception if the `:usec` option is out of range and
the time has an offset other than UTC or local.
*Agis Anastasopoulos*
@@ -65,11 +65,11 @@
* Added instance_eval version to Object#try, so you can do this:
- person.try { name.first }
+ person.try { name.first }
instead of:
- person.try { |person| person.name.first }
+ person.try { |person| person.name.first }
*DHH*
@@ -79,12 +79,12 @@
*Robin Dupret*
-* Fix rounding errors with #travel_to by resetting the usec on any passed time to zero, so we only travel
+* Fix rounding errors with `#travel_to` by resetting the usec on any passed time to zero, so we only travel
with per-second precision, not anything deeper than that.
*DHH*
-* Fix DateTime comparison with DateTime::Infinity object.
+* Fix DateTime comparison with `DateTime::Infinity` object.
*Rafael Mendonça França*
diff --git a/guides/source/configuring.md b/guides/source/configuring.md
index be0478653b..58c3f217eb 100644
--- a/guides/source/configuring.md
+++ b/guides/source/configuring.md
@@ -368,20 +368,21 @@ encrypted cookies salt value. Defaults to `'signed encrypted cookie'`.
```ruby
config.action_dispatch.rescue_responses = {
- 'ActionController::RoutingError' => :not_found,
- 'AbstractController::ActionNotFound' => :not_found,
- 'ActionController::MethodNotAllowed' => :method_not_allowed,
- 'ActionController::UnknownHttpMethod' => :method_not_allowed,
- 'ActionController::NotImplemented' => :not_implemented,
- 'ActionController::UnknownFormat' => :not_acceptable,
- 'ActionController::InvalidAuthenticityToken' => :unprocessable_entity,
- 'ActionDispatch::ParamsParser::ParseError' => :bad_request,
- 'ActionController::BadRequest' => :bad_request,
- 'ActionController::ParameterMissing' => :bad_request,
- 'ActiveRecord::RecordNotFound' => :not_found,
- 'ActiveRecord::StaleObjectError' => :conflict,
- 'ActiveRecord::RecordInvalid' => :unprocessable_entity,
- 'ActiveRecord::RecordNotSaved' => :unprocessable_entity
+ 'ActionController::RoutingError' => :not_found,
+ 'AbstractController::ActionNotFound' => :not_found,
+ 'ActionController::MethodNotAllowed' => :method_not_allowed,
+ 'ActionController::UnknownHttpMethod' => :method_not_allowed,
+ 'ActionController::NotImplemented' => :not_implemented,
+ 'ActionController::UnknownFormat' => :not_acceptable,
+ 'ActionController::InvalidAuthenticityToken' => :unprocessable_entity,
+ 'ActionController::InvalidCrossOriginRequest' => :unprocessable_entity,
+ 'ActionDispatch::ParamsParser::ParseError' => :bad_request,
+ 'ActionController::BadRequest' => :bad_request,
+ 'ActionController::ParameterMissing' => :bad_request,
+ 'ActiveRecord::RecordNotFound' => :not_found,
+ 'ActiveRecord::StaleObjectError' => :conflict,
+ 'ActiveRecord::RecordInvalid' => :unprocessable_entity,
+ 'ActiveRecord::RecordNotSaved' => :unprocessable_entity
}
```
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md
index 1e1afef26d..e1a11482e6 100644
--- a/railties/CHANGELOG.md
+++ b/railties/CHANGELOG.md
@@ -1,4 +1,4 @@
-* Remove --skip-action-view option from Rails::Generators::AppBase
+* Remove `--skip-action-view` option from `Rails::Generators::AppBase`.
Fixes #17023.
diff --git a/railties/lib/rails/commands/commands_tasks.rb b/railties/lib/rails/commands/commands_tasks.rb
index 6cfbc70c51..8bae08e44e 100644
--- a/railties/lib/rails/commands/commands_tasks.rb
+++ b/railties/lib/rails/commands/commands_tasks.rb
@@ -127,7 +127,7 @@ EOT
require 'rails/generators'
require_application_and_environment!
Rails.application.load_generators
- require "rails/commands/#{command}"
+ require_command!(command)
end
# Change to the application's path if there is no config.ru file in current directory.
diff --git a/railties/lib/rails/commands/update.rb b/railties/lib/rails/commands/update.rb
deleted file mode 100644
index 59fae5c337..0000000000
--- a/railties/lib/rails/commands/update.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require File.expand_path(File.join(File.dirname(__FILE__), '..', 'generators'))
-
-if ARGV.size == 0
- Rails::Generators.help
- exit
-end
-
-name = ARGV.shift
-Rails::Generators.invoke name, ARGV, behavior: :skip