From 8e44c93b4c0e4b1bdd0fca13b79f5be1088d6959 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 18 Dec 2012 11:26:57 -0800 Subject: Revert "use File.basename to get the filename minus .yml" This reverts commit 00c5342d96a3677c0a6a2bb8316c76182f5bdfdd. Conflicts: activerecord/lib/active_record/fixtures.rb --- activerecord/lib/active_record/fixtures.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index c5ad14722e..4ed2f93e82 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -751,11 +751,10 @@ module ActiveRecord self.fixture_class_names = self.fixture_class_names.merge(class_names.stringify_keys) end - def fixtures(*fixture_set_names) + def fixtures(*fixture_names) if fixture_set_names.first == :all - fixture_set_names = Dir["#{fixture_path}/**/*.yml"].map { |f| - File.basename f, '.yml' - } + fixture_set_names = Dir["#{fixture_path}/**/*.{yml}"] + fixture_set_names.map! { |f| f[(fixture_path.size + 1)..-5] } else fixture_set_names = fixture_set_names.flatten.map { |n| n.to_s } end -- cgit v1.2.3