Cheery-picking https://github.com/couchbase/couchbase-ruby-model/commit/c1efdc5af2a6f22d0a8734509abc7f003231f60e to sync with original model gem