1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use any instead of length

This commit is contained in:
Rahul P. Chaudhari 2011-11-27 20:02:09 +05:30
parent 3c81fc3b91
commit 1756629835

View file

@ -1239,7 +1239,7 @@ module ActiveRecord
if match_data
rest = name[match_data[0].length, name.length]
rest = rest[1, rest.length] if rest.start_with? "."
[match_data[1], (rest.length > 0 ? rest : nil)]
[match_data[1], (rest.any? ? rest : nil)]
end
end