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.
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.
AttributeSet#include? -> AttributeSet#key?

https://github.com/rails/rails/pull/15868/files#r14135210
Treat invalid uuid as nil
Implement required #encode_with

While running the spec `ARCONN=mysql2 ruby -v -Itest
test/cases/yaml_serialization_test.rb`
the following warning shows up:
`implementing to_yaml is deprecated, please implement "encode_with"`
Move #encode_with to Relation
Merge pull request #16138 from sgrif/sg-attribute-set-key

AttributeSet#include? -> AttributeSet#key?
use foreign key DSL in our tests.
document assert[_not]_empty, assert[_not]_includes, assert[_not]_predicate in testing guide.
link minitest assertions documentation.
Merge pull request #16187 from jone/testing-guide-assertions

Update assertion methods in testing guide [ci skip]
Active Record tests still depend on `capture`. Let's keep it for now.

This is a follow-up to 3121412

/cc @rafaelfranca

This will remove deprecation warnings from the PostgreSQL suite:

```
DEPRECATION WARNING: #capture(stream) is deprecated and will be removed in the next release. (called from capture at /Users/senny/Projects/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:89)
/Users/senny/Projects/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:89:in `capture'
  /Users/senny/Projects/rails/activerecord/test/cases/adapters/postgresql/composite_test.rb:73:in `ensure_warning_is_issued'
  /Users/senny/Projects/rails/activerecord/test/cases/adapters/postgresql/composite_test.rb:48:in `test_column'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:106:in `block (3 levels) in run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:204:in `capture_exceptions'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:103:in `block (2 levels) in run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:256:in `time_it'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:102:in `block in run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:317:in `on_signal'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:276:in `with_info_handler'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:101:in `run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:759:in `run_one_method'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:293:in `run_one_method'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:287:in `block (2 levels) in run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:286:in `each'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:286:in `block in run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:317:in `on_signal'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:306:in `with_info_handler'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:285:in `run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:149:in `block in __run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:149:in `map'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:149:in `__run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:126:in `run'
  /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:55:in `block in autorun'
```
we intend to keep the `capture` helper for Active Record tests.

This is a follow up to f8f5cdc
Don't accept parameters as argument for redirect to [via @homakov]

Closes #16170
nodoc enum hooks [ci skip]
Revert "Rename to test_mysql_strict_mode_disabled_dont_override_global_sql_mode"

This reverts commit babc24c1b07c1fd58b9b3249b0256f9b0d45c0f0.

Conflicts:

	activerecord/test/cases/adapters/mysql/connection_test.rb
	activerecord/test/cases/adapters/mysql2/connection_test.rb
Added truncate_words method to activesupport strings
Remove unused fixtures

These fixtures are not used in actionpack tests.
Added PartialIteration class used when rendering collections

The iteration object is available as the local variable
"template_name_iteration" when rendering partials with collections.

It gives access to the +size+ of the collection beeing iterated over,
the current +index+ and two convinicence methods +first?+ and +last?+

"template_name_counter" variable is kept but is deprecated.

[Joel Junström + Lucas Uyezu]
No need to have a file to PartialIteration class

This class is only used on the PartialRenderer.