From b7934afe326f8bba9cdcacdfac93062dff155efe Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 27 Sep 2010 18:55:28 -0700 Subject: =?UTF-8?q?use=20new=20skool=20Ruby=20instead=20of=20Ruby=20Classi?= =?UTF-8?q?c=E2=84=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- activerecord/lib/active_record/fixtures.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 826031a3e3..6fb723f2f5 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -704,11 +704,9 @@ class Fixtures < (RUBY_VERSION < '1.9' ? YAML::Omap : Hash) end def read_yaml_fixture_files - yaml_string = "" - Dir["#{@fixture_path}/**/*.yml"].select { |f| test(?f, f) }.each do |subfixture_path| - yaml_string << IO.read(subfixture_path) - end - yaml_string << IO.read(yaml_file_path) + yaml_string = (Dir["#{@fixture_path}/**/*.yml"].select { |f| + File.file?(f) + } + [yaml_file_path]).map { |file_path| IO.read(file_path) }.join if yaml = parse_yaml_string(yaml_string) # If the file is an ordered map, extract its children. -- cgit v1.2.3