diff options
| author | Andrew White <andrew.white@unboxed.co> | 2017-03-06 17:40:15 +0000 |
|---|---|---|
| committer | Andrew White <andrew.white@unboxed.co> | 2017-03-06 17:51:03 +0000 |
| commit | 48b37f127fb44b787ae6c0710982d7949b14454f (patch) | |
| tree | d3def9f511624a1c9c376590f4a1c7837ef370f2 /activemodel/lib/active_model/validations.rb | |
| parent | 53692535896437f7c67093820f09440c672fa215 (diff) | |
| download | rails-48b37f127fb44b787ae6c0710982d7949b14454f.tar.gz rails-48b37f127fb44b787ae6c0710982d7949b14454f.tar.bz2 rails-48b37f127fb44b787ae6c0710982d7949b14454f.zip | |
Update `titlelize` regex to allow apostrophes
In 4b685aa the regex in `titlelize` was updated to not match
apostrophes to better reflect the nature of the transformation.
Unfortunately this had the side effect of breaking capitalization
on the first word of a sub-string, e.g:
>> "This was 'fake news'".titleize
=> "This Was 'fake News'"
This is fixed by extending the look-behind to also check for a
word character on the other side of the apostrophe.
Fixes #28312.
Diffstat (limited to 'activemodel/lib/active_model/validations.rb')
0 files changed, 0 insertions, 0 deletions
