duplication removed(DRY)
Merge pull request #13370 from abhishekjain16/refactor_rails

duplication removed(DRY)
Fix nil assignment to polymorphic belongs_to

Assigning nil to a polymorphic belongs_to would nullify its _id field by
not its _type field.

Fixes failing test from c141dfc838a5dca9f197814410fa5d44c143129c.
Regression from 1678e959e973de32287b65c52ebc6cce87148951.
document how to access mail previews. [ci skip]

/cc @pixeltrix
Always point to latest rbx and jruby in travis