Skip to content

Commit 2bed02c

Browse files
committed
Alternative approach
1 parent a610e6b commit 2bed02c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autoload/rails.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ function! rails#singularize(word)
570570
" Probably not worth it to be as comprehensive as Rails but we can
571571
" still hit the common cases.
572572
let word = a:word
573-
let last_word = split(s:sub(word, '^:', ''),"_")[-1]
573+
let last_word = reverse(split(s:sub(word, '^:', ''), "_"))[0]
574574
if word =~? '\.js$' || word == ''
575575
return word
576576
elseif has_key(g:rails_custom_singularize, last_word)

0 commit comments

Comments
 (0)