Remove sqlite specific`supports_autoincrement?` which always defaults to true
inversed instance should not be reloaded after stale state was changed

check at association reader that record is inverted and should not be reloaded because of stale was changed at target record
add inversed accessor to association class
Add a note to the changelog for #9499
Merge pull request #11833 from vipulnsward/remove_autoincrement

Remove sqlite specific`supports_autoincrement?` which defaults to true
Merge pull request #9499 from dmitry/inverse_instance_should_not_be_reloaded_after_stale_state_change

Inversed instance should not be reloaded after stale state was changed

Conflicts:
	activerecord/CHANGELOG.md
Remove `default_primary_key_type`  and extract contains of `native_database_types` to a constant since they aren't conditional now in SQLite3Adapter. Makes it more like other adapters.
Merge pull request #12527 from vipulnsward/sqlite_database_types

SQLite3 Adapter datatypes cleanup
scope_chain should not be mutated for other reflections

Currently `scope_chain` uses same array for building different
`scope_chain` for different associations. During processing
these arrays are sometimes mutated and because of in-place
mutation the changed `scope_chain` impacts other reflections.

Fix is to dup the value before adding to the `scope_chain`.

Fixes #3882.
`$SAFE = 4;` has been removed with Ruby 2.1

For background -
https://bugs.ruby-lang.org/issues/8468
Changset - https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/41259/diff/test/ruby/test_thread.rb
Merge pull request #12530 from vipulnsward/remove_thread_safe

`$SAFE = 4;` has been removed with Ruby 2.1
Minor Refactoring to `NumberHelper#number_to_human`

* Use destructive `map` and `sort_by` to save extra object creation.
* Create `INVERTED_DECIMAL_UNITS.invert` constant instead of repeatedly doing `DECIMAL_UNITS.invert`
Fix `singleton_class?`

Due to changes from http://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/39628 current `singleton_class?` implementation fails.
Changed based on reference from http://bugs.ruby-lang.org/issues/7609
Remove size alias for length validation

Removed ```The `size` helper is an alias for `length`.``` line. If you use this "nonexist" helper, you will get an error message like this: 

```
ArgumentError: Unknown validator: 'SizeValidator'
...
```

Maybe wanted to mean ```validates_size_of``` helper as an alias for ```validates_length_of``` helper.
Merge pull request #12532 from vipulnsward/singleton_class

Fix `singleton_class?`
Merge pull request #10538 from neerajdotname/3882

scope_chain should not be mutated for other reflections
only calculate offset index once. #12537
the preloader for the RHS has all the preloaded records, so ask it
simplify populating the ordering hash
Merge pull request #12536 from sbagdat/patch-1

Remove size alias for length validation