提交 d3f87654 编写于 作者: S Santiago Pastorino

Avoid range object creation

上级 938243fe
......@@ -128,7 +128,7 @@ def view_assigns
hash = {}
variables = instance_variable_names
variables -= protected_instance_variables if respond_to?(:protected_instance_variables)
variables.each { |name| hash[name.to_s[1..-1]] = instance_variable_get(name) }
variables.each { |name| hash[name.to_s[1, name.length]] = instance_variable_get(name) }
hash
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册