walk the tree rather than generating a hash and walking it
rename the variable to make more sense with a tree
Add documentation for after_touch [ci skip]
reduce number of comparisons and array allocations

Just inspecting the children nodes will reduce the number of comparisons
we have to do (since it is limited to the child size)
parent is guaranteed to be the same

since we are searching a tree, the current level should be consistent,
so we don't have to inspect the parent class / table
we do not need to to_s the name all the time
we will always detect the same node, so just pass the node in
eliminate function that is only used in one place
names are guaranteed to be symbols
Fix the indentation
Move define_readers to class method since it doesn't need nothing from
the instance
Move define_writers to class level since we don't need anything from the
instance
Move define_constructors to class level
Move add_counter_cache_methods to class level
Use the reflection name instead of the accessor
Push define_accessors to class level since we don't need anythig from
the instance
:scissors:
Define the association extensions without need to have a builder
instance
Merge pull request #12473 from claudiob/document-after-touch

Add documentation for after_touch [ci skip]
Fixing repond_with working directly on the options hash

This fixes an issue where the respond_with worked directly with the given
options hash, so that if a user relied on it after calling respond_with,
the hash wouldn't be the same.

Fixes #12029