rails/rails — pull request #4481 by alexeymuranov (2012-01-16 21:21:02+00:00)
Title: Backport PR #4153 and #4224 to 3-2-stable

This is a rebase of commits from PR #4153 and #4224 to `3-2-stable`, with minor changes in one commit.