mongoid/mongoid — pull request #2642 by lackac (2012-12-20 10:45:13+00:00)
Title: Don't execute update command when concatenating empty array

Current implementation of `Mongoid::Relations::Embedded::Many#concat` will always run `#batch_insert`, even if the supplied `docs` array is empty. This could have a small performance impact on code relying on `#concat` but can also lead to an issue in `Batchable#path` where `#atomic_path` will be sent to `nil`.

This also brings the approach of `#concat` closer to the implementation of `#<<` where an empty list of arguments will leave the target untouched.