提交 00c5342d 编写于 作者: A Aaron Patterson

use File.basename to get the filename minus .yml

上级 508493ca
......@@ -754,8 +754,9 @@ def set_fixture_class(class_names = {})
def fixtures(*fixture_names)
if fixture_names.first == :all
fixture_names = Dir["#{fixture_path}/**/*.{yml}"]
fixture_names.map! { |f| f[(fixture_path.size + 1)..-5] }
fixture_names = Dir["#{fixture_path}/**/*.yml"].map { |f|
File.basename f, '.yml'
}
else
fixture_names = fixture_names.flatten.map { |n| n.to_s }
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册