Length validation handles correctly nil. Fix #7180

When nil or empty string are not allowed, they are not valid.

Conflicts:
	activemodel/CHANGELOG.md
	activemodel/test/cases/validations/length_validation_test.rb
Merge route requirements

This was fixed upstream in rails@9b4514c
Fix issue with private kernel methods and collection associations. Closes #2508

Change CollectionProxy#method_missing to use scoped.public_send, to
avoid a problem described in issue #2508 when trying to use class
methods with names like "open", that clash with private kernel methods.
Also changed the dynamic matcher instantiator to send straight to
scoped, to avoid another roundtrip to method_missing.

Conflicts:
	activerecord/lib/active_record/associations/collection_proxy.rb
Add :conditions option to uniqueness validator

Conflicts:
	activerecord/test/cases/validations/uniqueness_validation_test.rb
Added parsing of arbitrary media type parameters.

Based on #4918.

Related to #4127.

Conflicts:
	actionpack/test/dispatch/mime_type_test.rb
no need for bang bang :bomb:
fix method visibility
Use Set#subtract and Set#merge for keeping track of used / unused keys
again, use Set#subtract
mutations can't be done without the consent of our proxy object.  This
is one benefit of choosing composition over inheritance.
rename @used to something a bit more meaningful
mutations on the underlying hash should also mutate the discard set
simplify sweep now that discard and flashes are in sync
Fix example in flash middleware
fix the Flash middleware loading the session on every request (very dangerous especially with Rack::Cache), it should only be loaded when the flash method is called
Remove unused ivars left from close checks

These ivars were missed in d142572567 when close checks were removed
bread AD::Request::Session to it's own file, consolidate HASH OF DOOM lookups
make sure the superclass matches so load order does not matter
Store FlashHashes in the session as plain hashes rather than custom objects with unstable class names and instance variables.

Refactor FlashHash to take values for its ivars in the constructor, to pretty up FlashHash.from_session_value.

Remove stale comment on FlashHash: it is no longer Marshaled in the session so we can change its implementation.

Remove blank lines I introduced in controller/test_case.rb.

Unit tests for FlashHash#to_session_value.

Put in a compatibility layer to accept FlashHash serializations from Rails 3.0+.

Test that Rails 3.2 session flashes are correctly converted to the new format.

Remove code path for processing Rails 3.0 FlashHashes since they can no longer deserialize.

Fix session['flash'] deletion condition: it will never be empty?, it will either be nil or a hash with 'discard' and 'flashes' keys.

Conflicts:
	actionpack/lib/action_controller/test_case.rb
Remove nodoc from FlashHash #[]= [ci skip]