Fix bug, when ':dependent => :destroy' option violates foreign key constraints, issue #12380
Use NameError#name to assert raised error.

This makes the test compatible with other Ruby implementations, which
may implement error messages differently.
Upgraded rack
As Rack has some non backwards compatible changes added required
modifications to keep behaviour in rails close to same as before.

Also modified generators to include rack/rack for not yet released
version of rack
Since upgrading rack we can remove unnecessary string encodings
https://github.com/rack/rack/commit/5a5aee36
If a counter_cache exists, use it for #empty?
Fixed a regression introduced in 84cf156

84cf156 (PR #15694) introduced a subtle regression. There are actually three
distinct entry points to creating an AR object – via .new (i.e. #initialize),
via #init_with (e.g. from YAML or database queries) and via .allocate.

With the patch in 84cf156, attribute methods and respond_to? will not work
correctly when objects are allocated directly, without going through either

The reason this test case didn't catch the regression was that the `Topic`
class is shared between test cases, so by the time this test case is ran the
attribute methods are very likely to be defined.

Switching to use a fresh anonymous class in the test to ensure we surface this
problem in the future.
Formatting fix in AS changelog [ci skip]
Revert "Formatting fix in AS changelog [ci skip]"

This reverts commit cede0363830e28e73feafc662eccae7d1db526bb.

Reason: CHANGELOG should not be updated on docrails
Detect in-place modifications on Strings
Add AR::Base#validate! method

Acts same as valid? but raises AR::RecordInvalid exception
if validation fails
Added rollback method to ActiveModel::Dirty
Dont swallow errors when bad alias_method
[ci skip] Add missing colon and period in initialization.md.
remove Set.new from DetailsKey::get, impacts rendering overhead performance

Using ruby-prof, I noticed that Set#add had the largest 'self time'
percentage (5% of the overall time spent rendering) when
benchmarking the rendering of a small cached ERB template that was 3
lines long. It turns out it was from this line. I don't believe the
Set is necessary, either. Removing this line increases the rendering
ips using Benchmark::ips accordingly.
Add always_permitted_parameters as an option.

* This commit adds back the always_permitted_parameters
  configuration option to strong paramaters.
* The initial pull requests where this feature was added
  are the following:
  - https://github.com/rails/rails/pull/12682
  - https://github.com/rails/strong_parameters/pull/174
Tiny follow-up to 1a69112

Wrap list items to 80 chars and avoid relying on NOTE inside an item
since they are meant to be parsed in paragraphs, not lists.

[ci skip]
credit Matthew Higgins for the integration of foreign keys. [ci skip]
Simplify complex code in databases.rake
db:fixtures:{identify,load} tasks respect AR::Tasks::DatabaseTasks.root

Before this commit, if `ENV['FIXTURES_PATH']` was set, then `Rails.root`
was used, otherwise the app used `ActiveRecord::Tasks::DatabaseTasks.root`.

Now it is consistent.
Get rid of duplication in db:fixtures:{identify,load}