extracted equality operations in a separated module
Fix positional operator for 1-1 nesting 1-n.

In the case where we have an embeds_many embedded under an embeds_one,
we need to take into account the first path point that has no index in
it.

[ fix #2811 ]
add attribute_before_type_cast

Among other things, this fixes numericality validation. If this looks good, and
it's deemed necessary, I'm happy to add a configuration option which disables
the functionality for people with memory overhead concerns.

See #2137, #2237, #2436, #2429, #2450.
Update changelog
Ensure we use pre-type cast attributes in validation.
1850 first
Add primary key to metadata. [ #1850 ]
Bindings for primary_key option

Changing bindings on referenced relations to use a primary_key if given
[ #1850 ]
Adding specs for [ #1850 ]
Fix specs, update changelog
Fix lazy evaluation and criteria w/ n-n.

If a base document was destroyed, and hence frozen, and we asked for a
count on it's many to many relation, the foreign key would be nil
instead of [] if the default had not been lazy evaluated. We now check
for nil and set to [] on the criteria only.

[ fix #2812 ]
Merge branch 'master' of https://github.com/mongoid/mongoid into master-issues
#2816: Validation on non-fields raises undefined method *_before_type_cast.